Media
Upload media for messages and automations.
Upload media
POST
content:writeIdempotency-Key required/v1/media/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 |
|---|---|---|
filerequired | string (binary) | — |
Response fields (201)
| Field | Type | Notes |
|---|---|---|
created_at | string (date-time) | read-only |
file_type | string | read-only |
id | string | read-only |
original_file_name | 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/media/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"file":"string"}'