Content
Create, update and delete content items.
POST
/v1/content/Create contentDELETE/v1/content/{content_item_id}/Delete contentPATCH/v1/content/{content_item_id}/Update contentCreate content
POST
content:writeIdempotency-Key required/v1/content/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
file_id | string (uuid) | null | — |
item_typerequired | string | one of TEMPLATE, MEDIA, LINK, PROMPT |
prompt_body | string | max length 4000 |
steps | object[] | max 50 items |
steps[].file_id | string (uuid) | null | — |
steps[].referenced_content_item_id | string (uuid) | null | — |
steps[].step_typerequired | string | one of TEXT, IMAGE, VIDEO, VOICE, FILE |
steps[].text | string | max length 50000 |
steps[].text_variants | string[] | — |
titlerequired | string | max length 255 |
url | string (uri) | null | max length 2048 |
Response fields (201)
| Field | Type | Notes |
|---|---|---|
created_at | string (date-time) | read-only |
file_id | string | read-only |
id | string | read-only |
item_type | string | read-only |
prompt_body | string | read-only |
sort_order | integer | read-only |
title | string | read-only |
updated_at | string (date-time) | read-only |
url | string | read-only |
Responses
201Success400The 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
content:writeIdempotency-Key required/v1/content/{content_item_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
content_item_idrequired | path | string (uuid) | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Responses
204Success400The 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
content:writeIdempotency-Key required/v1/content/{content_item_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
content_item_idrequired | path | string (uuid) | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
prompt_body | string | max length 4000 |
sort_order | integer | — |
steps | object[] | max 50 items |
steps[].file_id | string (uuid) | null | — |
steps[].referenced_content_item_id | string (uuid) | null | — |
steps[].step_typerequired | string | one of TEXT, IMAGE, VIDEO, VOICE, FILE |
steps[].text | string | max length 50000 |
steps[].text_variants | string[] | — |
title | string | max length 255 |
url | string (uri) | null | max length 2048 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
created_at | string (date-time) | read-only |
file_id | string | read-only |
id | string | read-only |
item_type | string | read-only |
prompt_body | string | read-only |
sort_order | integer | read-only |
title | string | read-only |
updated_at | string (date-time) | read-only |
url | string | read-only |
Responses
200Success400The 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"}'