Skip to content

Memories, Albums & Images

Get Album Memories

Endpoint: GET /memories/albums/{album_id}/memories

Description: Get all memories for a specific album.

Response: 200 OK

{
    "id": "album_uuid",
    "name": "My Album",
    "memories": [
        {
            "id": "memory_uuid",
            "photo": "photo_uuid",
            "note": "This is a great memory!",
            "saved_on": "2025-11-27T10:00:00Z"
        }
    ]
}

Create Memory

Endpoint: POST /memories/

Description: Create a new memory for a user.

Request Body:

{
    "album_id": "album_uuid",
    "photo": "photo_uuid",
    "note": "This is a great memory!",
    "saved_on": "2025-11-27T10:00:00Z"
}

Response: 201 Created

{
    "id": "memory_uuid",
    "photo": "photo_uuid",
    "note": "This is a great memory!",
    "saved_on": "2025-11-27T10:00:00Z"
}

Delete Memory

Endpoint: DELETE /memories/{memory_id}

Description: Delete one of a user's memories by ID.

Response: 200 OK

{
    "memory_id": "memory_uuid"
}

Update Memory

Endpoint: PATCH /memories/{memory_id}

Description: Update one of a user's memories by ID.

Request Body:

{
    "note": "This is an updated memory."
}

Response: 200 OK

{
    "id": "memory_uuid",
    "photo": "photo_uuid",
    "note": "This is an updated memory.",
    "saved_on": "2025-11-27T10:00:00Z"
}

Get Album with Memories

Endpoint: GET /album/{album_id}

Description: Get an album with all its memories and photos by album ID for a user.

Response: 200 OK

{
    "id": "album_uuid",
    "name": "My Album",
    "user_id": "user_uuid",
    "created_at": "2025-11-27T10:00:00Z",
    "updated_at": "2025-11-27T10:00:00Z",
    "memories": [
        {
            "id": "memory_uuid",
            "photo": "photo_uuid",
            "note": "This is a great memory!",
            "saved_on": "2025-11-27T10:00:00Z",
            "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid.jpg"
        }
    ]
}

List Albums

Endpoint: GET /album/

Description: List albums for a user, including a thumbnail image (first or last uploaded).

Response: 200 OK

[
    {
        "id": "album_uuid",
        "name": "My Album",
        "user_id": "user_uuid",
        "created_at": "2025-11-27T10:00:00Z",
        "updated_at": "2025-11-27T10:00:00Z",
        "last_image": "https://nora.s3.amazonaws.com/memories/album_uuid/photo.jpg"
    }
]

Delete Album

Endpoint: DELETE /album/{album_id}

Description: Deletes an album for a user.

Response: 200 OK

Create Album

Endpoint: POST /album/

Description: Creates a new album for a user.

Request Body:

{
    "name": "My New Album"
}

Response: 201 Created

{
    "album_id": "album_uuid",
    "name": "My New Album"
}

Rename Album

Endpoint: PATCH /album/{album_id}

Description: Renames an album for a user.

Request Body:

{
    "name": "My Renamed Album"
}

Response: 200 OK

{
    "album_id": "album_uuid",
    "name": "My Renamed Album"
}

Upload Photo

Endpoint: POST /images/upload

Description: Upload a photo, compress if needed, store in uploads folder and url in database, and return the saved photo info.

Request Body: multipart/form-data with a file field.

Response: 201 Created

{
    "id": "photo_uuid",
    "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid.jpg"
}

Upload Multiple Photos

Endpoint: POST /images/upload-multiple

Description: Upload multiple photos, compress if needed, store in uploads folder and urls in database, and return the saved photo info.

Request Body: multipart/form-data with a files field.

Response: 201 Created

[
    {
        "id": "photo_uuid_1",
        "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid_1.jpg"
    },
    {
        "id": "photo_uuid_2",
        "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid_2.jpg"
    }
]

Endpoint: POST /images/{photo_id}/link-to-album

Description: Link an uploaded image to an album by creating a memory.

Request Body:

{
    "album_id": "album_uuid",
    "note": "This is a great memory!"
}

Response: 201 Created

{
    "memory_id": "memory_uuid",
    "album_id": "album_uuid",
    "photo_id": "photo_uuid",
    "note": "This is a great memory!"
}

Delete Photo

Endpoint: DELETE /images/delete/{photo_id}

Description: Delete a photo by ID, remove it from storage and database.

Response: 204 No Content

Get Photo

Endpoint: GET /images/{photo_id}

Description: Retrieve a photo metadata by ID.

Response: 200 OK

{
    "id": "photo_uuid",
    "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid.jpg"
}

Delete All Photos

Endpoint: DELETE /images/delete-all

Description: Delete all photos from the database and storage. (Admin only)

Response: 204 No Content

Get All Photos

Endpoint: GET /images/

Description: Get all photos metadata.

Response: 200 OK

[
    {
        "id": "photo_uuid_1",
        "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid_1.jpg"
    },
    {
        "id": "photo_uuid_2",
        "image_url": "https://nora.s3.amazonaws.com/memories/photo_uuid_2.jpg"
    }
]

Update Photo Memory

Endpoint: PATCH /images/{photo_id}/update-memory

Description: Update the note and/or date for a photo's memory.

Request Body:

{
    "note": "This is an updated memory.",
    "saved_on": "2025-11-28T10:00:00Z"
}

Response: 200 OK

{
    "id": "memory_uuid",
    "photo": "photo_uuid",
    "note": "This is an updated memory.",
    "saved_on": "2025-11-28T10:00:00Z"
}