Skip to content

Content

Create, update and delete content items.

Create content

POST/v1/content/
content:writeIdempotency-Key required

Parameters

NameInTypeNotes
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
file_idstring (uuid) | null—
item_typerequiredstringone of TEMPLATE, MEDIA, LINK, PROMPT
prompt_bodystringmax length 4000
stepsobject[]max 50 items
steps[].file_idstring (uuid) | null—
steps[].referenced_content_item_idstring (uuid) | null—
steps[].step_typerequiredstringone of TEXT, IMAGE, VIDEO, VOICE, FILE
steps[].textstringmax length 50000
steps[].text_variantsstring[]—
titlerequiredstringmax length 255
urlstring (uri) | nullmax length 2048
Response fields (201)
FieldTypeNotes
created_atstring (date-time)read-only
file_idstringread-only
idstringread-only
item_typestringread-only
prompt_bodystringread-only
sort_orderintegerread-only
titlestringread-only
updated_atstring (date-time)read-only
urlstringread-only

Responses

  • 201Success
  • 400The request is invalid.
  • 401Authentication is missing, invalid, or revoked.
  • 403The authenticated identity lacks the required scope or capability.
  • 404The resource is unavailable or not visible to this organization.
  • 409The write conflicts with current state or an identical request is still running.
  • 422The write contains fields outside its closed input schema.
  • 429The request-rate budget is exhausted.

Example request

curl
curl -X POST "https://api.themochi.app/v1/content/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
  -H "Content-Type: application/json" \
  -d '{"item_type":"TEMPLATE","title":"string"}'

Delete content

DELETE/v1/content/{content_item_id}/
content:writeIdempotency-Key required

Parameters

NameInTypeNotes
content_item_idrequiredpathstring (uuid)—
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Responses

  • 204Success
  • 400The request is invalid.
  • 401Authentication is missing, invalid, or revoked.
  • 403The authenticated identity lacks the required scope or capability.
  • 404The resource is unavailable or not visible to this organization.
  • 409The write conflicts with current state or an identical request is still running.
  • 422The write contains fields outside its closed input schema.
  • 429The request-rate budget is exhausted.

Example request

curl
curl -X DELETE "https://api.themochi.app/v1/content/<content_item_id>/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)"

Update content

PATCH/v1/content/{content_item_id}/
content:writeIdempotency-Key required

Parameters

NameInTypeNotes
content_item_idrequiredpathstring (uuid)—
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
prompt_bodystringmax length 4000
sort_orderinteger—
stepsobject[]max 50 items
steps[].file_idstring (uuid) | null—
steps[].referenced_content_item_idstring (uuid) | null—
steps[].step_typerequiredstringone of TEXT, IMAGE, VIDEO, VOICE, FILE
steps[].textstringmax length 50000
steps[].text_variantsstring[]—
titlestringmax length 255
urlstring (uri) | nullmax length 2048
Response fields (200)
FieldTypeNotes
created_atstring (date-time)read-only
file_idstringread-only
idstringread-only
item_typestringread-only
prompt_bodystringread-only
sort_orderintegerread-only
titlestringread-only
updated_atstring (date-time)read-only
urlstringread-only

Responses

  • 200Success
  • 400The request is invalid.
  • 401Authentication is missing, invalid, or revoked.
  • 403The authenticated identity lacks the required scope or capability.
  • 404The resource is unavailable or not visible to this organization.
  • 409The write conflicts with current state or an identical request is still running.
  • 422The write contains fields outside its closed input schema.
  • 429The request-rate budget is exhausted.

Example request

curl
curl -X PATCH "https://api.themochi.app/v1/content/<content_item_id>/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
  -H "Content-Type: application/json" \
  -d '{"prompt_body":"string","sort_order":1,"steps":[{"step_type":"TEXT"}],"title":"string","url":"string"}'