AgentMessage
Guardrails

Replace a guardrail pool's members

PUT
/v1/guardrails/pools/{id}/members

Replaces a pool's membership with exactly the supplied set of phone number ids. After the call the pool contains precisely those numbers: ids not already in the pool are added, ids currently in the pool but not in the set are removed, and an id currently in a different pool is moved atomically (a number belongs to at most one pool).

Each number added or moved in must resolve to the pool's brand (a number carries its brand transitively through its campaign). A number with no campaign, or one whose brand differs from the pool's, is rejected with 422 VALIDATION_FAILED. Duplicate ids, an oversized set (more than 1000), or an unknown/cross-org number also return 422 / 404.

Requires the org:admin:write scope.

AuthorizationBearer <token>

Authenticate by sending your API key as a bearer token: Authorization: Bearer am_live_.... Every request is automatically scoped to the organization that owns the key and to the scopes granted to that key.

In: header

Path Parameters

id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/guardrails/pools/497f6eca-6276-4993-bfeb-53cbbbba6f08/members" \  -H "Content-Type: application/json" \  -d '{    "phone_number_ids": [      "afa86924-db4e-46c3-990b-64ea2b33d075"    ]  }'
{
  "success": true,
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string",
    "details": {
      "property1": "string",
      "property2": "string"
    }
  },
  "meta": {
    "total": 0,
    "limit": 0,
    "offset": 0,
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNC0yNlQxMjowMDowMFoiLCJpZCI6IjAxOTAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMSJ9",
    "last_event_at": "2019-08-24T14:15:22Z"
  },
  "data": [
    {
      "pool_id": "bd9ee216-b2f2-496a-bbe1-31b86a2c3c43",
      "phone_number_id": "54afc7b8-17df-415a-9fb0-21ee66219576",
      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
      "added_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "authentication failed",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}
{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "missing required scope",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "not found",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}
{
  "success": false,
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "validation failed",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM",
    "details": {
      "to": "must be E.164",
      "body": "must be 1..1600 chars"
    }
  }
}