Docs menu

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_idstringrequired

    The draft (drf_…).

Request body

  • reasonstring

    Why, for the agent that wrote it.

Response

200 OKThe rejected draft.

  • idstringrequired

    drf_…

  • object"draft"required

  • profile_idstringrequired

    prf_…

  • chat_idstring or nullrequired

  • tostringrequired

  • textstring or nullrequired

  • attachmentsarray of objectrequired

  • reply_tostring or nullrequired

  • servicestring or nullrequired

  • effectstring or nullrequired

  • status"pending" | "approved" | "rejected"required

  • reasonstring or nullrequired

    Why it was rejected, if the person said.

  • message_idstring or nullrequired

    Once approved: the message it became.

  • created_bystringrequired

    api_key:key_… (the draft-only key that wrote it).

  • decided_bystring or nullrequired

    user:usr_… or api_key:key_….

  • decided_attimestamp or nullrequired

  • created_attimestamprequired

Errors

StatusCodeMeans
409draft_approvedThe draft was already approved.
400validation_failedA field is missing or invalid.
401unauthorizedThe API key is missing, unknown or revoked.
403insufficient_scopeThe API key lacks the scope this needs.
404not_foundNo such object, or the key can't see it.

Every error is { "error": { "code", "message" } }. All error codes.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite