Errors and Idempotency
Phonefarm uses a mix of stable HTTP semantics and descriptive string-based validation messages.Idempotency Summary
| Endpoint family | Idempotency key |
|---|---|
| Process creation | (process_type, requested_by.system, request_id) |
| Legacy ingest | (account_id, content_id) |
Duplicate Handling
Process creation
Duplicate process creation returns the existing process payload with:duplicate: trueprocess_status
Legacy ingest
Duplicate ingest returns:status: "duplicate"- existing
queue_item_id - existing
queue_status
HTTP Status Guidance
| Status code | Typical meaning |
|---|---|
200 | Successful read, duplicate-compatible accept, or successful legacy cancel. |
202 | Accepted process creation. |
401 | Missing or invalid bearer token. |
404 | Missing process, account, or queue item. |
409 | State conflict such as non-cancellable item or race on update. |
422 | Validation error. |
500 | Unexpected runtime, database, or environment failure. |
Validation Error Strings
Many current validation failures are descriptive strings rather than versioned machine error codes. Examples:missing_fyp_judge_promptmissing_keyword_comment_plan_promptneeds_comment_plan:comment_plan_keys_must_match_keywordscapability_not_live_verified:fyp_warmup
Stability Guidance
Treat:- HTTP status code as stable integration behavior
- response shape as stable within the current documented surface
- human-readable validation strings as descriptive, not as a formal enum unless you intentionally depend on them
Retry Guidance
- Retry transport failures and
5xxresponses. - Do not blindly retry
422responses without fixing input data. - Be careful retrying
409responses because they are often state-dependent. - For callback uncertainty, poll
GET /processes/{process_id}rather than replaying create calls.