Create an SMS activity
Create an SMS activity, either to log an SMS that was sent or received outside Close, or to have Close send it.
status must be one of the following:
inboxto log an already received SMS.sentto log an already sent SMS.draftto create a draft SMS.scheduledto send an SMS at the date and time indate_scheduled. This requires a plan that includes scheduled SMS.outboxto send an SMS now. To delay sending by a few seconds (to allow undo), setsend_into a number of seconds, up to 60.
Only drafts can be modified, and their status can be changed to scheduled (to send later) or outbox (to send immediately). A scheduled SMS, or an SMS in the outbox that wasn’t sent yet, can be canceled by setting its status back to draft.
To send an SMS, provide remote_phone and the local_phone to send from. The number you choose has to be associated with a Phone Number of type internal. See the Phone Numbers paragraph for more details.
Instead of local_phone, you can set caller_id_mode to auto to let Close pick the number. auto requires a plan that includes Local Presence. On a plan without it, Close accepts auto only if the sender’s Membership has default_caller_id_mode set to auto. The sender is the user in user_id, or the authenticated user if user_id is absent. Close then sends the SMS from the default_caller_id of that Membership. If default_caller_id is unset or cannot send the SMS, Close uses the oldest number that the sender can send from.
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, it defaults to inbound if status is inbox, and to outbound otherwise. When source is not provided, it defaults to External if status is inbox or sent, and to Close.io otherwise.
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.
Returns 400 if the SMS is invalid, for example if text is empty for an SMS that isn’t a draft, if Close can’t send an SMS to remote_phone, or if your organization can’t pay for the SMS.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Query parameters
Set to true to also create an Inbox notification for the SMS. Only allowed when creating an SMS with status set to inbox. Defaults to false.
Comma-separated list of fields to include in the response.
Request
Status of the SMS. Use inbox or sent to log an SMS, draft to save a draft, outbox to send it now or scheduled to send it at date_scheduled. Close sets error when sending fails.
When the SMS happened. Defaults to date_created, and is set to the time the SMS is sent.
How to choose local_phone when sending. auto lets Close pick the number. A logged SMS can’t have a Caller ID mode. Can only be changed while the SMS is a draft.
ID of the user who created the SMS. Defaults to you. Setting another user requires the manage_organization permission, otherwise you are used instead.
When to send the message. Required when status is scheduled, and ignored otherwise.
Whether the SMS was received (inbound) or sent (outbound). Defaults to inbound when status is inbox, and to outbound otherwise. Can’t be changed later.
ID of the lead the SMS belongs to. For a logged SMS (source is External), it defaults to the lead of contact_id, or of the oldest contact with remote_phone. Once set, it can’t be removed.
Your Close phone number to send the SMS from, or that received it, in E.164 format. Required to send (outbox or scheduled) unless caller_id_mode is auto. Can only be changed while the SMS is a draft.
Phone number of the other party, in E.164 format. Required to send. A logged SMS needs remote_phone or contact_id. Can only be changed while the SMS is a draft.
Seconds to delay sending, to allow undo. Only used when status is outbox.
External to log an SMS that was sent or received outside Close, or Close.io for an SMS that Close sends. Defaults to External when status is inbox or sent, and to Close.io otherwise. Can’t be changed later.
ID of an SMS template. When you create an SMS with a template_id and no text, Close renders the template into text, which requires lead_id. Can only be changed while the SMS is a draft.
Text of the SMS. Required unless status is draft, or you send attachments or a template_id. An SMS to send can be at most 1,000 bytes of UTF-8 text. Can only be changed while the SMS is a draft.
ID of the user who sent or received the SMS. Defaults to you. Setting another user requires the manage_organization permission, otherwise you are used instead.
Response
Type of the activity, e.g. Call, Email or Note.
When the activity happened, e.g. when an Email or SMS was sent. Defaults to date_created.
How local_phone was chosen for an outgoing SMS. null for incoming, logged and older SMS.
Why Close chose local_phone when caller_id_mode is auto. null otherwise, and until Close sends the SMS.
ID of the Contact the activity is with, or null if it isn’t with a particular Contact.
What Close charges for the SMS, in cents, as a decimal string (e.g. "1.5"). null if there’s no charge, e.g. for a logged SMS.
ID of the user who created the activity, or null if it wasn’t created by a user.
When the SMS is scheduled to be sent, or null if it wasn’t scheduled.
When the SMS was sent. null until it’s sent.
Why the SMS failed to send, when status is error. Null otherwise.
ID of the activity, e.g. acti_abc123.
ID of the Lead the activity is on. Can be null for Calls and SMS with phone numbers that don’t match any Contact.
ISO 3166-1 alpha-2 code of the country of local_phone.
Your phone number that sent or received the SMS, in E.164 format. null for a logged SMS that doesn’t say which number was used.
local_phone formatted for display.
ISO 3166-1 alpha-2 code of the country of remote_phone.
Phone number of the other party, in E.164 format. null for a logged SMS that only names a contact.
remote_phone formatted for display.
Whether Close sent or received the SMS (Close.io), or it was logged from elsewhere (External).
Where the SMS is in its lifecycle, e.g. draft, outbox or sent.
ID of the SMS template the text was rendered from, or null if no template was used. The template may since have been deleted.
ID of the user who last updated the activity, or null if it wasn’t updated by a user.
ID of the user the activity belongs to, e.g. who made the Call or sent the Email. Can be null, e.g. for an incoming SMS to a group number.
Why an agent created the activity (send_scheduling_link, custom_agent_decision or voice_agent_callback), or null if no agent created it.
ID of the agent that created the activity, e.g. agentconfig_abc123, or null if no agent created it.
Name of the user in created_by.
ID of the Workflow that created the activity, e.g. seq_abc123, or null.
Name of the Workflow in sequence_id.
ID of the Workflow Run, i.e. the Contact’s enrollment in the Workflow, that created the activity, e.g. sub_abc123, or null.
Name of the user in updated_by.
Name of the user in user_id.
Deprecated. Use created_by_agent_id instead.