Update a Library¶
PATCH /api/v1/libraries/{slug}
Update a library you submitted. The library must be in pending or approved status and must belong to the authenticated user. Edits to a pending submission update that submission directly. Edits to an approved library are staged for moderator review while the existing approved version remains publicly available. Submitting values identical to the live record or current proposal is an idempotent no-op and does not notify moderators.
Auth required: Yes (Bearer token)
Content type: multipart/form-data
Fields¶
All fields are optional. Omitted fields keep their current value. Provide at least one field.
The per-submission osm_submission_allowed choice is creation-only and cannot be added or changed through this endpoint. Sending it produces a validation error and preserves the stored choice.
| Field | Type | Description |
|---|---|---|
name |
string | Display name (max 255 chars) |
description |
string | Free-text description (max 2000 chars) |
address |
string | Street address (max 255 chars). May be empty when coordinates identify the location. |
city |
string | City name (max 100 chars) |
country |
string | ISO 3166-1 alpha-2 country code (2 chars) |
postal_code |
string | Postal or ZIP code (max 20 chars) |
wheelchair_accessible |
string | Wheelchair accessibility: yes, no, or limited |
capacity |
int | Approximate book capacity |
is_indoor |
bool | Whether the library is inside a building |
is_lit |
bool | Whether the library is illuminated at night |
website |
string | External website link (max 500 chars) |
contact |
string | Contact information - email, phone, etc. (max 255 chars) |
operator |
string | Organisation that maintains the library (max 255 chars) |
brand |
string | Network or brand name (max 255 chars) |
latitude |
float | Latitude (-90 to 90, WGS 84). Must be sent with longitude. |
longitude |
float | Longitude (-180 to 180, WGS 84). Must be sent with latitude. |
photo |
file | Optional replacement photo (JPEG/PNG/WEBP/HEIC/HEIF, max 10 MB). Accepted uploads are normalized to an optimized JPEG targeting about 500 KB. Omit to keep the current photo. |
Examples¶
Replace the photo¶
Response (200 OK)¶
The response uses the same library object shape as the detail endpoint.
{
"id": 42,
"slug": "berlin-friedrichstr-12-corner-books",
"name": "Corner Books",
"description": "Freshly repainted with more children's books.",
"photo_url": "/media/libraries/photos/2025/06/corner-books.jpg",
"thumbnail_url": "/media/libraries/thumbnails/2025/06/corner-books.jpg",
"lat": 52.52,
"lng": 13.405,
"address": "Friedrichstr. 12",
"city": "Berlin",
"country": "DE",
"postal_code": "10117",
"wheelchair_accessible": "",
"capacity": 60,
"is_indoor": null,
"is_lit": null,
"website": "",
"contact": "",
"source": "",
"operator": "",
"brand": "",
"created_at": "2025-06-15T14:30:00Z",
"is_favourited": false
}
Note
For an approved library, the response previews the proposed values, but public list, search, and detail endpoints continue returning the existing approved values until a moderator accepts the update. Its ID and slug do not change. Rejected proposed changes are discarded without rejecting or hiding the approved library.
Errors¶
| Status | Cause |
|---|---|
400 |
No fields were provided, coordinates were incomplete, the photo format is invalid, or a creation-only field such as osm_submission_allowed was sent |
401 |
Missing or invalid bearer token |
404 |
Library not found, not owned by the authenticated user, rejected, or otherwise not editable |
413 |
Photo exceeds 10 MB size limit |
422 |
Request validation error (field too long, invalid type, or out-of-range coordinate) |
429 |
Rate limit exceeded (see Rate Limiting) |