Sites are the main organizational units within Sent, akin to a project or application in other platforms. Each site represents an independent environment for handling messaging operations, including subscriber management, message sending, and analytics. Sites are isolated, ensuring that data and operations do not overlap across different sites. You can invite team members to collaborate within a site, where they can manage subscribers, create message templates, and track message performance.
When interacting with Sent’s API, you will need to specify the Site ID to perform any operation. You can find the site ID under the General settings page of your site.
id (string, required)
The unique identifier for the site, generated automatically by the system using a CUID algorithm.
name (string, optional)
The human-readable name of the site. This field is optional and can be used for display purposes.
description (string, optional)
A brief description of what the site or service offers or represents.
logo (string, optional)
A URL pointing to the logo image. By default, it points to a predefined location but can be overridden by the user.
Subscribers are individuals who have subscribed to receive messages from your site. Subscribers have unique identifiers and can subscribe to various communication channels like email or SMS. They can be managed via the Sent API or the Sent dashboard.
id (string, required)
The unique identifier for the subscriber, automatically generated and managed.
phoneNumber (string, required)
The phone number of the subscriber, which must be unique across all subscribers.
defaultChannel (string, required)
The default communication channel for the subscriber.
Values: ‘sms’, ‘whatsapp’, ‘telegram’, ‘imessage’
SubscriberChannels (array of objects, required)
The list of all subscribed channels by the subscriber, providing details on the status and specific configurations of each.
Structure Contains:
channel: The type of subscription channel (e.g., ‘sms’, ‘whatsapp’)
valid: Status of the channel (e.g., ‘pending’, ‘active’, ‘inactive’)
createdAt (DateTime, required)
The timestamp indicating when the subscriber was first created in the system. Formatted as a date-time string.
updatedAt (DateTime, required)
The timestamp indicating when the subscriber information was last updated. Formatted as a date-time string.
countryCode (string, optional)
The country code associated with the subscriber’s phone number.
countryIso (string, optional)
The ISO country code representing the subscriber’s country of residence.
verificationStatus (string, required)
The current verification status of the subscriber. This can be ‘pending’, ‘active’, or ‘inactive’.
Events (array of objects, optional)
A collection of events related to the subscriber, each detailing the nature and time of the event.
Each Event Contains:
id: Unique identifier for the event
name: Name or title of the event
timestamp: The date and time when the event occurred, formatted as a date-time string
channelType: Type of channel used during the event (e.g., ‘sms’, ‘telegram’)
properties: Additional properties and details about the event stored in a JSON format
messageActions (array of objects, optional)
The message actions sent to or from the subscriber through various channels.
Each message action contains:
id: The unique identifier of the message action, automatically generated and managed.
transactionId: Unique identifier for the transaction related to the message action.
to: The phone number of the recipient.
recipientId: The ID of the recipient’s subscription.
channel: The channel type for the message (e.g., ‘sms’, ‘telegram’).
status: The delivery status of the message action.
lastUpdatedAt: Timestamp indicating the last update to the message action, formatted as a date-time string.
The unique identifier for the message, automatically generated and managed.
title (string, required)
The title or subject of the message.
siteId (string, required)
The unique identifier of the site to which the message belongs.
content (string, required)
The content of the message.
createdAt (DateTime, required)
The timestamp indicating when the message was first created in the system, formatted as a date-time string.
updatedAt (DateTime, required)
The timestamp indicating when the message information was last updated, formatted as a date-time string.
templates (array of objects, optional)
A collection of templates used for the message.
Each template contains:
id: Unique identifier for the template
messageId: Unique identifier of the message
channelType: Type of channel for the template (e.g., ‘sms’, ‘whatsapp’)
content: The content of the template
status: The status of the template
createdAt: Timestamp when the template was first created, formatted as a date-time string
updatedAt: Timestamp when the template information was last updated, formatted as a date-time string
name: Name of the template
messageActions (array of objects, optional)
A collection of actions taken on the message.
Each message action contains:
id: The unique identifier of the message action, automatically generated and managed.
transactionId: The unique identifier for the message operation delivered to a specific recipient related to the action.
to: The phone number of the recipient.
recipientId: The ID of the recipient’s subscription.
channel: The channel type for the message (e.g., ‘sms’, ‘telegram’).
title: The title or subject of the message action.
content: The actual content of the message action.
timestamp: The date and time when the message action was sent or received, formatted as a date-time string.
status: The delivery status of the message action.
lastUpdatedAt: Timestamp indicating the last update to the message action, formatted as a date-time string.
Message Actions Overview
Message Actions represent the different operations or activities related to messages sent to subscribers. These actions detail the process of delivering messages to various recipients, including their status and contents.
Example of Message Actions:
[{"id":"cHJvZHVjdEBwcm94aW5jLmNvbS5hd","transactionId":"cHJvZHVjdEBwcm94aW5jLmNvbS5hd","to":"+19715555555","recipientId":"1","channel":"sms","title":"Important Update","content":"Your scheduled maintenance is due tomorrow.","timestamp":"2023-10-12T07:20:50.52Z","status":"sent","lastUpdatedAt":"2023-10-12T07:20:50.52Z"}]