Create a new connected account
Initiates a new connection to an external service for a user. For OAuth-based toolkits, this returns a redirect URL to complete authentication. For API key-based toolkits, provide the credentials directly in the request body. Use the user_id field to associate the connection with a specific user in your system.
Deprecated for Composio-managed OAuth: For Composio-managed auth configs on OAuth1, OAuth2, or DCR_OAUTH schemes, this endpoint is being retired and will start returning 400 BadRequest on 2026-05-08 for new organizations and 2026-07-03 for all remaining organizations. Migrate those calls to POST /api/v3/connected_accounts/link. Custom auth configs and non-OAuth schemes (API key, bearer, basic) continue to be supported here. Responses on the retiring path carry a Deprecation header (RFC 9745) and a Sunset header (RFC 8594) for client-side detection.
Credential check: where the toolkit supports it, submitted API key, basic, and bearer credentials are checked against the provider before the connection is stored — no opt-in required. For toolkits with the check enabled, credentials the provider rejects fail the request with ConnectedAccount_CredentialValidationRejected. If the provider is unreachable, times out, or returns an error of its own, the connection is created as normal.
import requests
url = "https://backend.composio.dev/api/v3/connected_accounts"
payload = {
"auth_config": { "id": "<string>" },
"connection": {
"data": {},
"user_id": "default",
"alias": "<string>",
"callback_url": "<string>",
"redirect_uri": "<string>",
"deprecated_is_v1_rerouted": False,
"experimental": { "acl_config_for_shared": {
"allow_all_users": True,
"allowed_user_ids": ["<string>"],
"not_allowed_user_ids": ["<string>"]
} }
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_config: {id: '<string>'},
connection: {
data: {},
user_id: 'default',
alias: '<string>',
callback_url: '<string>',
redirect_uri: '<string>',
deprecated_is_v1_rerouted: false,
experimental: {
acl_config_for_shared: {
allow_all_users: true,
allowed_user_ids: ['<string>'],
not_allowed_user_ids: ['<string>']
}
}
}
})
};
fetch('https://backend.composio.dev/api/v3/connected_accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://backend.composio.dev/api/v3/connected_accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"auth_config": {
"id": "<string>"
},
"connection": {
"data": {},
"user_id": "default",
"alias": "<string>",
"callback_url": "<string>",
"redirect_uri": "<string>",
"deprecated_is_v1_rerouted": false,
"experimental": {
"acl_config_for_shared": {
"allow_all_users": true,
"allowed_user_ids": [
"<string>"
],
"not_allowed_user_ids": [
"<string>"
]
}
}
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3/connected_accounts"
payload := strings.NewReader("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://backend.composio.dev/api/v3/connected_accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3/connected_accounts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"id": "<string>",
"connectionData": {
"authScheme": "OAUTH1",
"val": {
"status": "INITIALIZING",
"subdomain": "<string>",
"your-domain": "<string>",
"region": "<string>",
"shop": "<string>",
"account_url": "<string>",
"COMPANYDOMAIN": "<string>",
"extension": "<string>",
"form_api_base_url": "<string>",
"instanceEndpoint": "<string>",
"api_url": "<string>",
"borneo_dashboard_url": "<string>",
"proxy_username": "<string>",
"proxy_password": "<string>",
"domain": "<string>",
"version": "<string>",
"dc": "<string>",
"site_name": "<string>",
"instanceName": "<string>",
"account_id": "<string>",
"your_server": "<string>",
"server_location": "<string>",
"base_url": "<string>",
"displayName": "<string>",
"oauth_token": "<string>",
"authUri": "<string>",
"oauth_token_secret": "<string>",
"redirectUrl": "<string>",
"callbackUrl": "<string>",
"oauth_verifier": "<string>",
"consumer_key": "<string>",
"callback_url": "<string>",
"error": "<string>",
"error_description": "<string>",
"expired_at": "<string>"
}
},
"status": "INITIALIZING",
"redirect_url": "<string>",
"redirect_uri": "<string>",
"experimental": {
"account_type": "PRIVATE",
"acl_config_for_shared": {
"allow_all_users": true,
"allowed_user_ids": [
"<string>"
],
"not_allowed_user_ids": [
"<string>"
]
}
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}Authorizations
Body
Response
Successfully created connected account
import requests
url = "https://backend.composio.dev/api/v3/connected_accounts"
payload = {
"auth_config": { "id": "<string>" },
"connection": {
"data": {},
"user_id": "default",
"alias": "<string>",
"callback_url": "<string>",
"redirect_uri": "<string>",
"deprecated_is_v1_rerouted": False,
"experimental": { "acl_config_for_shared": {
"allow_all_users": True,
"allowed_user_ids": ["<string>"],
"not_allowed_user_ids": ["<string>"]
} }
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_config: {id: '<string>'},
connection: {
data: {},
user_id: 'default',
alias: '<string>',
callback_url: '<string>',
redirect_uri: '<string>',
deprecated_is_v1_rerouted: false,
experimental: {
acl_config_for_shared: {
allow_all_users: true,
allowed_user_ids: ['<string>'],
not_allowed_user_ids: ['<string>']
}
}
}
})
};
fetch('https://backend.composio.dev/api/v3/connected_accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://backend.composio.dev/api/v3/connected_accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"auth_config": {
"id": "<string>"
},
"connection": {
"data": {},
"user_id": "default",
"alias": "<string>",
"callback_url": "<string>",
"redirect_uri": "<string>",
"deprecated_is_v1_rerouted": false,
"experimental": {
"acl_config_for_shared": {
"allow_all_users": true,
"allowed_user_ids": [
"<string>"
],
"not_allowed_user_ids": [
"<string>"
]
}
}
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3/connected_accounts"
payload := strings.NewReader("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://backend.composio.dev/api/v3/connected_accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3/connected_accounts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"auth_config\": {\n \"id\": \"<string>\"\n },\n \"connection\": {\n \"data\": {},\n \"user_id\": \"default\",\n \"alias\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"deprecated_is_v1_rerouted\": false,\n \"experimental\": {\n \"acl_config_for_shared\": {\n \"allow_all_users\": true,\n \"allowed_user_ids\": [\n \"<string>\"\n ],\n \"not_allowed_user_ids\": [\n \"<string>\"\n ]\n }\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"id": "<string>",
"connectionData": {
"authScheme": "OAUTH1",
"val": {
"status": "INITIALIZING",
"subdomain": "<string>",
"your-domain": "<string>",
"region": "<string>",
"shop": "<string>",
"account_url": "<string>",
"COMPANYDOMAIN": "<string>",
"extension": "<string>",
"form_api_base_url": "<string>",
"instanceEndpoint": "<string>",
"api_url": "<string>",
"borneo_dashboard_url": "<string>",
"proxy_username": "<string>",
"proxy_password": "<string>",
"domain": "<string>",
"version": "<string>",
"dc": "<string>",
"site_name": "<string>",
"instanceName": "<string>",
"account_id": "<string>",
"your_server": "<string>",
"server_location": "<string>",
"base_url": "<string>",
"displayName": "<string>",
"oauth_token": "<string>",
"authUri": "<string>",
"oauth_token_secret": "<string>",
"redirectUrl": "<string>",
"callbackUrl": "<string>",
"oauth_verifier": "<string>",
"consumer_key": "<string>",
"callback_url": "<string>",
"error": "<string>",
"error_description": "<string>",
"expired_at": "<string>"
}
},
"status": "INITIALIZING",
"redirect_url": "<string>",
"redirect_uri": "<string>",
"experimental": {
"account_type": "PRIVATE",
"acl_config_for_shared": {
"allow_all_users": true,
"allowed_user_ids": [
"<string>"
],
"not_allowed_user_ids": [
"<string>"
]
}
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}