Operations
Operations

Set client spending limit

Set how much one client of an agency may spend in a calendar month (UTC). limitCents is the limit in cents, from 1000 ($10) to 1000000 ($10,000); null removes the limit. At the limit the client's tests, Builder, website chat and campaigns stop until the next month or a higher limit, and calls in progress finish. Incoming phone calls keep being answered unless blockCallsAtLimit is true. The agency is emailed at 80% and 100% of the limit. Both values are saved together, so pass both every time. list_clients shows each client's current spend and limit. Only works on an agency account, for an owner or admin of the agency.

POST
/operations/set_client_spend_limit

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Header Parameters

Idempotency-Key?string

A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/operations/set_client_spend_limit" \  -H "Content-Type: application/json" \  -d '{    "workspace": "string",    "client": "string",    "limitCents": -9007199254740991,    "blockCallsAtLimit": true  }'
{}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}

Set client pricing POST

Set what an agency charges one of its clients. It never changes what the platform charges the agency. mode picks how the client is billed: per_minute charges minuteRateCents for every call minute; monthly_overage charges monthlyFeeCents a month, which covers includedMinutes call minutes, then minuteRateCents for each minute past them; monthly_capped charges monthlyFeeCents a month for includedMinutes call minutes and nothing past them; none removes the client's pricing. A call is rounded up to the next minute. textRateCents and chatRateCents charge per text and per website chat conversation, and 0 means not charged. numberChargeCents is a monthly amount per phone number, and null means the number is included in the price. All amounts are in cents. Every value is saved together, so pass the full pricing every time. list_clients shows each client's current pricing. Only works on an agency account, for an owner or admin of the agency.

Set closed message POST

Write and render the message the agent speaks when a call arrives outside answering hours. Agent-level, NOT versioned. Pass exactly one of text (the exact words to save) or generate: true (draft it from the agent's persona + its stored schedule). Either way this ALWAYS renders the clip in the agent's current voice and saves it, a saved-but-unrendered message is what publish blocks on, so this op never leaves one behind. Call this BEFORE set_answering_hours enabled: true, turning answering hours on with no message is refused.