Drafts

View as Markdown

Get Draft

GET
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

Header Parameters

Authorization*string

Bearer authentication

Response Body

application/json

curl -X GET "https://api.agentry.to/human/v0/inboxes/string/drafts/string" \  -H "Authorization: string"
{
  "inbox_id": "string",
  "draft_id": "string",
  "client_id": "string",
  "labels": [
    "string"
  ],
  "reply_to": [
    "string"
  ],
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "subject": "string",
  "preview": "string",
  "text": "string",
  "html": "string",
  "attachments": [
    {
      "attachment_id": "string",
      "filename": "string",
      "size": 0,
      "content_type": "string",
      "content_disposition": "inline",
      "content_id": "string"
    }
  ],
  "in_reply_to": "string",
  "references": [
    "string"
  ],
  "send_status": "scheduled",
  "send_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z"
}

Update Draft

PATCH
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

Header Parameters

Authorization*string

Bearer authentication

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://api.agentry.to/human/v0/inboxes/string/drafts/string" \  -H "Authorization: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "inbox_id": "string",
  "draft_id": "string",
  "client_id": "string",
  "labels": [
    "string"
  ],
  "reply_to": [
    "string"
  ],
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "subject": "string",
  "preview": "string",
  "text": "string",
  "html": "string",
  "attachments": [
    {
      "attachment_id": "string",
      "filename": "string",
      "size": 0,
      "content_type": "string",
      "content_disposition": "inline",
      "content_id": "string"
    }
  ],
  "in_reply_to": "string",
  "references": [
    "string"
  ],
  "send_status": "scheduled",
  "send_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z"
}

Delete Draft

DELETE
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

Header Parameters

Authorization*string

Bearer authentication

Response Body

curl -X DELETE "https://api.agentry.to/human/v0/inboxes/string/drafts/string" \  -H "Authorization: string"
Empty

Get Draft Attachment

GET
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

attachment_id*string

ID of attachment.

Header Parameters

Authorization*string

Bearer authentication

Response Body

application/json

curl -X GET "https://api.agentry.to/human/v0/inboxes/string/drafts/string/attachments/string" \  -H "Authorization: string"
{
  "attachment_id": "string",
  "filename": "string",
  "size": 0,
  "content_type": "string",
  "content_disposition": "inline",
  "content_id": "string",
  "download_url": "string",
  "expires_at": "2019-08-24T14:15:22Z"
}

Delete Draft Attachment

DELETE
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

attachment_id*string

ID of attachment.

Header Parameters

Authorization*string

Bearer authentication

Response Body

curl -X DELETE "https://api.agentry.to/human/v0/inboxes/string/drafts/string/attachments/string" \  -H "Authorization: string"
Empty

List Drafts

GET
/human/v0/inboxes/{inbox_id}/drafts

Path Parameters

inbox_id*string

Query Parameters

limit?integer
page_token?string

Header Parameters

Authorization*string

Bearer authentication

Response Body

application/json

curl -X GET "https://api.agentry.to/human/v0/inboxes/string/drafts" \  -H "Authorization: string"
{
  "count": 0,
  "limit": 0,
  "next_page_token": "string",
  "drafts": [
    {
      "inbox_id": "string",
      "draft_id": "string",
      "labels": [
        "string"
      ],
      "to": [
        "string"
      ],
      "cc": [
        "string"
      ],
      "bcc": [
        "string"
      ],
      "subject": "string",
      "preview": "string",
      "attachments": [
        {
          "attachment_id": "string",
          "filename": "string",
          "size": 0,
          "content_type": "string",
          "content_disposition": "inline",
          "content_id": "string"
        }
      ],
      "in_reply_to": "string",
      "send_status": "scheduled",
      "send_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Create Draft

POST
/human/v0/inboxes/{inbox_id}/drafts

Path Parameters

inbox_id*string

Header Parameters

Authorization*string

Bearer authentication

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.agentry.to/human/v0/inboxes/string/drafts" \  -H "Authorization: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "inbox_id": "string",
  "draft_id": "string",
  "client_id": "string",
  "labels": [
    "string"
  ],
  "reply_to": [
    "string"
  ],
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "subject": "string",
  "preview": "string",
  "text": "string",
  "html": "string",
  "attachments": [
    {
      "attachment_id": "string",
      "filename": "string",
      "size": 0,
      "content_type": "string",
      "content_disposition": "inline",
      "content_id": "string"
    }
  ],
  "in_reply_to": "string",
  "references": [
    "string"
  ],
  "send_status": "scheduled",
  "send_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z"
}

Add Draft Attachment

POST
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

Header Parameters

Authorization*string

Bearer authentication

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.agentry.to/human/v0/inboxes/string/drafts/string/attachments" \  -H "Authorization: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "attachment_id": "string",
  "filename": "string",
  "size": 0,
  "content_type": "string",
  "content_disposition": "inline",
  "content_id": "string"
}

Send Draft

POST
/human/v0/inboxes/{inbox_id}/drafts/{draft_id}/send

Path Parameters

inbox_id*string
draft_id*string

ID of draft.

Header Parameters

Authorization*string

Bearer authentication

Response Body

application/json

curl -X POST "https://api.agentry.to/human/v0/inboxes/string/drafts/string/send" \  -H "Authorization: string"
{
  "inbox_id": "string",
  "draft_only": true,
  "status": "draft_created"
}