---
title: "Set connector credentials"
method: POST
path: "/v1/accounts/{accountId}/business-agent/connectors/{connectorId}/credentials"
tags: ["Business Agent"]
---

# Set connector credentials

`POST /v1/accounts/{accountId}/business-agent/connectors/{connectorId}/credentials`

Set or rotate the connector's credentials in place: `kind: api_key`, `kind: oauth`
(client credentials) or `kind: certificate` (mTLS client certificate). Meta has no call
that removes a credential layer; change the connector's `auth_type` or delete it instead.

## Path parameters

- `accountId` string, required
- `connectorId` string, required

## Request body

- union
  - object
    - `kind` 'api_key', required
    - `api_key_config` BusinessAgentApiKeyConfig, required — Where the connector injects the API key on each call.
      - `headers` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
      - `query_params` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
      - `body_params` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
  - object
    - `kind` 'oauth', required
    - `oauth_config` BusinessAgentOAuthClientCredentials, required
      - `token_url` string, uri, required
      - `scopes_to_request` string[]
      - `token_request_content_type` string
      - `client_id` string, required
      - `client_secret` string, required
  - object
    - `kind` 'certificate', required
    - `client_certificate` string, required — PEM.
    - `client_key` string, required — PEM.
    - `ca_certificate` string — PEM.

## Response `200`

Connector with the new credential metadata

- BusinessAgentConnector
  - `name` string, required — Unique per number.
  - `description` string — Tell the agent what the service provides.
  - `base_url` string, uri, required — Public HTTPS URL reachable from Meta.
  - `connector_protocol` string
  - `auth_type` 'OAUTH2_CLIENT_CREDENTIALS' | 'API_KEY' | 'NONE', required
  - `auth_config` object
    - `oauth2_client_credentials` BusinessAgentOAuthClientCredentials
      - `token_url` string, uri, required
      - `scopes_to_request` string[]
      - `token_request_content_type` string
      - `client_id` string, required
      - `client_secret` string, required
    - `api_key` BusinessAgentApiKeyConfig — Where the connector injects the API key on each call.
      - `headers` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
      - `query_params` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
      - `body_params` object[]
        - `field_name` string, required
        - `value` string, required
        - `prefix` string
  - `user_auth_injection_config` object
    - `location` string, required
    - `field_name` string, required
    - `prefix` string
  - `requires_certificate` boolean
  - `id` string, required
  - `mcp_tool_sync` object
  - `mtls_config` object
  - `connection_status` object
    - `status` string — ACTIVE, PENDING_OAUTH, EXPIRED or ERROR.
    - `error_message` string

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Inbox add-on required, the WhatsApp token lacks the Business Agent permissions (code reconnect_required), or the merchant has not accepted the Meta Business Agent terms in WhatsApp Manager (code business_agent_terms_not_accepted).
- `404` — Account not found, or no agent exists on the number yet or the referenced item does not exist (code business_agent_not_found).

## Changes

- **2026-09-25** `2c04683ce694` — 12 info
  - added the optional property `details/adAccountId` to the response with the `400` status
  - added the optional property `details/adAccountId` to the response with the `403` status
  - added the optional property `details/adAccountId` to the response with the `404` status
  - added the optional property `details/createdObjects` to the response with the `400` status
  - …8 more
- **2026-09-16** `3e6ddf2a99ea` — 3 info
  - added the optional property `details/budgetScope` to the response with the `400` status
  - added the optional property `details/budgetScope` to the response with the `403` status
  - added the optional property `details/budgetScope` to the response with the `404` status
- **2026-09-15** `0dba7d004d75` — 6 info
  - added the optional property `details/quotaExhausted` to the response with the `400` status
  - added the optional property `details/quotaExhausted` to the response with the `403` status
  - added the optional property `details/quotaExhausted` to the response with the `404` status
  - added the optional property `details/quotaScope` to the response with the `400` status
  - …2 more
- **2026-09-09** `41eff0cffb2d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/accounts/:accountId/business-agent/connectors/:connectorId/credentials/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) · [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/e0122970214f?raw)
