StreetText API v1
API Documentation
Connect your own tools to StreetText. Read and update your leads, tags, custom fields, text conversations, domains and webhooks.
https://api.streettext.com
Getting started
- Create an API key.In StreetText, open Settings → API keys, accept the API Access Terms, choose what the key may do, and copy it. You only see the key once. Keys expire after 60 days, and you can have up to 10 at a time.
- Send it as a bearer token.Add
Authorization: Bearer YOUR_API_KEYto every request. - Make your first call.List your leads. A
200with your leads means the key works.
Building an app that other StreetText customers will connect? Use OAuth instead of a personal key. Prefer to just ask questions? Connect ChatGPT or Claude.
Requests and responses
- Every request goes over HTTPS to
https://api.streettext.com/v1/…. - Send
Content-Type: application/jsonwith your requests and send bodies as JSON. Leave out theAcceptheader. - Each endpoint needs a permission (scope) on your key, shown beside it. A
_writescope does not include_read; ask for both. - Responses are JSON. Shapes differ by endpoint, so check each one's example response. Deletes can answer
204with an empty body.
Errors
A failed call usually returns "success": false with an error message, and often a code and the field at fault. Some endpoints give a reason instead of error, so read both. A missing, expired or revoked key gets an OAuth-style error instead, for example {"error": "invalid_token", "error_description": "The access token provided is invalid"}.
| Status | Meaning |
|---|---|
400 | Something in the request is missing or invalid. |
401 | The key is missing, expired or revoked. |
403 | The key lacks the scope this endpoint needs, or your plan or role does not allow it. |
404 | That record does not exist in your account. |
409 | The request conflicts with the record's current state. |
429 | Too many requests. Wait and retry, slowing down each time. |
503 | The feature is unavailable right now. Retry later. |
500 | Something went wrong on our side. Try again, and contact support@streettext.com if it keeps happening. |
Leads
Leads / By Lead Email Address
Get a lead by email
/v1/leads/email/{leadEmail}
leads_read Get a single lead by email address
Requires scope(s): leads_read
Path parameters
| Name | Description |
|---|---|
leadEmail | The lead's email address. |
Leads / By Lead Email Address
Update a lead by email
/v1/leads/email/{leadEmail}
leads_write Update one or more fields in a lead. Fields not included in the request body will not be modified.
For a list of all possible fields, see Create a lead.
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadEmail | The lead's email address. |
Leads / By Lead Email Address
Delete a lead by email
/v1/leads/email/{leadEmail}
leads_write Delete a lead
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadEmail | The lead's email address. |
Leads / By Lead Phone Number
Get a lead by phone number
/v1/leads/phone/{leadPhone}
leads_read Get a single lead by phone number
Requires scope(s): leads_read
Path parameters
| Name | Description |
|---|---|
leadPhone | The lead's phone number, digits only (for example 14155552671). |
Leads / By Lead Phone Number
Update a lead by phone number
/v1/leads/phone/{leadPhone}
leads_write Update one or more fields in a lead. Fields not included in the request body will not be modified.
For a list of all possible fields, see Create a lead.
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadPhone | The lead's phone number, digits only (for example 14155552671). |
Leads / By Lead Phone Number
Delete a lead by phone number
/v1/leads/phone/{leadPhone}
leads_write Delete a lead
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadPhone | The lead's phone number, digits only (for example 14155552671). |
Leads / By Lead ID / Addresses
List Addresses
/v1/leads/{leadID}/addresses
leads_read List all of the addresses associated with a lead.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Addresses
Add a Lead Address
/v1/leads/{leadID}/addresses
leads_write Create a new address on a lead, optionally setting it as the new primary address.
Allowed fields:
| field | description |
|---|---|
address["address"] |
The street address (eg. 1234 Street Lane) |
address["city"] |
The city (eg. Townsville) |
address["province"] |
The province, state, or region. Prefer 2-character ISO regions (eg. WA, BC) but full names are also accepted. |
address["country"] |
The country. Prefer 2-character ISO countries (eg. US, CA) but full names are also accepted. |
address["postal_code"] |
The ZIP or Postal Code (eg. 42748, V1V 1V1) |
primary |
Boolean. If true, set the address to be the new primary. |
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Addresses
Update a Lead Address
/v1/leads/{leadID}/addresses/{addressID}
leads_write Update the address on a lead and/or set an address as the new primary.
address is optional, but if not provided, the only other accepted field is "primary": true
Allowed fields:
| field | description |
|---|---|
address["address"] |
The street address (eg. 1234 Street Lane) |
address["city"] |
The city (eg. Townsville) |
address["province"] |
The province, state, or region. Prefer 2-character ISO regions (eg. WA, BC) but full names are also accepted. |
address["country"] |
The country. Prefer 2-character ISO countries (eg. US, CA) but full names are also accepted. |
address["postal_code"] |
The ZIP or Postal Code (eg. 42748, V1V 1V1) |
primary |
Boolean. If set at all, it must be set to true. |
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
addressID | ID of the address, from List Addresses. |
Leads / By Lead ID / Addresses
Get Address by ID
/v1/leads/{leadID}/addresses/{addressID}
leads_read Get an address by its ID.
To get the lead's primary address, use an ID of 0
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
addressID | ID of the address, from List Addresses. |
Leads / By Lead ID / Addresses
Delete a Lead Address
/v1/leads/{leadID}/addresses/{addressID}
leads_write Delete an address from a lead.
Primary addresses ("id" = 0) cannot be deleted. To delete a primary address, first promote another address to primary.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
addressID | ID of the address, from List Addresses. |
Leads / By Lead ID / Emails
List Lead Emails
/v1/leads/{leadID}/emails
leads_read List all of the email addresses associated with a lead. The primary email address is the one that will receive email automations.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Emails
Add a Lead Email Address
/v1/leads/{leadID}/emails
leads_write Add a new email address to a lead. You can optionally include a primary boolean that will promote the new email address as the default.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Emails
Update Lead Email Address
/v1/leads/{leadID}/emails/{email}
leads_write Update a lead's email address. At the moment, only the primary flag can be set to true.
If you need to change an existing email address, you must first delete the current one, then create a new one to replace it.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
email | The email address to change or remove. |
Leads / By Lead ID / Emails
Delete a Lead Email Address
/v1/leads/{leadID}/emails/{email}
leads_write Delete a lead's email address.
The primary address cannot be deleted, so another must be promoted to primary first.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
email | The email address to change or remove. |
Leads / By Lead ID / Phones
List Lead Phone Numbers
/v1/leads/{leadID}/phones
leads_read List all of the phone numbers associated with a lead. The primary phone number is the one that will receive SMS automations.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Phones
Add a Lead Phone Number
/v1/leads/{leadID}/phones
leads_write Add a new phone number to a lead. You can optionally include a primary boolean that will promote the new number as the default.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID / Phones
Update Lead Phone Number
/v1/leads/{leadID}/phones/{phone}
leads_write Update a lead's phone number. At the moment, only the primary flag can be set to true.
If you need to change an existing number, you must first delete the current one, then create a new one to replace it.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
phone | The phone number to change or remove. |
Leads / By Lead ID / Phones
Delete a Lead Phone Number
/v1/leads/{leadID}/phones/{phone}
leads_write Delete a lead's phone number.
The primary number cannot be deleted, so another must be promoted to primary first.
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
phone | The phone number to change or remove. |
Leads / By Lead ID
Get a lead by ID
/v1/leads/{leadID}
leads_read Get a single lead by ID
Requires scope(s): leads_read
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID
Update a lead by ID
/v1/leads/{leadID}
leads_write Update one or more fields in a lead. Fields not included in the request body will not be modified.
For a list of all possible fields, see Create a lead.
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Leads / By Lead ID
Delete a lead by ID
/v1/leads/{leadID}
leads_write Delete a lead
Requires scope(s): leads_write
Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Get all leads
/v1/leads
leads_read Get a list of leads for the user.
Requires scope(s): leads_read
Accepts the following parameters
| Parameter | Value |
|---|---|
| limit (optional) | How many leads to return back (default is 20) |
| page (optional) | Which page to request |
The max limit per request is 100 leads, if more than that is requested it will revert back to the default 20.
Get a notes on a Lead
/v1/leads/{leadID}/notes
leads_read Path parameters
| Name | Description |
|---|---|
leadID | ID of the lead. |
Create a lead
/v1/leads
leads_write This endpoint allows you to create a new lead in the system by submitting relevant contact and campaign information. It is typically used to capture leads generated from marketing campaigns, landing pages, or integrations with third-party platforms.
Request Body
Send a JSON object in the request body with the following fields:
| Parameter | Type | Description |
|---|---|---|
name_first |
string | The lead's first (given) name. |
name_last |
string | The lead's last (family) name. |
email |
string | Required* Email address of the lead. |
phone |
string | Required* Primary phone number. Prefer E.164 formatting. |
phone_cell |
string | Mobile phone number (E.164 format recommended). |
address |
string | Residential address. |
city |
string | City of residence. |
province |
string | Province, state, or region of residence. |
country |
string | 2-character ISO country code (e.g., "US"). |
postal_code |
string | Postal or ZIP code. |
id_ad |
integer | The ID of the StreetText ad the lead came through. |
id_funnel |
integer | The ID of the StreetText funnel the lead came through. |
id_facebook_ad |
integer | The ID of the Facebook ad the lead came through. |
additional_data |
object | An object containing key-value pairs of additional information to add to the lead. |
tags |
array | An array of tags to associate with the lead. |
Example Request Body
{
"name_first": "John",
"name_last": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"address": "123 Main St",
"city": "Springfield",
"province": "CA",
"country": "US",
"postal_code": "90210",
"id_ad": 12345,
"id_funnel": 12345,
"id_facebook_ad": 12345,
"additional_data": {
"key1": "value1",
"key2": "value2"
},
"tags": ["buyer", "newsletter"]
}
Important Notes
- Required Fields: Either
emailorphonemust be provided to create a lead. - Formatting: For phone numbers, E.164 formatting is recommended (e.g.,
+1234567890). - Authentication: Requires the
leads_writescope.
Success Response
- Status Code:
201 Created - Response Body:
{ "id": 141932741 }
Error Responses
- 400 Bad Request: Missing required fields or invalid input.
Usage
Use this endpoint to programmatically add new leads to your system, ensuring all required fields are included and formatted correctly. This is commonly used in marketing automation, CRM integrations, and lead capture workflows.
Domains
To run certain types of ads, custom domains are now required by some platforms, like Facebook. StreetText allows our customers to purchase a custom domain within their account to use as a landing page for prospective leads on these platforms.
Third parties can also register their own subdomains on a customer's domain to provide landing pages that can link back to a StreetText customer's collection of leads and funnels.
List a user's domains
/v1/domains
domains_read Get a list of the user's StreetText-registered domains.
Requires scope(s): domains_read
Get domain information
/v1/domains/{domain}
domains_read Get information about a given domain, including DNS records.
Note: Only DNS records created using your API key will be included in the records collection.
Requires scope(s): domains_read
Response Properties
| Property | Description |
|---|---|
| allowed_subdomains | A list of DNS record names that your API key is permitted to create on this domain |
| date_registered | The date the domain was registered |
| date_renewal | The date the domain is due for renewal |
| name | The domain name |
| records | A list of the DNS records that have been created on the domain by your API key only |
Path parameters
| Name | Description |
|---|---|
domain | The domain name, for example example.com. |
Get domain records
/v1/domains/{domain}/records
domains_read Get a list of DNS records on a given domain.
Note: Only DNS records created using your API key will be returned.
Requires scope(s): domains_read
Path parameters
| Name | Description |
|---|---|
domain | The domain name, for example example.com. |
Create a record on the domain
/v1/domains/{domain}/records
domains_readdomains_write Create a new DNS record under a given domain.
Requires scope(s): domains_read, domains_write
Path parameters
| Name | Description |
|---|---|
domain | The domain name, for example example.com. |
Remove a domain record
/v1/domains/{domain}
domains_readdomains_write Remove a DNS record from a domain.
Note: Only DNS records created by your API key can be deleted.
Requires scope(s): domains_read, domains_write
Path parameters
| Name | Description |
|---|---|
domain | The domain name, for example example.com. |
Query parameters
| Name | Description |
|---|---|
name | |
type |
Funnels
Funnels need the funnels_read scope, which OAuth apps can request; personal API keys do not include it.
Get Leads in a Funnel
/v1/funnels/{funnelID}/leads
funnels_read Path parameters
| Name | Description |
|---|---|
funnelID | ID of the funnel, from List Funnels. |
List Funnels
/v1/funnels
funnels_read Webhooks
Webhooks in the StreetText API enable automated, real-time communication between StreetText and external systems by sending HTTP POST requests to a specified URL when certain events occur. These events might include actions like lead creation, SMS sent, or other critical interactions within the StreetText platform.
By configuring webhooks, developers can ensure that their applications receive immediate updates, allowing for seamless integration and synchronization with StreetText's event-driven architecture. This folder contains endpoints for managing webhook registrations, including creating, editing, deleting, and testing webhooks.
Request Signatures
HMAC (Hash-based Message Authentication Code) signing in the StreetText API provides an added layer of security by verifying that webhook requests originate from StreetText. Each webhook request includes a signature header (X-Streettext-Hmac-Sha256) which is generated using the SHA-256 algorithm.
This signature is a hash created by combining the JSON-encoded request body with a secret key unique to each webhook. When receiving a webhook, you can compute the HMAC hash using the same secret key and compare it with the signature in the header. If the hashes match, it confirms the integrity and authenticity of the request, ensuring that it originated from StreetText and has not been tampered with in transit.
List Webhooks
/v1/webhooks
webhooks_read This endpoint retrieves a list of webhooks registered by your application.
Webhooks created by other applications, or by the user directly will not be included.
Request
No body is required for this request.
Response
The response will be a JSON array containing the following fields:
| Field | Type | Description |
|---|---|---|
id_webhook |
string | The ID of the webhook. |
webhook_url |
string | The URL of the webhook. |
signing_key |
string | An auto-generated key that will be used to sign each webhook request. |
enabled |
boolean | The webhook will not fire events when disabled |
date_created |
date string | The date the webhook was created |
date_updated |
date string | The date the webhook was last updated |
events |
array of strings | An array of events associated with the webhook. |
webhook_api_version |
string | The version of the webhook payload format. |
Scope Required
webhooks_read
List Webhook Events
/v1/webhooks/events
webhooks_read This will return a list of all events that can currently be subscribed to.
Request
This request requires no body.
Response
| Field | Description |
|---|---|
name |
The event name. Use this when registering webhooks. |
description |
A brief description of when the event will fire |
Scope Required
webhooks_read
Register a Webhook
/v1/webhooks
webhooks_write Register a new webhook.
Request
| Field | Type | Description |
|---|---|---|
webhook_url |
string | The URL to which the webhook events will be sent. |
events |
array of strings | The list of events to subscribe to. See "List Webhook Events" for possible values. |
Response
The created webhook will be returned.
See "List Webhooks" for a description of the fields that will be returned.
Scope Required
webhooks_write
Get a Webhook by ID
/v1/webhooks/{webhookID}
webhooks_read Retrieve the details of a specific webhook based on the provided webhook ID.
Response
| Field | Type | Description |
|---|---|---|
id_webhook |
string | The ID of the webhook. |
webhook_url |
string | The URL of the webhook. |
signing_key |
string | An auto-generated key that will be used to sign each webhook request. |
enabled |
boolean | The webhook will not fire events when disabled |
date_created |
date string | The date the webhook was created |
date_updated |
date string | The date the webhook was last updated |
events |
array of strings | An array of events associated with the webhook. |
webhook_api_version |
string | The version of the webhook payload format. |
Scope Required
webhooks_read
Path parameters
| Name | Description |
|---|---|
webhookID | ID of the webhook, from List Webhooks. |
Update a Webhook
/v1/webhooks/{webhookID}
webhooks_write Update the details of a specific webhook based on the provided webhook ID.
Request Body
Send
webhook_urlon every update, even when you only changeevents:webhook_url(string): The URL of the webhook.events(array): A complete array of events associated with the webhook. Events not included in this list will be removed from the webhook if previously set.
Scope Required
webhooks_write
Path parameters
| Name | Description |
|---|---|
webhookID | ID of the webhook, from List Webhooks. |
Test a Webhook
/v1/webhooks/{webhookID}/test
webhooks_write Send a sample payload to the configured webhook and report back the response status code and body your service returns.
Request
- This endpoint requires no request body
Scope Required
webhooks_write
Path parameters
| Name | Description |
|---|---|
webhookID | ID of the webhook, from List Webhooks. |
Unregister a Webhook
/v1/webhooks/{webhookID}
webhooks_write Delete a webhook registration from StreetText.
Request
- No body is required for this request
Response
204 No Contentif the webhook was unregistered successfullyThis response includes no body
Scope Required
webhooks_write
Path parameters
| Name | Description |
|---|---|
webhookID | ID of the webhook, from List Webhooks. |
Custom Fields
Custom fields are account-wide definitions (for example Anniversary or Pre-approved). The values live on each lead in additional_data, keyed by the field's name, and are written through the leads endpoints.
List custom fields
/v1/customfields
customfields_read Returns every custom field defined on the account.
Query parameters
| Name | Description |
|---|---|
active_only | Set to 1 to leave out inactive fields. |
Create a custom field
/v1/customfields
customfields_write Adds a new custom field to the account.
Body
| Name | Description |
|---|---|
namestring | snake_case key used in a lead's additional_data. Built from label when left out. |
labelstring | The name people see. Required* (send name or label). |
typestring | text, number, date, dropdown or checkbox. Defaults to text. |
optionsarray | The choices, for type = dropdown. |
sort_orderinteger | Display order, lowest first. |
hide_if_emptyinteger | 1 hides the field on a lead until it has a value. |
descriptionstring | What the field means, in plain words (up to 300 characters). |
ai_enabledinteger | 1 lets the StreetText AI read this field as context for each contact. |
Get a custom field
/v1/customfields/{fieldID}
customfields_read Returns one custom field.
Path parameters
| Name | Description |
|---|---|
fieldID | ID of the custom field. |
Update a custom field
/v1/customfields/{fieldID}
customfields_write Changes only the fields you send. Set is_active to 0 to retire a field without deleting it.
Path parameters
| Name | Description |
|---|---|
fieldID | ID of the custom field. |
Body
| Name | Description |
|---|---|
namestring | snake_case key used in a lead's additional_data. Built from label when left out. |
labelstring | The name people see. Required* (send name or label). |
typestring | text, number, date, dropdown or checkbox. Defaults to text. |
optionsarray | The choices, for type = dropdown. |
sort_orderinteger | Display order, lowest first. |
hide_if_emptyinteger | 1 hides the field on a lead until it has a value. |
descriptionstring | What the field means, in plain words (up to 300 characters). |
ai_enabledinteger | 1 lets the StreetText AI read this field as context for each contact. |
is_activeinteger | 0 retires the field. |
Delete a custom field
/v1/customfields/{fieldID}
customfields_write Deletes the definition. Values already saved on leads are kept.
Path parameters
| Name | Description |
|---|---|
fieldID | ID of the custom field. |
Conversations
Text message conversations between your account and your leads. Needs the texting feature on the StreetText plan, and the conversations_read or conversations_write scope.
You are responsible for consent when you send messages through the API (TCPA in the US, CASL in Canada). Numbers on the Do Not Contact list are never texted.
List conversations
/v1/conversations
conversations_read Returns conversation threads, newest activity first.
Query parameters
| Name | Description |
|---|---|
filter | needs_reply, unread or all (default). |
q | Search by lead name, phone or message text. |
since | Unix timestamp. Only threads with activity after this time. |
limit | Threads per page. |
page | Page number, starting at 1. |
Get conversation counts
/v1/conversations/counts
conversations_read How many conversations need a reply, are unread, and exist in total.
Get conversation details
/v1/conversations/{conversationUUID}/info
conversations_read The conversation plus the full lead it belongs to.
Path parameters
| Name | Description |
|---|---|
conversationUUID | The conversation ID returned by List conversations. |
List messages
/v1/conversations/{conversationUUID}
conversations_read The message history of one conversation. date_created is a Unix timestamp sent as a string.
Path parameters
| Name | Description |
|---|---|
conversationUUID | The conversation ID returned by List conversations. |
Query parameters
| Name | Description |
|---|---|
limit | Messages per page (default 500). |
page | Page number, starting at 1. |
Send a message
/v1/conversations/{conversationUUID}
conversations_write Sends a text into an existing conversation from your StreetText number.
Path parameters
| Name | Description |
|---|---|
conversationUUID | The conversation ID returned by List conversations. |
Body
| Name | Description |
|---|---|
bodystring | Required. The message text. |
attachmentsarray | Image URLs to send as MMS. |
Start a conversation
/v1/conversations/send
conversations_write Sends the first text to a lead. Texts the lead's main number unless you name another of their numbers in phone_number.
Body
| Name | Description |
|---|---|
id_leadinteger | Required. The lead to text. |
phone_numberstring | One of the lead's numbers to text instead of their main one, E.164 format. |
bodystring | Required. The message text. |
attachmentsarray | Image URLs to send as MMS. |
Update a conversation
/v1/conversations/{conversationUUID}
conversations_write Mark a conversation read or archive it. Send either field, or both.
Path parameters
| Name | Description |
|---|---|
conversationUUID | The conversation ID returned by List conversations. |
Body
| Name | Description |
|---|---|
readboolean | true marks every message read. |
archivedboolean | true archives the conversation. |
Account
Get My User ID
/v1/me
me_read Returns the account the token belongs to, the role of the person who made it, and the scopes it holds. Needs the me_read scope, which OAuth apps can request; personal API keys do not include it.
Need help?
Email support@streettext.com with what you are building and we will help.