Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tracklysms.com/llms.txt

Use this file to discover all available pages before exploring further.

Error Codes

All API errors follow a consistent JSON response format. When a request fails, the response body contains a structured error object that you can use for programmatic error handling.

Error Response Format

All error responses are JSON objects. The error field is always present. Two additional fields may be present depending on the endpoint:
{
  "error": "API key required",
  "code": "missing_api_key"
}
FieldTypeAlways present?Description
errorstringYesHuman-readable description of the error.
codestringMostlyMachine-readable error code for programmatic handling. Present on the vast majority of errors but omitted by a small number of endpoints (notably the 403 Account is suspended response and a handful of legacy paths). Always defensively check for its presence.
messagestringSometimesOptional supplementary detail. Some endpoints (notably v1 phone validation and a few v2 paths) include a third message field with additional context; most do not.
Treat error as guaranteed and code/message as optional. Switch on code when present and fall back to the error text otherwise.

Authentication Errors (401)

Returned when the request is missing valid authentication credentials.
Error CodeMessageDescription
missing_api_keyAPI key requiredThe X-Api-Key header was not included in the request.
invalid_api_keyInvalid API keyThe provided API key does not match any active key. Verify the key format (trk_[32-char-alphanumeric]) and that it has not been revoked.
API keys are sensitive credentials. Never expose them in client-side code, public repositories, or logs.
Common Causes:
  • API key was revoked or rotated in the dashboard
  • Key is being sent in the wrong header (must be X-Api-Key, not Authorization)
  • Extra whitespace or newline characters in the key value
Resolution:
  1. Verify your key in Dashboard > Settings > API Keys
  2. Ensure the header is exactly X-Api-Key: trk_... with no extra spaces
  3. Generate a new key if the current one may be compromised

Example

{
  "error": "Invalid API key",
  "code": "invalid_api_key"
}

Validation Errors (400)

Returned when the request payload is malformed, missing required fields, or contains invalid values.

General Validation

Error CodeMessageDescription
not_foundResource not foundThe referenced resource does not exist or is not accessible.
confirm_requiredconfirm must be trueA destructive operation requires explicit confirmation via confirm: true.

Send / Message Validation

Error CodeMessageDescription
missing_toto is requiredThe to field (recipient phone number) was not provided.
missing_list_numberlist_number is requiredThe list_number field (sending phone number) was not provided.
missing_bodybody is requiredThe message body field was not provided.
invalid_phoneInvalid recipient phone number formatThe to value is not a valid E.164 phone number (e.g. +14155551234).
invalid_phoneInvalid E.164 phone number formatA phone number field does not conform to E.164 format.
invalid_list_numberInvalid list_number E.164 formatThe list_number value is not a valid E.164 phone number.
missing_fromfrom is requiredThe sending number/list (from, from_phone_number_id) was not provided.
missing_to_numberto_number is requiredThe to_number field was not provided on a raw send.
missing_phonesphones array is required and must be non-emptyThe phones array (batch phone validation) was not provided or is empty.
invalid_forceforce must be a booleanThe force field was not a strict boolean (string "true" / int 1 are rejected).
invalid_channelchannel must be one of: sms, voice, autoThe OTP channel value is not one of the allowed options.
missing_consent_methodconsent_method is requiredTCPA consent method was not provided when adding/resubscribing a contact.
invalid_consent_methodInvalid consent_methodProvided consent method is not one of the allowed values.
verbal_not_valid_for_marketingVerbal consent not valid for marketingVerbal consent cannot be used to opt a contact into marketing messages.
missing_messagesmessages array is requiredThe messages array was not provided in a bulk send request.
list_not_foundSending list not found for this list_numberNo sending list is associated with the provided list_number.
webhook_not_configuredWebhook verification required before sendingThe BYOC list requires webhook verification before messages can be sent.

Phone Number Validation

Error CodeMessageDescription
missing_phone_numberphone_number is requiredThe phone_number field was not provided.
missing_phonephone number is requiredThe phone field was not provided (single-number validation endpoint).
phone_type_blockedPhone type blocked by account settingsThe recipient line type (e.g. VOIP, landline) is blocked by the account’s OTP settings. Returned by OTP endpoints only.

Generic Input Validation

Error CodeMessageDescription
invalid_inputInvalid inputThe request payload could not be parsed or contains invalid structure.
missing_fieldsRequired fields missingOne or more required fields are absent from the request.
missing_idid is requiredA resource identifier was not provided.
missing_urlurl is requiredA url field was not provided.
missing_url_or_offerurl or offer_id is requiredEither a raw URL or an offer reference must be provided.
invalid_urlInvalid URLThe URL is malformed or cannot be parsed.
invalid_url_schemeURL scheme must be http or httpsThe URL uses an unsupported scheme.
unsafe_urlUnsafe URLThe URL points to a domain blocked by the carrier-safety list.
url_too_longURL exceeds maximum lengthThe URL is longer than the per-endpoint maximum.
field_too_longField exceeds maximum lengthA string field exceeds its per-endpoint character cap.
too_longValue too longGeneric length-cap violation.
invalid_metadataInvalid metadataThe metadata field is not a valid object.
metadata_too_largeMetadata exceeds maximum sizeThe metadata payload exceeds the per-endpoint byte cap.
invalid_ip_addressInvalid IP addressThe ip_address field is not a valid IPv4 or IPv6 address.
invalid_timestampInvalid timestampThe timestamp value cannot be parsed.
mutually_exclusiveMutually exclusive fields providedTwo fields that may not coexist were both provided.
payload_too_largePayload exceeds size limitThe total request body exceeds the 5 MB limit.
requiredField is requiredGeneric required-field violation. The accompanying error text identifies which field.
validation_failedValidation failedGeneric validation rejection covering compound rules.

Creative Validation

Error CodeMessageDescription
missing_namename is requiredThe creative name field was not provided.
missing_messagemessage is requiredThe creative message field was not provided.
missing_offer_linksoffer_links is requiredThe offer_links array was not provided for a creative that uses link placeholders.
name_too_longname must be 255 characters or lessThe creative name exceeds the 255 character limit.
message_too_longmessage must be 1600 characters or lessThe creative message exceeds the 1600 character limit.
invalid_statusstatus must be one of: …The provided status value is not a valid option.
invalid_creative_typecreative_type must be one of: …The provided creative_type value is not a valid option.
missing_link_placeholdermessage must contain at least one {{linkN}} placeholderThe creative message does not contain a required {{linkN}} placeholder.
missing_offer_links_for_placeholdersMissing offer_links for placeholders: …One or more {{linkN}} placeholders in the message do not have corresponding entries in offer_links.
missing_offer_link_keyoffer_link key is requiredAn entry in the offer_links array is missing its key field.
missing_offer_link_offer_idoffer_link offer_id is requiredAn entry in the offer_links array is missing its offer_id field.
offer_not_foundOffer not found: …The referenced offer ID does not exist in your account.

Contact Validation

Error CodeMessageDescription
missing_contactscontacts array is requiredThe contacts array was not provided in a bulk contact request.
missing_recordsrecords array is requiredThe records array was not provided in a bulk import request.

Audience Validation

Error CodeMessageDescription
missing_filterfilter is requiredThe audience filter object was not provided.
missing_audiencesaudiences is requiredThe audiences array was not provided.
empty_filter_groupFilter group cannot be emptyA filter group was provided with zero conditions.
invalid_condition_typeInvalid condition typeThe audience condition type is not a recognized value.
invalid_audience_idInvalid audience IDAn audience ID could not be parsed or is not a valid ObjectId.
invalid_time_fieldInvalid time fieldThe time-based filter references a field that does not exist or is not filterable.
invalid_time_operatorInvalid time operatorThe time-based filter uses an operator that is not supported.
invalid_time_unitInvalid time unitThe time-based filter uses an unsupported unit (allowed: hours, days, weeks).
missing_time_valueTime value is requiredA time-based filter is missing its numeric value.
invalid_count_fieldInvalid count fieldThe count-based filter references a non-countable field.
invalid_count_operatorInvalid count operatorThe count-based filter uses an unsupported operator.
missing_count_valueCount value is requiredThe count-based filter is missing its numeric threshold.
invalid_revenue_fieldInvalid revenue fieldThe revenue filter references a non-existent field.
invalid_revenue_operatorInvalid revenue operatorThe revenue filter uses an unsupported operator.
missing_revenue_valueRevenue value is requiredThe revenue filter is missing its numeric threshold.
missing_revenuerevenue is requiredThe revenue field was not provided on a record-revenue call.
invalid_revenueInvalid revenueThe revenue value is not a non-negative number.
invalid_carrier_operatorInvalid carrier operatorThe carrier filter uses an unsupported operator.
missing_carrier_valueCarrier value is requiredThe carrier filter is missing its target value.
invalid_phone_numbers_operatorInvalid phone_numbers operatorThe phone-numbers filter uses an unsupported operator.
missing_phone_numbers_valuephone_numbers value is requiredThe phone-numbers filter is missing its array of values.
invalid_timezone_operatorInvalid timezone operatorThe timezone filter uses an unsupported operator.
missing_timezone_valueTimezone value is requiredThe timezone filter is missing its target value.
invalid_custom_field_operatorInvalid custom field operatorA custom-field filter uses an unsupported operator.
missing_custom_field_namecustom field name is requiredA custom-field filter is missing its name.
missing_custom_field_valuecustom field value is requiredA custom-field filter is missing its value.
missing_custom_fieldscustom_fields are requiredThe custom_fields object is required for this operation.
invalid_custom_fieldsInvalid custom_fieldsThe custom_fields payload could not be parsed.
invalid_group_operatorInvalid group operatorA filter group uses an unsupported logical operator (allowed: AND, OR).
invalid_entitiesInvalid entitiesThe entities array contains values that aren’t recognized.
missing_entitiesentities is requiredThe entities array was not provided to history/clear.
invalid_eventsInvalid eventsThe events array contains unrecognized event names.

Schedule Validation

Error CodeMessageDescription
missing_send_typesend_type is requiredThe send_type field was not provided.
invalid_send_typeInvalid send_typeThe send_type value is not one of the allowed options.
missing_send_datesend_date is requiredOne-time schedule is missing its send_date.
missing_send_timesend_time is requiredThe send_time (HH:MM) was not provided.
missing_start_datestart_date is requiredA repeating schedule is missing its start_date.
missing_end_dateend_date is requiredA repeating schedule is missing its end_date.
missing_is_repeatingis_repeating is requiredThe is_repeating boolean was not provided.
no_days_selectedAt least one day of week must be selectedA repeating weekly schedule has no days_of_week enabled.
missing_blastsblasts is requiredA blast schedule is missing its blasts array.
missing_blast_messageEach blast must have a messageA blast variant is missing its message.
invalid_blast_percentInvalid blast percentA blast variant’s percent is invalid or the totals don’t sum to 100.
schedule_completeSchedule is already completeOperation cannot be performed on a schedule that has finished.
source_list_not_foundSource list not foundA source_lists ID does not match any list on the account.

Offer / Partnership Offer Validation

Error CodeMessageDescription
missing_offer_idoffer_id is requiredThe offer_id field was not provided.
invalid_offer_idInvalid offer_idThe offer ID could not be parsed.
invalid_offer_link_offer_idInvalid offer_link offer_idAn entry in offer_links references an invalid offer ID.
invalid_offer_linksInvalid offer_linksThe offer_links array is malformed.
invalid_payout_typepayout_type must be one of: cpa, cpcThe payout_type value is not a recognized option.
missing_attribution_typeattribution_type is requiredThe revenue attribution_type was not provided.
invalid_attribution_typeInvalid attribution_typeThe revenue attribution_type is not a recognized option.
invalid_external_platformInvalid external_platformThe external_platform value is not one of the allowed options.

List / Contact / Resource Errors

Error CodeMessageDescription
contact_not_foundContact not foundThe contact does not exist for this account.
list_contact_not_foundList contact not foundThe contact is not subscribed to the specified list.
message_not_foundMessage not foundThe message ID does not match any message on the account.
missing_message_idmessage_id is requiredThe message_id field was not provided.
missing_list_identifierlist_id or list_number is requiredNeither list_id nor list_number was provided.
missing_tracking_urltracking_url is requiredThe offer’s tracking_url was not provided.
missing_timestamptimestamp is requiredThe timestamp field was not provided.
id_collisionID collisionThe provided client-supplied ID conflicts with an existing record.
already_activeAlready activeCannot reactivate — record is already in active state.
voice_not_enabledVoice channel not enabledThe OTP voice channel is not enabled for this account.
otp_not_activeOTP not activeThe OTP session has expired or is not in an active state.
invalid_codeInvalid codeThe OTP code provided does not match.
Common Causes:
  • Phone numbers missing the + prefix or country code (must be E.164 format like +14155551234)
  • Sending to a list_number that belongs to a different account
  • Bulk request arrays exceeding the 1,000 item limit
  • Creative message body exceeding the 1,600 character limit
Resolution:
  1. Validate phone numbers match E.164 format before sending
  2. Use the List endpoint to verify your list_number values
  3. Check the code field in the error response for the specific validation that failed

Resource Limit Errors (413)

Returned when a bulk request exceeds the maximum number of items allowed per request.
Error CodeMessageLimitDescription
too_many_messagesMaximum 1000 messages per request1,000The messages array in a bulk send exceeds the limit.
too_many_contactsMaximum 1000 contacts per request1,000The contacts array in a bulk contact operation exceeds the limit.
too_many_contacts_with_validationMaximum reduced when use_validation=true(smaller)When use_validation=true is set on bulk contact create, the per-request cap is lower because each contact triggers a billable lookup.
too_many_recordsMaximum 1000 records per request1,000The records array in a bulk import exceeds the limit.
too_many_phonesMaximum 500 phones per request500The phones array in batch phone validation exceeds the limit.

Example

{
  "error": "Maximum 1000 messages per request",
  "code": "too_many_messages"
}
To process more than 1,000 items, split your data into batches and send multiple requests sequentially.
Common Causes:
  • Attempting to send more than 1,000 messages in a single bulk request
  • Importing more than 1,000 contacts or records in one API call
Resolution:
  1. Split large datasets into batches of 1,000 or fewer items
  2. Process batches sequentially with error handling between each batch
  3. Use the response error_count and errors array to identify and retry failed items

Not Found Errors (404)

Returned when the requested resource does not exist or is not accessible under your account.
Error CodeMessageDescription
not_foundResource not foundGeneric not-found error. The message may include the specific resource type (e.g. “Contact not found”, “Creative not found”, “Schedule not found”).

Example

{
  "error": "Contact not found",
  "code": "not_found"
}
Common Causes:
  • Using an ID from a different account (all resources are account-scoped)
  • Referencing a resource that was deleted
  • Typo in the resource ID
Resolution:
  1. Verify the resource exists by calling the corresponding List endpoint
  2. Ensure your API key belongs to the same account that owns the resource
  3. Check that you are using the correct ID format (MongoDB ObjectId for most resources)

Forbidden / Access Errors (403)

Returned when a valid API key is presented but the account is not permitted to perform the requested action. The 403 Account is suspended response intentionally omits the code field — see Authentication.
Error CodeMessageDescription
product_not_enabled{PRODUCT} product not enabled for this accountThe endpoint belongs to a product not enabled for your account. The actual code follows the pattern {product}_not_enabled (e.g. email_not_enabled, partnerships_not_enabled). Contact support to enable.
billing_blockedBilling blockedAccount has an outstanding billing problem (failed charge, suspended billing).
fraud_blockedAccount flagged for fraud reviewAccount is in fraud-review hold; sends are paused until cleared.
geo_restrictedGeographic restrictionThe recipient country is not enabled for this account.
phone_type_blockedPhone type blocked by account settingsOTP recipient’s line type (VOIP/landline) is blocked by account settings.

Conflict Errors (409)

Returned when the request conflicts with the current state of the resource.
Error CodeMessageDescription
id_collisionID collisionA client-supplied ID conflicts with an existing record.
already_activeAlready activeThe record is already in the requested state.
no_domain_configuredNo link domain configured for this listThe sending list has no link-shortener domain configured; cannot create or shorten links until one is set in the dashboard.

Rate-Limit / Throttling Errors (429)

Returned when the request is throttled by per-account, per-endpoint, or upstream rate limits. Retry with exponential backoff.
Error CodeMessageDescription
rate_limitedRate limit exceededThe endpoint has hit its rate limit (per-account or upstream).
daily_cap_exceededDaily send cap exceededThe account has hit its 24-hour send cap.
cooling_offCooling-off period in effectRecipient is in a cooling-off window after a recent send.
limit_reachedLimit reachedA per-account or per-endpoint quota has been exhausted.

Server / Infrastructure Errors (5xx)

Returned when an internal subsystem fails. These are generally transient — retry with exponential backoff.
Error CodeHTTPMessageDescription
send_failed500Send failedThe send pipeline encountered an unrecoverable error.
save_error500Save errorA datastore write failed.
queue_failed500Queue failedThe send-queue insertion failed.
provider_sync_failed502Provider sync failedAn upstream provider (CRM/affiliate platform) sync did not complete.
provider_error503Provider unavailableAn upstream provider is unavailable.
redis_unavailable503Redis unavailableRedis (rate-limiter / dedup cache) is unreachable.
circuit_open503Circuit breaker openA subsystem circuit breaker is open after repeated failures; backing off.

Handling Errors in Code

curl -i -X POST https://api.tracklysms.com/api/v2/send \
  -H "X-Api-Key: trk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "list_number": "+14155551234",
    "to": "+14155556789",
    "body": "Hello!"
  }'

# Check the HTTP status code and parse the JSON error response:
# HTTP/1.1 400 Bad Request
# {"error": "Invalid recipient phone number format", "code": "invalid_phone"}

Next Steps

API Limits & Best Practices

Payload limits, batch sizes, and retry strategies

Send Message

Send your first API message