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/campaign-registry/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/campaign-registry/webhooks/ten-dlc-status-callback) docs for the webhook payload.

Response Example

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

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9order = client.registry.campaigns.create_order(
10 "campaign-id",
11 phone_numbers=["+15125551234"],
12)
13print("Order ID:", order.get("id"))