WhatsApp · Business Agent
Creates a connector.
POST
https://api.pozy.ai/v1/accounts/{accountId}/business-agent/connectorscreateBusinessAgentConnector
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
| Name | Type | Notes |
|---|---|---|
accountIdrequired | string |
Request body
application/json, required
namestringrequireddescriptionstringbase_urlstring (URL)requiredconnector_protocolstringauth_typestringrequiredOne of
OAUTH2_CLIENT_CREDENTIALS,API_KEY,NONE.auth_configobjectoauth2_client_credentialsobject5 child fields
token_urlstring (URL)requiredscopes_to_requestarray of stringtoken_request_content_typestringclient_idstringrequiredclient_secretstringrequired
api_keyobject3 child fields
headersarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
query_paramsarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
body_paramsarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
user_auth_injection_configobjectlocationstringrequiredfield_namestringrequiredprefixstring
requires_certificateboolean
Example
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/connectors" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme",
"base_url": "https://pozy.ai/media/example-1.jpg",
"auth_type": "OAUTH2_CLIENT_CREDENTIALS"
}'const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/connectors", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Acme",
base_url: "https://pozy.ai/media/example-1.jpg",
auth_type: "OAUTH2_CLIENT_CREDENTIALS"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.post(
"https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/connectors",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"name": "Acme",
"base_url": "https://pozy.ai/media/example-1.jpg",
"auth_type": "OAUTH2_CLIENT_CREDENTIALS",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
201 on success
namestringrequireddescriptionstringbase_urlstring (URL)requiredconnector_protocolstringauth_typestringrequiredOne of
OAUTH2_CLIENT_CREDENTIALS,API_KEY,NONE.auth_configobjectoauth2_client_credentialsobject5 child fields
token_urlstring (URL)requiredscopes_to_requestarray of stringtoken_request_content_typestringclient_idstringrequiredclient_secretstringrequired
api_keyobject3 child fields
headersarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
query_paramsarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
body_paramsarray of object3 child fields
field_namestringrequiredvaluestringrequiredprefixstring
user_auth_injection_configobjectlocationstringrequiredfield_namestringrequiredprefixstring
requires_certificatebooleanidstringrequiredmcp_tool_syncobjectmtls_configobjectconnection_statusobjectstatusstringerror_messagestring
201 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:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 404 | not_found | Nothing with that id exists in your workspace. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.
More in Business Agent
GETGet agent setup statusPOSTCreate the agentGETList agent settingsPATCHUpdate agent settingsGETList allowlisted consumersPOSTAllowlist a consumerDELRemove an allowlisted consumerGETGet business informationPUTReplace business informationDELReset business informationGETList FAQsPOSTCreate a FAQGETGet a FAQPUTUpdate a FAQDELDelete a FAQGETList crawled websitesPOSTAdd a website to crawlGETGet a crawled websitePUTUpdate a crawled websiteDELRemove a crawled websiteGETList knowledge filesPOSTUpload a knowledge fileGETGet a knowledge fileDELDelete a knowledge fileGETList skillsPOSTCreate a skillGETGet a skillPUTUpdate a skillDELDelete a skillGETList UI skillsPOSTCreate a UI skillGETGet a UI skillPUTUpdate a UI skillDELDelete a UI skillGETList connectorsGETGet a connectorPUTUpdate a connectorDELDelete a connectorPOSTSet connector credentialsPOSTRefresh MCP connector toolsGETGet connector failure logsGETList connector toolsPOSTCreate a connector toolGETGet a connector toolPUTUpdate a connector toolDELDelete a connector toolPOSTRun a connector tool onceGETGet usage budgetsPUTReplace usage budgetsPOSTSend a test messagePOSTSend a business eventGETGet a business event statusGETRead evaluation dataPOSTStart an evaluation run