Connected Accounts
Complete a deferred OAuth connection after identity verification
Redeems a single-use session_uri handed to a project’s OAuth callback verifier. Composio validates that the caller’s project owns the pending connection and that user_id matches the connection owner, then completes the token exchange and returns the now-ACTIVE connected account. The session is single-use.
POST
/
api
/
v3.1
/
connected_accounts
/
complete_auth
Complete a deferred OAuth connection after identity verification
import requests
url = "https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth"
payload = {
"session_uri": "<string>",
"user_id": "<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({session_uri: '<string>', user_id: '<string>'})
};
fetch('https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth', 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.1/connected_accounts/complete_auth \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"session_uri": "<string>",
"user_id": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth"
payload := strings.NewReader("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\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.1/connected_accounts/complete_auth")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"connected_account_id": "<string>",
"toolkit_slug": "<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
application/json
Complete a deferred OAuth connection after identity verification
import requests
url = "https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth"
payload = {
"session_uri": "<string>",
"user_id": "<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({session_uri: '<string>', user_id: '<string>'})
};
fetch('https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth', 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.1/connected_accounts/complete_auth \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"session_uri": "<string>",
"user_id": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth"
payload := strings.NewReader("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\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.1/connected_accounts/complete_auth")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/connected_accounts/complete_auth");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"session_uri\": \"<string>\",\n \"user_id\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"connected_account_id": "<string>",
"toolkit_slug": "<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>"
]
}
}