Skip to main content
Create composition delivery

Authorizations

Authorization
string
header
required

A Tightknit admin API key, sent as Authorization: Bearer <key>.

Body

application/json
composition_id
string
required

The unique id of the composition to set the destination on, starting with cmps_. Returned as id by GET /v1/compositions.

Example:

"cmps_7h2k9m4n1p6q"

destination
enum<string>
required

Where it goes. One of:

  • slack_channel: a post in each of channel_ids.
  • slack_dm: a direct message to each member named by member_ids, group_ids, feed_ids or event_ids, once each.
Available options:
slack_channel,
slack_dm
identity
enum<string>
default:bot

Who it sends as. One of:

  • bot: the Tightknit app, the default.
  • community: the app under the community name and logo, for slack_channel only.
Available options:
bot,
community

Whether Slack previews the message’s links. Left to Slack when omitted.

channel_ids
string[]

Slack’s ids for the channels to post in, such as C0123456789, required for slack_channel. The Tightknit app must be able to post in each.

Required array length: 1 - 50 elements
Pattern: ^[CG][A-Z0-9]{8,20}$
publish_to_site
boolean

For slack_channel: also publish each post to its channel's feed on the community site.

thread_ts
string

For slack_channel with one channel: reply in this message's thread.

Pattern: ^\d{10}\.\d{6}$
member_ids
string[]

For slack_dm: the unique ids of the members to message, starting with prof_. Returned as id by GET /v1/profiles; to look one up, filter that list by email or slack_profile_id.

Maximum array length: 1000
Pattern: ^prof_[a-zA-Z0-9]{12}$
group_ids
string[]

For slack_dm: the unique ids of the groups whose members to message, starting with grup_. Returned as id by GET /v1/groups.

Maximum array length: 50
Pattern: ^grup_[a-zA-Z0-9]{12}$
feed_ids
string[]

For slack_dm: the unique ids of the feeds whose members to message, starting with feed_. Returned as id by GET /v1/feeds.

Maximum array length: 50
Pattern: ^feed_[a-zA-Z0-9]{12}$
event_ids
string[]

For slack_dm: the unique ids of the events whose registrants to message, starting with cevt_. Returned as id by GET /v1/events.

Maximum array length: 50
Pattern: ^cevt_[a-zA-Z0-9]{12}$
expected_revision
integer

The revision you last read. A composition changed since is refused with a 409 rather than overwritten. Omit to change whatever is stored.

Required range: x >= 0

Response

Success

object
enum<string>
required

Always composition_delivery.

Available options:
composition_delivery
id
string
required

Unique identifier for the object.

Example:

"cpdl_4k8m2n6p9q3r"

created_at
string<date-time>
required

When the object was created.

updated_at
string<date-time>
required

When the object was last changed.

composition_id
string
required

The id of the composition this delivery sends.

Example:

"cmps_7h2k9m4n1p6q"

composition_version_id
string | null
required

The id of the composition version this delivery sent. Null until the composition is sent, while it is only where the composition is set to go.

destination
enum<string>
required

Where it goes. One of:

  • slack_channel: a post in each of slack_channel.channel_ids.
  • slack_dm: a direct message to each member slack_dm names, directly or through a group, feed or event.
  • email: an email to each member email names who has an email address. Created in Studio; the API reads it but cannot create one.
Available options:
slack_channel,
slack_dm,
email
status
enum<string>
required

How the delivery stands. One of:

  • pending: set up, and not sent yet; or sent and waiting to start.
  • scheduled: set to go out at the composition’s scheduled_at.
  • delivering: sending now.
  • delivered: reached every recipient it could.
  • partially_delivered: reached some recipients, and some failed.
  • failed: no recipient was confirmed reached; every recipient failed or the delivery could not start.
  • canceled: called off before it was sent.
Available options:
pending,
scheduled,
delivering,
delivered,
partially_delivered,
failed,
canceled
identity
enum<string> | null
required

Who it sends as. One of:

  • bot: the Tightknit app. Slack only.
  • community: for a channel post, the app under the community name and logo; for an email, from the community. Not used for DMs.
  • user: the Studio user who sent it. In Slack, from their own Slack account; for an email, from their name beside the community, with replies going to their email address. An API key cannot send as one.

Null when its settings cannot be read.

Available options:
user,
bot,
community

Whether Slack previews the message’s links. Null when left to Slack.

slack_channel
object | null
required

Where it posts. Null unless destination is slack_channel.

slack_dm
object | null
required

Who it messages. Null unless destination is slack_dm.

email
object | null
required

What it emails and to whom. Null unless destination is email.

counts
object
required

Its recipients by how their send stands, as last rolled up. Empty until the delivery starts; a status with none is absent.

error_code
string | null
required

Why it failed as a whole, or the reason every recipient that failed shares, such as outcome_unknown when Slack could not say whether a message landed. Null otherwise.

delivered_at
string<date-time> | null
required

When it finished sending. Null until then.

created_by_id
string | null
required

The id of the profile that set it up or sent it. Null when an API key did, or once that profile is deleted.

updated_by_id
string | null
required

The id of the profile that last changed it. Null when an API key or the send itself did, or once that profile is deleted.

created_by
object | null

The profile that set it up or sent it. Present only when created_by is expanded.

updated_by
object | null

The profile that last changed it. Present only when updated_by is expanded.