POST /drafts

Create one or more drafts on the server. These drafts will be automatically synchronized to other clients via drafts events.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

Request body fields

Name Type Required Description
drafts[] Array No

A JSON-encoded list of containing new draft objects.

drafts[].id Integer No

The unique ID of the draft.

drafts[].to[] Array Yes

An array of the tentative target audience IDs. For channel messages, this should contain exactly 1 ID, the ID of the target channel. For direct messages, this should be an array of target user IDs. For unaddressed drafts, this is ignored, and clients should send an empty array.

drafts[].topic String Yes

For channel message drafts, the tentative topic name. For direct or unaddressed messages, this will be ignored and should ideally be the empty string. Should not contain null bytes.

drafts[].timestamp Integer No

A Unix timestamp (seconds only) representing when the draft was last edited. When creating a draft, this key need not be present and it will be filled in automatically by the server.

drafts[].type String Yes

The type of the draft. Either unaddressed (empty string), "stream", or "private" (for one-on-one and group direct messages).

Valid values:

  • ""
  • "private"
  • "stream"
drafts[].content String Yes

The body of the draft. Should not contain null bytes.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.