Skip to content

Update Sub-Account Channels

Set which channels a sub-account can use, and how many of each.

PUT  /api/webhooks/agency/:agency_key/sub-accounts/:ref/channels
POST /api/webhooks/agency/:agency_key/sub-accounts/:ref/channels

Both forms are identical. The POST alias exists for tools that cannot send PUT with a body.

Authentication

Requires a Bearer token with the sub_account.channels scope. See Agency Inbound API.

Path Parameters

ParameterTypeDescription
refstringSub-account UUID, or ext:<external_ref>

Request Body

FieldTypeRequiredDescription
channelsobjectYesThe desired final state of every channel

channels Object

FieldTypeDescription
linkedinnumberLinkedIn accounts allowed (0–100)
whatsappnumberWhatsApp numbers allowed (0–100)
instagramnumberInstagram accounts allowed (0–100)
email_marketingnumberEmail sending domains allowed (0–100)

The object is declarative

channels is the final state, not a delta. A channel you omit is set to zero and disabled. To raise LinkedIn while keeping WhatsApp, send both.

Non-channel modules — CRM, campaigns, academy — are never touched by this call.

Raising the total number of billable channels charges your agency immediately, pro-rata to the end of the current cycle, on the card on file. If the charge is declined, nothing is applied and the call returns 402 SEAT_CHARGE_FAILED. Lowering the count does not generate a credit.

Response

json
{
  "ok": true,
  "event_id": "7c1e9a44-3f7b-4d1b-8f2e-6c5a1b0d9e83",
  "data": {
    "id": "a1b2c3d4-5678-4e9f-a0b1-c2d3e4f5a6b7",
    "channels": {
      "linkedin": 3,
      "whatsapp": 1,
      "instagram": 0,
      "email_marketing": 0
    },
    "delta_channels": 1,
    "seat_charge": {
      "ok": true,
      "paid": true,
      "chargedCents": 2450,
      "addedChannels": 1
    }
  }
}

delta_channels is the change in billable channels. seat_charge is null when nothing was charged.

Example

cURL

bash
curl --request PUT \
  --url "https://api.getraze.co/api/webhooks/agency/AGENCY_KEY/sub-accounts/ext:client-42/channels" \
  --header "Authorization: Bearer YOUR_TOKEN" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $(uuidgen)" \
  --data '{
    "channels": { "linkedin": 3, "whatsapp": 1 }
  }'

JavaScript

javascript
const response = await fetch(
  `https://api.getraze.co/api/webhooks/agency/${agencyKey}/sub-accounts/ext:client-42/channels`,
  {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json',
      'Idempotency-Key': crypto.randomUUID()
    },
    body: JSON.stringify({
      channels: { linkedin: 3, whatsapp: 1 }
    })
  }
);
const data = await response.json();

Python

python
import requests, uuid

response = requests.put(
    f'https://api.getraze.co/api/webhooks/agency/{agency_key}/sub-accounts/ext:client-42/channels',
    headers={
        'Authorization': f'Bearer {token}',
        'Idempotency-Key': str(uuid.uuid4())
    },
    json={'channels': {'linkedin': 3, 'whatsapp': 1}}
)
data = response.json()

Errors

StatusCodeDescription
400MISSING_FIELDSchannels is absent
400INVALID_CHANNELSUnknown channel, or a value outside 0–100
401UNAUTHORIZEDMissing, unknown or revoked token
402SEAT_CHARGE_FAILEDThe pro-rata charge was declined; no change was applied
403INVALID_SCOPEToken lacks sub_account.channels
403SUB_ACCOUNT_FORBIDDENThe sub-account belongs to another agency
404SUB_ACCOUNT_NOT_FOUNDNo live sub-account for that reference
409TRIAL_CHANNEL_LOCKEDDuring the free trial only WhatsApp is available

GetRaze - AI-Powered Lead Generation