Skip to navigation
ActivitiesSMS

Create an SMS activity

View as Markdown

status must be one of the following:

  • inbox to log an already received SMS.
  • draft to create a draft SMS.
  • scheduled to send an SMS at a scheduled date and time, which must be specified in the date_scheduled field.
  • outbox to actually send an SMS. To delay SMS sending by a few seconds (to allow undo), specify send_in in seconds (must be less than 60).
  • sent to log an already sent SMS.

Only drafts can be modified, and their status can be changed to scheduled (to send later) or outbox (to send immediately). Scheduled SMS, or SMS in outbox that weren’t sent yet can be canceled by setting the status back to draft.

You have to provide a local_phone that will be used to send the SMS. The number you choose has to be associated with a Phone Number of type internal. See the Phone Numbers paragraph for more details.

A template_id referencing an SMS Template may be provided instead of text to automatically render that template and use the content as text.

When direction is not provided, but status="inbox", direction will default to “inbound”. Otherwise, direction defaults to “outbound”.

When creating a new SMS with the status set to inbox, you can pass the query parameter send_to_inbox with the value of true to create a corresponding Inbox Notification for the SMS.

Authentication

AuthorizationBasic
Use your API key as the username and leave the password empty.
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Query parameters

send_to_inboxbooleanOptional

Request

This endpoint expects an object.
statusenumRequired
activity_atdatetime or nullOptional
attachmentslist of objects or nullOptional
caller_id_modeenumOptional
Allowed values:
contact_idstring or nullOptional
created_bystring or nullOptional
date_createddatetime or nullOptional
directionenumOptional
Allowed values:
lead_idstring or nullOptional
local_phonestring or nullOptional
Phone number in E.164 format
organization_idstring or nullOptional
remote_phonestring or nullOptional
Phone number in E.164 format
sourceenumOptional
Allowed values:
template_idstring or nullOptional
textstring or nullOptional
user_idstring or nullOptional

Response

Successful response
_typestring
activity_atdatetime or null
caller_id_modeenum or null

How a caller’s outbound number is chosen. Fixed uses a single configured number; Auto lets Close select the best number per call/SMS (Managed by Close Caller ID).

Allowed values:
caller_id_reasonenum or null

Why a number was chosen in Auto mode: reused from a prior communication (context), picked for geographic proximity (local_presence), or the default/oldest fallback.

Allowed values:
contact_idstring or null
coststring or null
created_bystring or null
date_createddatetime
date_scheduleddatetime or null
date_sentdatetime or null
date_updateddatetime
directionenum
Direction of a phone activity, such as a call or an SMS message.
Allowed values:
error_messagestring or null
idstring
lead_idstring or null
local_country_isostring or null
local_phonestring or null
local_phone_formattedstring or null
organization_idstring
remote_country_isostring or null
remote_phonestring or null
remote_phone_formattedstring or null
sourceenum

Source of a phone activity. Describes whether the phone activity (such as a call or an SMS) was handled by Close’s telephony provider or handled externally by a 3rd party and is merely logged in Close.

Allowed values:
statusenum
Status of a message, such as Email or SMS.
template_idstring or null
textstring or null
updated_bystring or null
user_idstring or null
userslist of strings
agent_action_reasonstring or nullOptional
agent_config_idstring or nullOptional
created_by_namestring or nullOptional
sequence_idstring or nullOptional
sequence_namestring or nullOptional
sequence_subscription_idstring or nullOptional
updated_by_namestring or nullOptional
user_namestring or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error