POST
/
v1
/
object
/
{object_type}
/
{id}
/
subscription
curl --request POST \
  --url https://hub.suprsend.com/v1/object/{object_type}/{id}/subscription/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "recipients": [
    {
      "distinct_id": "id1",
      "$email": [
        "<string>"
      ],
      "$preferred_language": "<string>",
      "$timezone": "<string>"
    }
  ],
  "properties": {
    "role": "developer"
  }
}'
{
  "results": [
    {
      "properties": {
        "department": "frontend"
      },
      "user": {
        "distinct_id": "_distinct_id_",
        "updated_at": "2025-04-05T10:33:33.629736+00:00"
      },
      "object": {
        "id": "_object_id_",
        "object_type": "_object_type_",
        "subscriptions_count": 10,
        "updated_at": "2025-04-06T11:00:24.257046+00:00"
      },
      "created_at": "2025-04-06T10:59:07.726336+00:00",
      "updated_at": "2025-04-06T10:59:07.726336+00:00"
    }
  ]
}

Authorizations

Authorization
string
header
required

Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.

Path Parameters

id
string
required

Unique identifier of the object in your system

object_type
string
required

Used to group similar objects together. Give plural namespace like teams, organizations, and roles.

Body

application/json
recipients
object[]

List of recipients to be notified. You can either add recipient as array of distinct_ids or array of recipient objects. You can add upto 100 recipients in a single API.

Add user subscription by passing user json. You can pass user distinct_ids in array as ["id1","id2"] or as user object to identify recipient inline.

properties
object

properties defining the relation between object and its subscribers. Can be referenced as recipient.subscription.<key> in workflow and template.

Example:
{ "role": "developer" }

Response

200
application/json
200
user
object
object
object
properties
object

object subscription properties, referred as $recipient.subscription.<key> in template or workflow.

created_at
string
Example:

"2025-04-04T09:55:12.397Z"

updated_at
string
Example:

"2025-04-04T09:55:12.422Z"