Short Codes

Update short code

Changes how a project Short Code is identified or routes inbound messages. It can route incoming traffic to a cXML webhook, cXML Application, or Relay handler. Standard project phone numbers use Update phone number instead.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Numbers.

Learn more about API scopes.

put/api/relay/rest/short_codes/{id}

Path parameters

idstring uuid required

Universal Unique Identifier.

Unique ID of the short code.

Request body

namestring required

The name given to the short code.

message_handler'relay_context' | 'laml_webhooks' | 'laml_application' required

Message handler type for short codes.

message_request_urlstring

The URL to send message requests to when using laml_webhooks handler.

message_request_method'GET' | 'POST'

HTTP method type.

message_fallback_urlstring

The fallback URL for message requests.

message_fallback_method'GET' | 'POST'

HTTP method type.

message_laml_application_idstring uuid

Universal Unique Identifier.

message_relay_contextstring

The Relay context to use when using relay_context handler.

Example request

{
  "name": "My Short Code",
  "message_request_url": "https://example.com/message",
  "message_fallback_url": "https://example.com/fallback",
  "message_relay_context": "my-context"
}

Response

The request has succeeded.

idstring uuid required

Universal Unique Identifier.

namestring nullable required

The name given to the short code.

numberstring required

The short code number.

capabilitiesShortCodeCapability[] required

The messaging capabilities of the short code.

number_type'shortcode' required

The type of number (always 'shortcode').

code_type'vanity' | 'random' required

Short code type.

country_codestring required

The ISO 3166-1 alpha-2 country code.

created_atstring required

The date and time when the short code was created.

updated_atstring required

The date and time when the short code was last updated.

next_billed_atstring nullable required

The date and time when the short code will next be billed.

lease_durationstring nullable required

The lease duration of the short code (e.g., '12 months').

message_handler'relay_context' | 'laml_webhooks' | 'laml_application' required

Message handler type for short codes.

message_request_urlstring nullable required

The URL to send message requests to when using laml_webhooks handler.

message_request_method'GET' | 'POST' required

HTTP method type.

message_fallback_urlstring nullable required

The fallback URL for message requests.

message_fallback_method'GET' | 'POST' required

HTTP method type.

message_laml_application_idstring uuid required

Universal Unique Identifier.

message_relay_contextstring nullable required

The Relay context to use when using relay_context handler.

Example response

{
  "name": "My Short Code",
  "number": "12345",
  "number_type": "shortcode",
  "country_code": "US",
  "created_at": "2023-01-15T10:30:00Z",
  "updated_at": "2023-01-15T10:30:00Z",
  "next_billed_at": "2024-01-15T10:30:00Z",
  "lease_duration": "12 months",
  "message_request_url": "https://example.com/message",
  "message_fallback_url": "https://example.com/fallback",
  "message_relay_context": "my-context"
}

Changes

No changes found, but 3 of the 137 revisions have a changelog that could not be searched — this endpoint may have changed in one of them.