Errors
The error format, and every code the APIs answer with.
A request that fails answers with an HTTP status and a JSON body. Build on error.code, which stays the same. error.message is for people and logs and may change.
{
"success": false,
"error": {
"code": "video_too_long",
"message": "The video is 75 s long; the limit is 60 s",
"details": { "seconds": 75, "limit": 60 }
}
}details appears when there is more to say: the invalid fields for invalid_request, the missing file for upload_missing.
Meishi API
| Status | Code | What to do |
|---|---|---|
| 401 | api_key_required | Send your API key in the Authorization header. |
| 401 | api_key_invalid | The key is wrong, was replaced or was deleted. Use the current key. |
| 402 | plan_required | Your plan does not include the API. |
| 402 | no_experience_credits | Your organization has no experiences left. A draft stays a draft: submit it again once you have more. |
| 404 | experience_not_found | Your organization has no experience with this ID. |
| 409 | upload_missing | A file was not uploaded yet. details.file says which. |
| 422 | invalid_request | The request is not valid. details says what is wrong where. |
| 422 | image_required | No image was sent and the key has no label. |
| 422 | file_refused | A file has a type or size the API does not take. |
| 422 | video_too_long | The video is longer than 60 seconds. |
| 422 | image_too_small | The image is less than 480 px on its short side. |
| 422 | image_unreadable | The image could not be read. Send a valid jpeg, png or webp. |
| 429 | rate_limited | Too many requests. Wait for the Retry-After seconds. |
| 5xx | Something went wrong on our side. Retry with backoff. |
Website orders API
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_cursor | The cursor was changed, or did not come from this list. Start the list again. |
| 401 | server_key_required | Send your server key in the Authorization header. |
| 401 | server_key_invalid | The key is wrong, was replaced, or its website key was deleted. |
| 402 | no_experience_credits | No experiences left. It stays reserved: confirm it again once you have more. |
| 404 | experience_not_found | Your organization has no experience with this ID. |
| 409 | experience_cancelled | It was cancelled, so it can no longer be confirmed. |
Retrying
Submitting and confirming are safe to repeat: doing it again answers with where the experience stands and counts nothing twice. Cancelling or deleting a draft or a reserved experience removes it, so a second try answers 404 experience_not_found: treat that as done. So when a request times out or answers 5xx or 429, retry it with exponential backoff.