Assign a channel to an API key
/api-keys/{apiKey}/channels/{channel}Makes the API key the owner of a channel's line, so messages sent with that key can originate from it. This is the programmatic equivalent of assigning a number to a key on the dashboard Channels board.
The key becomes the number's sole owner: if another API key or integration owned it, that ownership is deprecated (and its hybrid mode re-evaluated). Assigning is idempotent — re-assigning a line the key already owns returns unchanged: true.
Only numbered, key-ownable channels can be assigned. Blooio lines are the primary case (Twilio where applicable); non-numbered channel types return 422 channel_not_assignable. On plans without number pools, a key may own at most one line (400).
Blooio Apps (OAuth) only. Requires the apikeys:manage scope. API-key and dashboard authentication are rejected with 403 oauth_token_required.
Path parameters
apiKeyRequiredstringThe API key value (prefixed with api_), as returned when the key was created or by the List API keys endpoint.
channelRequiredstringThe channel reference — the same three forms from accepts: a phone number (URL-encode + as %2B), a channel alias, or the exact channel id (ch_...).
Headers
AuthorizationRequiredstringYour API key, sent as a bearer token: Authorization: Bearer <api_key>. Editing this stays in sync with the API key box on the right.
Returns
dataoptionalApiKeyChannelAssignmentResult of assigning/unassigning a channel to an API key.
dataoptionalApiKeyChannelAssignmentResult of assigning/unassigning a channel to an API key.
api_keyoptionalstringchannel_idoptionalstringThe resolved channel id (ch_...) the line belongs to.
addressoptionalstringThe line in E.164 that was (un)assigned.
successoptionalbooleanreassignedoptionalbooleanPresent on assign: true when the line was taken from a previous owner.
unchangedoptionalbooleanPresent on assign: true when the key already owned the line (no-op).
Response codes
Sends a live request with your values and shows the real response below. Your key is stored only in this browser.
curl -X PUT https://api.blooio.com/v4/api-keys/sk_live_a1b2c3d4/channels/string \{ "data": { "api_key": "sk_live_a1b2c3d4", "channel_id": "ch_a1b2c3d4", "address": "123 Main St", "success": false, "reassigned": false, "unchanged": false }}