Docs menu

List drafts

GET/v1/drafts

  • Scope messages:read
  • Pages with before

Drafts written by draft-only keys, newest first.

Parameters

Query

  • limitinteger

    Items per page, 1–200 (default 50).

  • beforestring

    The next_before of the previous page.

  • profile_idstring

    Only this line's drafts.

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

    pending, approved or rejected.

Response

200 OKA page of drafts.

  • dataarray of Draftrequired

    Fields of data
    • 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

  • has_morebooleanrequired

    More items exist after this page.

  • next_beforestring or nullrequired

    Pass as before for the next page; null on the last one.

Errors

StatusCodeMeans
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