create_order

View as MarkdownOpen in Claude

Create a number assignment order to assign phone numbers to a campaign.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of the campaign.

Request

phone_numberslist of stringsOptional
A list of phone numbers in E164 format.
status_callback_urlstringOptional
Optional: Specify a URL to receive webhook notifications when your number assignment order and the number assignments that belong to it change state. See the [10DLC status callback](/docs/apis/rest/webhooks/ten-dlc-status-callback) docs for the webhook payload.

Response

idstringRequiredformat: "uuid"
The unique identifier of the order.
statestringOptional
The current state of the order.
processed_atdatetimeOptional
Timestamp when the order was processed.
created_atdatetimeOptional
Timestamp when the order was created.
updated_atdatetimeOptional
Timestamp when the order was last updated.
status_callback_urlstringOptional
Optional: Specify a URL to receive webhook notifications when your number assignment order and the number assignments that belong to it change state. See the [10DLC status callback](/docs/apis/rest/webhooks/ten-dlc-status-callback) docs for the webhook payload.

Response Example

Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"state": "pending",
"processed_at": "2024-01-15T09:30:00Z",
"created_at": "2024-01-15T09:30:00Z",
"updated_at": "2024-01-15T09:30:00Z",
"status_callback_url": "https://example.com/handle_callback"
}

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
order = client.registry.campaigns.create_order(
"campaign-id",
phone_numbers=["+15125551234"],
)
print("Order ID:", order.get("id"))