Create Client Subscription

POST {{baseUrl}}/client/subscriptions/?company_id={{companyId}}

Creates a subscription and consent record for email and/or SMS channels based on the provided email and phone_number attributes, respectively. One of either email or phone_number must be provided.

This endpoint is specifically designed to be called from publicly-browseable, client-side environments only and requires a public API key (site ID). Never use a private API key with our client-side endpoints.

To subscribe profiles from server-side applications, please use POST /api/profile-subscription-bulk-create-jobs.

To create a subscription and consent record for only 1 channel but still include the other channel as a profile property, the consent channel can be provided as a top-level attribute and the other channel can be included in the properties object.

Rate limits:
Burst: 100/s
Steady: 700/m

Scopes: subscriptions:write

Request Params

KeyDatatypeRequiredDescription
company_idstring(Required) Your Public API Key / Site ID. See this article for more details.

Request Body

{"data"=>{"type"=>"subscription", "attributes"=>{"profile"=>{"data"=>{"type"=>"profile", "attributes"=>{"email"=>"<string>", "phone_number"=>"<string>", "external_id"=>"<string>", "anonymous_id"=>"<string>", "_kx"=>"<string>", "first_name"=>"<string>", "last_name"=>"<string>", "organization"=>"<string>", "title"=>"<string>", "image"=>"<string>", "location"=>{"address1"=>"<string>", "address2"=>"<string>", "city"=>"<string>", "country"=>"<string>", "latitude"=>"<string>", "longitude"=>"<string>", "region"=>"<string>", "zip"=>"<string>", "timezone"=>"<string>", "ip"=>"<string>"}}, "id"=>"<string>", "meta"=>{"patch_properties"=>{"unset"=>"<string>"}}}}, "custom_source"=>"<string>"}, "relationships"=>{"list"=>{"data"=>{"type"=>"list", "id"=>"<string>"}}}}}

HEADERS

KeyDatatypeRequiredDescription
revisionstring(Required) API endpoint revision (format: YYYY-MM-DD[.suffix])
Content-Typestring