Assign a number to an approved campaign.
curl --request PUT \
--url https://omni-api.sendblue.com/numbers/{phone_number}/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_id": "MG0123456789abcdef0123456789abcdef"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaign_id: 'MG0123456789abcdef0123456789abcdef'})
};
fetch('https://omni-api.sendblue.com/numbers/{phone_number}/campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/numbers/{phone_number}/campaign"
payload = { "campaign_id": "MG0123456789abcdef0123456789abcdef" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"phone_number": "+14155550100",
"campaign_id": "MG0123456789abcdef0123456789abcdef",
"sms": {
"enabled": false,
"blocked_reason": "carrier_assignment_pending"
},
"assigned_at": "2026-11-23T18:04:05.123456Z",
"activated_at": null
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Assign a number to an approved campaign.
Costs nothing and may be repeated: assigning a number to the campaign
it is already in changes nothing. The carrier is asked once to map
the number to the campaign; sms.enabled becomes true when it
confirms, usually within minutes. Poll GET.
422 unprocessable with details.reason campaign_not_found or
campaign_not_approved. 409 conflict when the number is in
another campaign: a number cannot be moved between campaigns.
Required permission: numbers:write. Accepted credentials: a signed-in person, an API key, the account token.
PUT
/
numbers
/
{phone_number}
/
campaign
Assign a number to an approved campaign.
curl --request PUT \
--url https://omni-api.sendblue.com/numbers/{phone_number}/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_id": "MG0123456789abcdef0123456789abcdef"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaign_id: 'MG0123456789abcdef0123456789abcdef'})
};
fetch('https://omni-api.sendblue.com/numbers/{phone_number}/campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/numbers/{phone_number}/campaign"
payload = { "campaign_id": "MG0123456789abcdef0123456789abcdef" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"phone_number": "+14155550100",
"campaign_id": "MG0123456789abcdef0123456789abcdef",
"sms": {
"enabled": false,
"blocked_reason": "carrier_assignment_pending"
},
"assigned_at": "2026-11-23T18:04:05.123456Z",
"activated_at": null
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Authorizations
personbearerlegacyKeyId & legacyKeySecret
Path Parameters
Response
The number's campaign and messaging state.
A number's campaign, and whether it may send SMS and MMS now.