Reject a draft
POST/v1/drafts/{draft_id}/reject
- Scope
messages:send
Discards a pending draft, with an optional reason the agent can read. A draft-only key may discard its own drafts.
Parameters
Path
draft_idstringrequiredThe draft (
drf_…).
Request body
reasonstringWhy, for the agent that wrote it.
Response
200 OKThe rejected draft.
idstringrequireddrf_…object"draft"requiredprofile_idstringrequiredprf_…chat_idstring or nullrequiredtostringrequiredtextstring or nullrequiredattachmentsarray of objectrequiredreply_tostring or nullrequiredservicestring or nullrequiredeffectstring or nullrequiredstatus"pending" | "approved" | "rejected"requiredreasonstring or nullrequiredWhy it was rejected, if the person said.
message_idstring or nullrequiredOnce approved: the message it became.
created_bystringrequiredapi_key:key_…(the draft-only key that wrote it).decided_bystring or nullrequireduser:usr_…orapi_key:key_….decided_attimestamp or nullrequiredcreated_attimestamprequired
Errors
| Status | Code | Means |
|---|---|---|
| 409 | draft_approved | The draft was already approved. |
| 400 | validation_failed | A field is missing or invalid. |
| 401 | unauthorized | The API key is missing, unknown or revoked. |
| 403 | insufficient_scope | The API key lacks the scope this needs. |
| 404 | not_found | No such object, or the key can't see it. |
Every error is { "error": { "code", "message" } }. All error codes.