For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomepageProduct HelpLog inTry for Free
Developers HomeAPI ReferenceMCP
Developers HomeAPI ReferenceMCP
  • Getting Started
    • Introduction
    • Authentication with API Keys
    • Authentication with OAuth
    • API Clients
    • Pagination
    • Specifying Fields
    • Filter Parameters
    • HTTP Response Codes
    • Rate Limits
    • Timezone Offsets
    • Rich Text Fields
    • Changelog
  • CRM Core
    • Leads
    • Contacts
    • Opportunities
    • Tasks
    • Files
    • Custom Objects
    • Comments
  • Activities
    • Activities
    • Notes
    • Calls
    • Emails
    • Email Threads
      • GETList or filter all SMS activities
      • POSTCreate an SMS activity
      • GETGet a single SMS activity
      • PUTUpdate an SMS activity
      • DELDelete an SMS activity
    • WhatsApp Messages
    • Meetings
    • Custom Activities
    • Creations
    • Form Submissions
    • Lead Status Changes
    • Opportunity Status Changes
    • Lead Merges
    • Task Completions
  • Events & Webhooks
    • Webhooks
    • Events
  • Search & Reporting
    • Advanced Filtering
    • Smart Views
    • Reporting
  • Automation & Bulk Actions
    • Sequences (Workflows)
    • Bulk Actions
    • Exports
    • AI Field Enrichment
  • CRM Configuration
    • Custom Fields
    • Custom Activity Types
    • Custom Object Types
    • Pipelines
    • Opportunity Statuses
    • Lead Statuses
    • Integration Links
    • Forms
  • Communication Configuration
    • Email Templates
    • SMS Templates
    • Outcomes
    • Playbooks
    • Scheduling Links Guide
    • Scheduling Links
    • Connected Accounts
    • Send As
    • Unsubscribed Emails
    • Phone Numbers
    • Blocked Phone Numbers
    • Dialers
  • Users & Organizations
    • Users
    • Organizations
    • Memberships
    • Roles
    • Groups
Close

Product

OverviewCommunicationAutomationIntegrationsReportingSMSCallingSecurityForms

Pricing & Use Cases

PricingClose vs Other CRMsCustomer Stories

Resources

Sales BlogSales ResourcesSales GuidesWebinarsOn-Demand DemoSales Tools

Company

AboutCareersPartner with CloseBrand GuidelinesTermsPrivacyGDPRCCPA

Get Help

+1-833-GO-CLOSEHelp CenterDownload the Close AppProduct UpdatesSystem Status
LogoLogo
HomepageProduct HelpLog inTry for Free
ActivitiesSMS

Create an SMS activity

||View as Markdown|
POST
https://api.close.com/api/v1/activity/sms/
POST
/api/v1/activity/sms/
$curl -X POST https://api.close.com/api/v1/activity/sms/ \
> -H "Content-Type: application/json" \
> -u "<CLOSE_API_KEY>:" \
> -d '{
> "status": "inbox",
> "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk",
> "direction": "inbound",
> "lead_id": "lead_iuSXNk1x3446ggPVwQS7ynmp8pGRIDieRYiCnuo4yFb",
> "local_phone": "+14154445555",
> "remote_phone": "+18183334444",
> "source": "External",
> "text": "Hi! This is a reminder that we have a call scheduled for 12pm PT today."
>}'
1{
2 "_type": "SMS",
3 "activity_at": "2016-10-03T16:06:11.167000+00:00",
4 "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk",
5 "cost": "1",
6 "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
7 "date_created": "2016-10-03T16:06:11.167000+00:00",
8 "date_scheduled": null,
9 "date_sent": null,
10 "date_updated": "2016-10-03T16:06:11.167000+00:00",
11 "direction": "outbound",
12 "error_message": null,
13 "id": "acti_12358hIUhaklslYoYSbtozZuUTyB2zO2nhm7iVSpZpp",
14 "lead_id": "lead_iuSXNk1x3446ggPVwQS7ynmp8pGRIDieRYiCnuo4yFb",
15 "local_country_iso": "US",
16 "local_phone": "+14154445555",
17 "local_phone_formatted": "+1 415-444-5555",
18 "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
19 "remote_country_iso": "US",
20 "remote_phone": "+18183334444",
21 "remote_phone_formatted": "+1 818-333-4444",
22 "source": "Close.io",
23 "status": "outbox",
24 "template_id": null,
25 "text": "Hi! This is a reminder that we have a call scheduled for 12pm PT today.",
26 "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
27 "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
28 "users": [],
29 "created_by_name": "Tobias Fuenke",
30 "updated_by_name": "Tobias Fuenke",
31 "user_name": "Tobias Fuenke"
32}
*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](https://developer.close.com/api/resources/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.
Was this page helpful?
Previous

List or filter all SMS activities

Next

Get a single SMS activity

Built with

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
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
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 null
agent_config_idstring or null
created_by_namestring or null
sequence_idstring or null
sequence_namestring or null
sequence_subscription_idstring or null
updated_by_namestring or null
user_namestring or null

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error