Tools
Get required scopes for tools (DEPRECATED)
deprecated
DEPRECATED: Use POST /api/v3.1/toolkits//scopes/recommended instead, discovering its grant_context options with GET /api/v3.1/toolkits//scopes/grant_context. Resolves required scopes for the specified tools at a given toolkit version. All requested tools must belong to the same toolkit. Returns the flat scope union plus per-tool structured scope requirements when available.
POST
/
api
/
v3.1
/
tools
/
scopes
/
required
Get required scopes for tools (DEPRECATED)
import requests
url = "https://backend.composio.dev/api/v3.1/tools/scopes/required"
payload = {
"tools": ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"],
"version": "latest"
}
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({tools: ['GMAIL_FETCH_EMAILS', 'GMAIL_SEND_EMAIL'], version: 'latest'})
};
fetch('https://backend.composio.dev/api/v3.1/tools/scopes/required', 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/scopes/required \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tools": [
"GMAIL_FETCH_EMAILS",
"GMAIL_SEND_EMAIL"
],
"version": "latest"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/tools/scopes/required"
payload := strings.NewReader("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\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/scopes/required")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/tools/scopes/required");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"scopes_required": [
"channels:read",
"chat:write",
"https://www.googleapis.com/auth/gmail.modify",
"repo",
"user:email"
],
"per_tool_requirements": [
{
"tool": "<string>",
"scope_requirements": {
"all_of": [
"<string>"
],
"source": [
"<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
Response
Successfully retrieved scopes for the specified tools
Get required scopes for tools (DEPRECATED)
import requests
url = "https://backend.composio.dev/api/v3.1/tools/scopes/required"
payload = {
"tools": ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"],
"version": "latest"
}
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({tools: ['GMAIL_FETCH_EMAILS', 'GMAIL_SEND_EMAIL'], version: 'latest'})
};
fetch('https://backend.composio.dev/api/v3.1/tools/scopes/required', 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/scopes/required \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tools": [
"GMAIL_FETCH_EMAILS",
"GMAIL_SEND_EMAIL"
],
"version": "latest"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3.1/tools/scopes/required"
payload := strings.NewReader("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\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/scopes/required")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3.1/tools/scopes/required");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"tools\": [\n \"GMAIL_FETCH_EMAILS\",\n \"GMAIL_SEND_EMAIL\"\n ],\n \"version\": \"latest\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"scopes_required": [
"channels:read",
"chat:write",
"https://www.googleapis.com/auth/gmail.modify",
"repo",
"user:email"
],
"per_tool_requirements": [
{
"tool": "<string>",
"scope_requirements": {
"all_of": [
"<string>"
],
"source": [
"<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>"
]
}
}