Connected accounts API
Connected accounts of the built-in connectors: add, test, switch on or off.
Endpoints
/api/v1/connectorAccounts/searchConnectorsWhich connectors can be added today: the ready-made vendor connectors that work and every built-in one, searched by name. Optional param "query" (part of the name). Returns up to 50 connectors. Each connector is { name, provider, auth: "sign-in" | "own-app" | "key" | "none", verified, aiCanAddNow, howToConnect }: auth is how the person connects it ("own-app": with their own developer app at that service, its Client ID and Client Secret pasted in the connect form); verified means a real sign-in or a passed key check proved it; aiCanAddNow is true when you can add it yourself, for a person who may add connectors (a built-in with a key: connectorAccounts_create with connector set to the row's name; a ready-made one with a key or nothing to enter: site_addMcpConnection with its presetId, the person types any key on a card; one with a sign-in: site_initMcpOAuth, you start it and the person finishes the sign-in); howToConnect is the exact steps for the person, or why they may not add it and whom to ask. When aiCanAddNow is false, say plainly that you cannot add that one yet and give its howToConnect; never tell the person a connector is connected unless connectorAccounts_create, connectorAccounts_test or site_addMcpConnection answered it. Use it before telling someone a service can be connected; anything not listed cannot be added today (they can still add any MCP server by URL as a Custom connector under More → Connectors), and a connection they already have keeps working.
Parameters
query | string |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/searchConnectors \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"query": "example"
}'/api/v1/connectorAccounts/createConnect a new app account. Params: connector (the built-in's name exactly as a row of connectorAccounts_searchConnectors shows it, for a row whose aiCanAddNow is true and auth is "key"; or mcpServerId when you already have its id, never both), connectionName (required), credentials (optional: leave it out and the person types the connector's secret keys on a secure card; send only the keys the connector says are not secret, such as a site address).
Parameters
mcpServerId | string | |
connector | string | |
connectionName | stringrequired | |
credentials | objectrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/create \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"mcpServerId": "example",
"connector": "example",
"connectionName": "example"
}'/api/v1/connectorAccounts/listList connected app accounts (OAuth integrations). Optional param "mcpServerId" to filter. Returns accounts with connection status and mayManage (true when you may change, switch on or off, or remove it; when false the server refuses, so say so and do not retry).
Parameters
mcpServerId | string |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/list \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"mcpServerId": "example"
}'/api/v1/connectorAccounts/getByIdGet one app account (connection) with its MCP server and agent links. Param "appAccountId". Credentials are never returned — only non-sensitive auth metadata (authType, key location/name, username). Also mayManage: true when you may change, switch on or off, or remove it; when false the server refuses, so say so and do not retry.
Parameters
appAccountId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/getById \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"appAccountId": "example"
}'/api/v1/connectorAccounts/deleteDisconnect an app account. Param "appAccountId". Act only on what the person named or picked.
Parameters
appAccountId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/delete \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"appAccountId": "example"
}'/api/v1/connectorAccounts/toggleActiveSwitch one connected account on or off. Params: appAccountId (from list), isActive (true = on, false = off). Off pauses every use of it (the AI chat, agents, functions and flows can no longer run its tools) until it is switched on again; nothing is removed and its saved sign-in is kept. Returns { id, connectionName, isActive, testStatus, createdAt, updatedAt }.
Parameters
appAccountId | stringrequired | |
isActive | booleanrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/toggleActive \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"appAccountId": "example",
"isActive": true
}'/api/v1/connectorAccounts/testCheck that a connected account still signs in: tries its SAVED sign-in against its service and records the result (testStatus). Param: appAccountId (from list); nothing else is sent or needed, and the sign-in is never shown. Returns { success }: true when the service accepted it, false when it did not; when the service gave a reason, { error } carries it (with anything that quotes the sign-in hidden). Use it after a person reports a connector stopped working.
Parameters
appAccountId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/test \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"appAccountId": "example"
}'/api/v1/connectorAccounts/switchToolOffTurn ONE tool of a connected account OFF; it never turns a tool on (turning a tool on is a person's, in the dashboard). Params: appAccountId (from list), toolName (exactly as the connection lists its tools). Off means the AI chat, agents, functions and flows can no longer run that tool of the connection; a flow step that uses it stops at its next run. Asking again for a tool that is already off answers the same success and changes nothing; a name the connection has no tool of is refused and nothing is changed. Returns { id, toolName, enabled: false }.
Parameters
appAccountId | stringrequired | |
toolName | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/connectorAccounts/switchToolOff \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"appAccountId": "example",
"toolName": "example"
}'