Skip to main content

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

albums
array
Array of album objects

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
object

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

name
string
required
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:
album
object

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
object

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

id
string
required
The unique identifier of the album to delete

Request Example

{
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Response

success
boolean
Returns true when deletion is successful

Response Example

{
  "success": true
}

Behavior

When an album is deleted:
  1. All photos in the album have their album_id set to null
  2. The album record is removed from the database
  3. Photos remain in the user’s library and can be viewed in “All Photos”

Error Responses

error
object

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"

Build docs developers (and LLMs) love