Inbox

/api/v1 operations for inbox. See HTTP API for authentication, the error envelope, and rate limits.

Operations

GET /api/v1/inbox

Get the workspace inbox

Returns the address and sender name of the workspace's email inbox on agents.khotan.com, creating the inbox if the workspace has none yet.

Auth: API key required.

Operation ID: getWorkspaceInbox

Responses:

GET /api/v1/inbox/threads

List email threads

Lists the workspace inbox's email threads, newest first. Filter by text in a sender or the subject. Set excludeInternal=true to leave out email that staff sent from the internal channel.

Auth: API key required.

Operation ID: listInboxThreads

Query parameters:

Responses:

GET /api/v1/inbox/threads/{threadId}

Read an email thread

Returns every message in one email thread of the workspace inbox, with each message's sender, recipients, body text, and attachments.

Auth: API key required.

Operation ID: getInboxThread

Path parameters:

Query parameters:

Responses:

GET /api/v1/inbox/messages/{messageId}/attachments/{attachmentId}

Get an email attachment

Returns an attachment's name, type, and size, with short-lived links to its bytes and, when available, its extracted text.

Auth: API key required.

Operation ID: getInboxAttachment

Path parameters:

Query parameters:

Responses:

POST /api/v1/inbox/drafts

Create an email draft

Creates an unsent draft in the workspace inbox: a new email with recipients and a subject, or a reply to a message in the inbox. Nothing is sent until the draft is sent.

Auth: API key required.

Operation ID: createInboxDraft

Request body (application/json, required):

Responses:

DELETE /api/v1/inbox/drafts/{draftId}

Discard an email draft

Deletes an unsent draft from the workspace inbox, so it can never be sent.

Auth: API key required.

Operation ID: discardInboxDraft

Path parameters:

Responses:

POST /api/v1/inbox/drafts/{draftId}/send

Send an email draft

Sends a draft from the workspace inbox. A draft sends once; after it sends, it no longer exists.

Auth: API key required.

Operation ID: sendInboxDraft

Path parameters:

Responses: