Set connector credentials
curl --request POST \
--url https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key_config": {
"headers": [
{
"field_name": "example",
"value": "example"
}
],
"query_params": [
{
"field_name": "example",
"value": "example"
}
]
},
"kind": "api_key"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials"
payload = {
"api_key_config": {
"headers": [
{
"field_name": "example",
"value": "example"
}
],
"query_params": [
{
"field_name": "example",
"value": "example"
}
]
},
"kind": "api_key"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key_config: {
headers: [{field_name: 'example', value: 'example'}],
query_params: [{field_name: 'example', value: 'example'}]
},
kind: 'api_key'
})
};
fetch('https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key_config' => [
'headers' => [
[
'field_name' => 'example',
'value' => 'example'
]
],
'query_params' => [
[
'field_name' => 'example',
'value' => 'example'
]
]
],
'kind' => 'api_key'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials"
payload := strings.NewReader("{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}"
response = http.request(request)
puts response.read_body{
"auth_type": "OAUTH2_CLIENT_CREDENTIALS",
"base_url": "<string>",
"name": "<string>",
"id": "<string>",
"auth_config": {
"api_key": {
"body_params": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"headers": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"query_params": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
]
},
"oauth2_client_credentials": {
"client_id": "<string>",
"client_secret": "<string>",
"token_url": "<string>",
"scopes_to_request": [
"<string>"
],
"token_request_content_type": "<string>"
}
},
"connector_protocol": "<string>",
"description": "<string>",
"requires_certificate": true,
"user_auth_injection_config": {
"field_name": "<string>",
"location": "<string>",
"prefix": "<string>"
},
"connection_status": {
"error_message": "<string>",
"status": "<string>"
},
"mcp_tool_sync": {},
"mtls_config": {}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}AIsa Messaging
Set connector credentials
Business Agent. 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.
A write: needs messaging:write and is audited.
POST
https://api.aisa.one
/
apis
/
v1
/
social
/
messaging
/
business-agent
/
connectors
/
{connectorId}
/
credentials
Set connector credentials
curl --request POST \
--url https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key_config": {
"headers": [
{
"field_name": "example",
"value": "example"
}
],
"query_params": [
{
"field_name": "example",
"value": "example"
}
]
},
"kind": "api_key"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials"
payload = {
"api_key_config": {
"headers": [
{
"field_name": "example",
"value": "example"
}
],
"query_params": [
{
"field_name": "example",
"value": "example"
}
]
},
"kind": "api_key"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key_config: {
headers: [{field_name: 'example', value: 'example'}],
query_params: [{field_name: 'example', value: 'example'}]
},
kind: 'api_key'
})
};
fetch('https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key_config' => [
'headers' => [
[
'field_name' => 'example',
'value' => 'example'
]
],
'query_params' => [
[
'field_name' => 'example',
'value' => 'example'
]
]
],
'kind' => 'api_key'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials"
payload := strings.NewReader("{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key_config\": {\n \"headers\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ],\n \"query_params\": [\n {\n \"field_name\": \"example\",\n \"value\": \"example\"\n }\n ]\n },\n \"kind\": \"api_key\"\n}"
response = http.request(request)
puts response.read_body{
"auth_type": "OAUTH2_CLIENT_CREDENTIALS",
"base_url": "<string>",
"name": "<string>",
"id": "<string>",
"auth_config": {
"api_key": {
"body_params": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"headers": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"query_params": [
{
"field_name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
]
},
"oauth2_client_credentials": {
"client_id": "<string>",
"client_secret": "<string>",
"token_url": "<string>",
"scopes_to_request": [
"<string>"
],
"token_request_content_type": "<string>"
}
},
"connector_protocol": "<string>",
"description": "<string>",
"requires_certificate": true,
"user_auth_injection_config": {
"field_name": "<string>",
"location": "<string>",
"prefix": "<string>"
},
"connection_status": {
"error_message": "<string>",
"status": "<string>"
},
"mcp_tool_sync": {},
"mtls_config": {}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: POST /apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials - connectorId: path; required
- connectionId: query; required
{
"operationId": "post_aisa_messaging_apis_v1_social_messaging_busi_0c65a5",
"method": "POST",
"path": "/apis/v1/social/messaging/business-agent/connectors/{connectorId}/credentials",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"in": "path",
"name": "connectorId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"api_key_config": {
"headers": [
{
"field_name": "example",
"value": "example"
}
],
"query_params": [
{
"field_name": "example",
"value": "example"
}
]
},
"kind": "api_key"
},
"schema": {
"oneOf": [
{
"properties": {
"api_key_config": {
"description": "Where the connector injects the API key on each call.",
"properties": {
"body_params": {
"items": {
"properties": {
"field_name": {
"type": "string"
},
"prefix": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"field_name",
"value"
],
"type": "object"
},
"type": "array"
},
"headers": {
"items": {
"properties": {
"field_name": {
"type": "string"
},
"prefix": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"field_name",
"value"
],
"type": "object"
},
"type": "array"
},
"query_params": {
"items": {
"properties": {
"field_name": {
"type": "string"
},
"prefix": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"field_name",
"value"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"connectionId": {
"description": "The connection, when not sent as the connectionId query parameter.",
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
},
"kind": {
"enum": [
"api_key"
],
"type": "string"
}
},
"required": [
"kind",
"api_key_config"
],
"type": "object"
},
{
"properties": {
"connectionId": {
"description": "The connection, when not sent as the connectionId query parameter.",
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
},
"kind": {
"enum": [
"oauth"
],
"type": "string"
},
"oauth_config": {
"properties": {
"client_id": {
"type": "string"
},
"client_secret": {
"type": "string"
},
"scopes_to_request": {
"items": {
"type": "string"
},
"type": "array"
},
"token_request_content_type": {
"type": "string"
},
"token_url": {
"format": "uri",
"type": "string"
}
},
"required": [
"token_url",
"client_id",
"client_secret"
],
"type": "object"
}
},
"required": [
"kind",
"oauth_config"
],
"type": "object"
},
{
"properties": {
"ca_certificate": {
"description": "PEM.",
"type": "string"
},
"client_certificate": {
"description": "PEM.",
"type": "string"
},
"client_key": {
"description": "PEM.",
"type": "string"
},
"connectionId": {
"description": "The connection, when not sent as the connectionId query parameter.",
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
},
"kind": {
"enum": [
"certificate"
],
"type": "string"
}
},
"required": [
"kind",
"client_certificate",
"client_key"
],
"type": "object"
}
]
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation.Authorizations
Query Parameters
Body
application/json
Response
Success