Execute proxy request within a tool router session
Execute any native API call on a toolkit with authentication automatically injected from Composio. This endpoint proxies HTTP requests to third-party APIs using connected account credentials resolved from the session context. Provide the toolkit slug, API endpoint, and HTTP method — Composio handles authentication injection, abstracting away credential management. Supports all HTTP methods, custom headers/query parameters, and binary request/response bodies.
import requests
url = "https://backend.composio.dev/api/v3/tool_router/session/{session_id}/proxy_execute"
payload = {
"toolkit_slug": "gmail",
"endpoint": "/api/v1/resources",
"method": "GET",
"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({
toolkit_slug: 'gmail',
endpoint: '/api/v1/resources',
method: 'GET',
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/tool_router/session/{session_id}/proxy_execute', 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/tool_router/session/{session_id}/proxy_execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"toolkit_slug": "gmail",
"endpoint": "/api/v1/resources",
"method": "GET",
"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/tool_router/session/{session_id}/proxy_execute"
payload := strings.NewReader("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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/tool_router/session/{session_id}/proxy_execute")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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/tool_router/session/{session_id}/proxy_execute");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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{
"result_type": "completed",
"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"
},
"hook_results": [
{
"id": "<string>",
"status": "evaluated",
"outcome": "continue"
}
]
}{
"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>"
]
}
}{
"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
Path Parameters
Tool router session ID (required for public API, optional for internal - injected by middleware) The unique identifier of the tool router session. Required for public API endpoints, optional for internal endpoints where it is injected by middleware.
"trs_LX9uJKBinWWr"
Body
Response
Successfully executed proxy request and received response
- Option 1
- Option 2
- Option 3
import requests
url = "https://backend.composio.dev/api/v3/tool_router/session/{session_id}/proxy_execute"
payload = {
"toolkit_slug": "gmail",
"endpoint": "/api/v1/resources",
"method": "GET",
"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({
toolkit_slug: 'gmail',
endpoint: '/api/v1/resources',
method: 'GET',
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/tool_router/session/{session_id}/proxy_execute', 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/tool_router/session/{session_id}/proxy_execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"toolkit_slug": "gmail",
"endpoint": "/api/v1/resources",
"method": "GET",
"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/tool_router/session/{session_id}/proxy_execute"
payload := strings.NewReader("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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/tool_router/session/{session_id}/proxy_execute")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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/tool_router/session/{session_id}/proxy_execute");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"toolkit_slug\": \"gmail\",\n \"endpoint\": \"/api/v1/resources\",\n \"method\": \"GET\",\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{
"result_type": "completed",
"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"
},
"hook_results": [
{
"id": "<string>",
"status": "evaluated",
"outcome": "continue"
}
]
}{
"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>"
]
}
}{
"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>"
]
}
}