WhatsApp · Business Agent

Set connector credentials

Sets connector credentials.

POSThttps://api.pozy.ai/v1/accounts/{accountId}/business-agent/connectors/{connectorId}/credentials
setBusinessAgentConnectorCredentials

Guide: Business AI agent

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the messages resource group disabled get 403 resource_group_disabled. Authentication

Path parameters

NameTypeNotes
accountIdrequiredstring
connectorIdrequiredstring

Request body

application/json, required

Free-form JSON object.

Example

curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/connectors/621ec5581aee08ee5f23dcde/credentials" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "api_key",
  "api_key_config": {
    "headers": [
      {
        "field_name": "Acme",
        "value": "string"
      }
    ],
    "query_params": [
      {
        "field_name": "Acme",
        "value": "string"
      }
    ],
    "body_params": [
      {
        "field_name": "Acme",
        "value": "string"
      }
    ]
  }
}'

Response

200 on success

  • namestringrequired
  • descriptionstring
  • base_urlstring (URL)required
  • connector_protocolstring
  • auth_typestringrequired

    One of OAUTH2_CLIENT_CREDENTIALS, API_KEY, NONE.

  • auth_configobject
    • oauth2_client_credentialsobject
      5 child fields
      • token_urlstring (URL)required
      • scopes_to_requestarray of string
      • token_request_content_typestring
      • client_idstringrequired
      • client_secretstringrequired
    • api_keyobject
      3 child fields
      • headersarray of object
        3 child fields
        • field_namestringrequired
        • valuestringrequired
        • prefixstring
      • query_paramsarray of object
        3 child fields
        • field_namestringrequired
        • valuestringrequired
        • prefixstring
      • body_paramsarray of object
        3 child fields
        • field_namestringrequired
        • valuestringrequired
        • prefixstring
  • user_auth_injection_configobject
    • locationstringrequired
    • field_namestringrequired
    • prefixstring
  • requires_certificateboolean
  • idstringrequired
  • mcp_tool_syncobject
  • mtls_configobject
  • connection_statusobject
    • statusstring
    • error_messagestring
200 response
{
  "name": "Acme",
  "description": "A short description",
  "base_url": "https://pozy.ai/media/example-1.jpg",
  "connector_protocol": "string",
  "auth_type": "OAUTH2_CLIENT_CREDENTIALS",
  "auth_config": {
    "oauth2_client_credentials": {
      "token_url": "https://pozy.ai/media/example-1.jpg",
      "scopes_to_request": [
        "string"
      ],
      "token_request_content_type": "Hello from Pozy",
      "client_id": "6d8e8e36f9a9b90298b622ef",
      "client_secret": "string"
    },
    "api_key": {
      "headers": [
        {
          "field_name": "Acme",
          "value": "string",
          "prefix": "string"
        }
      ],
      "query_params": [
        {
          "field_name": "Acme",
          "value": "string",
          "prefix": "string"
        }
      ],
      "body_params": [
        {
          "field_name": "Acme",
          "value": "string",
          "prefix": "string"
        }
      ]
    }
  },
  "user_auth_injection_config": {
    "location": "string",
    "field_name": "Acme",
    "prefix": "string"
  },
  "requires_certificate": true,
  "id": "6bfebd43ddc270f6d2c56fc5",
  "mcp_tool_sync": {},
  "mtls_config": {},
  "connection_status": {
    "status": "active",
    "error_message": "Hello from Pozy"
  }
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Business Agent