List Albums
curl -X GET https://your-domain.com/api/albums \
-H "Cookie: your-session-cookies"
Retrieves all albums for the authenticated user, ordered by creation date (oldest first).
Response
Array of album objects
Unique identifier for the album
ID of the user who owns the album
ISO 8601 timestamp when the album was created
Response Example
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"user_id": "user-123",
"name": "Vacation 2026",
"created_at": "2026-03-01T08:00:00.000Z"
},
{
"id": "223e4567-e89b-12d3-a456-426614174001",
"user_id": "user-123",
"name": "Family Photos",
"created_at": "2026-03-02T14:30:00.000Z"
}
]
Error Responses
{
"error": "No autorizado"
}
User is not authenticated.Show 500 Internal Server Error
{
"error": "Error al obtener albums"
}
Server error occurred while fetching albums.
Create Album
curl -X POST https://your-domain.com/api/albums \
-H "Cookie: your-session-cookies" \
-H "Content-Type: application/json" \
-d '{"name": "Vacation 2026"}'
Creates a new album for the authenticated user.
Request Body
The name of the album. Must be a non-empty string. Leading and trailing whitespace will be trimmed.
Request Example
{
"name": "Vacation 2026"
}
Response
Returns the created album object:
Unique identifier for the created album
ID of the user who owns the album
Name of the album (trimmed)
ISO 8601 timestamp when the album was created
Response Example
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"user_id": "user-123",
"name": "Vacation 2026",
"created_at": "2026-03-04T10:30:00.000Z"
}
Error Responses
{
"error": "Nombre requerido"
}
Album name was not provided or is empty/whitespace only.
{
"error": "No autorizado"
}
User is not authenticated.Show 500 Internal Server Error
{
"error": "Error al crear album"
}
Server error occurred while creating the album.
Delete Album
curl -X DELETE https://your-domain.com/api/albums \
-H "Cookie: your-session-cookies" \
-H "Content-Type: application/json" \
-d '{"id": "123e4567-e89b-12d3-a456-426614174000"}'
Deletes an album. All photos in the album are moved to “no album” (album_id set to null) before the album is deleted.
Deleting an album does not delete the photos it contains. Photos are automatically moved out of the album and remain in the user’s photo library.
Request Body
The unique identifier of the album to delete
Request Example
{
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Response
Returns true when deletion is successful
Response Example
Behavior
When an album is deleted:
- All photos in the album have their
album_id set to null
- The album record is removed from the database
- Photos remain in the user’s library and can be viewed in “All Photos”
Error Responses
{
"error": "No se proporciono ID"
}
Album ID was not provided.
{
"error": "No autorizado"
}
User is not authenticated.Show 500 Internal Server Error
{
"error": "Error al eliminar album"
}
Server error occurred while deleting the album.
Album Management
Moving Photos to Albums
To add photos to an album, use the Move Photo endpoint:
curl -X PATCH https://your-domain.com/api/photos/move \
-H "Cookie: your-session-cookies" \
-H "Content-Type: application/json" \
-d '{"id": "photo-id", "album_id": "album-id"}'
Removing Photos from Albums
To remove photos from an album without deleting them:
curl -X PATCH https://your-domain.com/api/photos/move \
-H "Cookie: your-session-cookies" \
-H "Content-Type: application/json" \
-d '{"id": "photo-id", "album_id": null}'
Uploading Directly to an Album
When uploading a photo, you can specify the album:
curl -X POST https://your-domain.com/api/photos/upload \
-H "Cookie: your-session-cookies" \
-F "file=@photo.jpg" \
-F "album_id=album-id"