Tools
Execute proxy request
Proxy an HTTP request to a third-party API using connected account credentials. This endpoint allows making authenticated API calls to external services while abstracting away authentication details.
POST
/
api
/
v3.1
/
tools
/
execute
/
proxy
Execute proxy request
import requests
url = "https://backend.composio.dev/api/v3.1/tools/execute/proxy"
payload = {
"endpoint": "/api/v1/resources",
"method": "GET",
"connected_account_id": "ca_1a2b3c4d5e6f",
"user_id": "user_4567",
"body": {
"name": "New Resource",
"description": "This is a new resource"
},
"binary_body": {
"url": "<string>",
"content_type": "<string>"
},
"parameters": [
{
"name": "x-api-key",
"value": "abc123def456",
"type": "header"
},
{
"name": "filter",
"value": "active",
"type": "query"
}
]
}
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({
endpoint: '/api/v1/resources',
method: 'GET',
connected_account_id: 'ca_1a2b3c4d5e6f',
user_id: 'user_4567',
body: JSON.stringify({name: 'New Resource', description: 'This is a new resource'}),
binary_body: {url: '<string>', content_type: '<string>'},
parameters: [
{name: 'x-api-key', value: 'abc123def456', type: 'header'},
{name: 'filter', value: 'active', type: 'query'}
]
})
};
fetch('https://backend.composio.dev/api/v3.1/tools/execute/proxy', 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/tools/execute/proxy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"endpoint": "/api/v1/resources",
"method": "GET",
"connected_account_id": "ca_1a2b3c4d5e6f",
"user_id": "user_4567",
"body": {
"name": "New Resource",
"description": "This is a new resource"
},
"binary_body": {
"url": "<string>",
"content_type": "<string>"
},
"parameters": [
{
"name": "x-api-key",
"value": "abc123def456",
"type": "header"
},
{
"name": "filter",
"value": "active",
"type": "query"
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/tools/execute/proxy"
payload := strings.NewReader("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\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.1/tools/execute/proxy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\n }\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/tools/execute/proxy");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"status": 200,
"data": {
"id": "123",
"name": "Resource Name",
"created_at": "2023-01-01T00:00:00Z"
},
"binary_data": {
"url": "<string>",
"content_type": "<string>",
"size": 123,
"expires_at": "<string>"
},
"headers": {
"content-type": "application/json",
"cache-control": "no-cache",
"host": "api.example.com"
}
}{
"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>"
]
}
}{
"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
The user id (entity id) acting on connected_account_id. Required for a SHARED connection, where it is checked against the connection's ACL. When the project has 2FA enabled, it is also validated against the owner of a PRIVATE connection. Also selects which custom toolkits the request may use.
Example:
"user_4567"
Response
Successfully executed proxy request and received response
Execute proxy request
import requests
url = "https://backend.composio.dev/api/v3.1/tools/execute/proxy"
payload = {
"endpoint": "/api/v1/resources",
"method": "GET",
"connected_account_id": "ca_1a2b3c4d5e6f",
"user_id": "user_4567",
"body": {
"name": "New Resource",
"description": "This is a new resource"
},
"binary_body": {
"url": "<string>",
"content_type": "<string>"
},
"parameters": [
{
"name": "x-api-key",
"value": "abc123def456",
"type": "header"
},
{
"name": "filter",
"value": "active",
"type": "query"
}
]
}
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({
endpoint: '/api/v1/resources',
method: 'GET',
connected_account_id: 'ca_1a2b3c4d5e6f',
user_id: 'user_4567',
body: JSON.stringify({name: 'New Resource', description: 'This is a new resource'}),
binary_body: {url: '<string>', content_type: '<string>'},
parameters: [
{name: 'x-api-key', value: 'abc123def456', type: 'header'},
{name: 'filter', value: 'active', type: 'query'}
]
})
};
fetch('https://backend.composio.dev/api/v3.1/tools/execute/proxy', 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/tools/execute/proxy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"endpoint": "/api/v1/resources",
"method": "GET",
"connected_account_id": "ca_1a2b3c4d5e6f",
"user_id": "user_4567",
"body": {
"name": "New Resource",
"description": "This is a new resource"
},
"binary_body": {
"url": "<string>",
"content_type": "<string>"
},
"parameters": [
{
"name": "x-api-key",
"value": "abc123def456",
"type": "header"
},
{
"name": "filter",
"value": "active",
"type": "query"
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/tools/execute/proxy"
payload := strings.NewReader("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\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.1/tools/execute/proxy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\n }\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/tools/execute/proxy");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\n \"connected_account_id\": \"ca_1a2b3c4d5e6f\",\n \"user_id\": \"user_4567\",\n \"body\": {\n \"name\": \"New Resource\",\n \"description\": \"This is a new resource\"\n },\n \"binary_body\": {\n \"url\": \"<string>\",\n \"content_type\": \"<string>\"\n },\n \"parameters\": [\n {\n \"name\": \"x-api-key\",\n \"value\": \"abc123def456\",\n \"type\": \"header\"\n },\n {\n \"name\": \"filter\",\n \"value\": \"active\",\n \"type\": \"query\"\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"status": 200,
"data": {
"id": "123",
"name": "Resource Name",
"created_at": "2023-01-01T00:00:00Z"
},
"binary_data": {
"url": "<string>",
"content_type": "<string>",
"size": 123,
"expires_at": "<string>"
},
"headers": {
"content-type": "application/json",
"cache-control": "no-cache",
"host": "api.example.com"
}
}{
"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>"
]
}
}{
"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>"
]
}
}