Skip to main content
POST
/
api
/
saved-items
Save Item
curl --request POST \
  --url https://api.example.com/api/saved-items

Authentication

Requires authentication via session cookie.

Request Body

{
  "content_type": "recipe",
  "content_id": "uuid",
  "collection_id": "uuid"  // optional
}
FieldTypeRequiredDescription
content_typestringYespost, recipe, or collection
content_idstringYesUUID of the content to save
collection_idstringNoUUID of collection to add to

Behavior

  • If the item is already saved and collection_id is provided, it adds the existing saved item to the collection.
  • If the item is already saved without collection_id, returns 409 ALREADY_SAVED.
  • Cannot add a collection to itself (self-referential check).
  • Validates that the content exists and is not soft-deleted.

Response (201)

{
  "savedItem": {
    "id": "uuid",
    "content_type": "recipe",
    "content_id": "uuid",
    "user_id": "uuid",
    "created_at": "2025-01-15T10:30:00Z"
  },
  "addedToCollection": true
}

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid data or content not found
401UNAUTHORIZEDNot authenticated
409ALREADY_SAVEDItem already saved (no collection_id)