---
canonical_url: "https://docs.composio.dev/reference/api-reference/tools/postToolsScopesRequired"
markdown_url: "https://docs.composio.dev/reference/api-reference/tools/postToolsScopesRequired.md"
product: "platform"
version: "3.1"
last_updated: null
---

# Get required scopes for tools (DEPRECATED)

**Documentation:** /reference/api-reference/tools/postToolsScopesRequired

> **API version:** This page documents Composio REST API v3.1, the current version, at `https://backend.composio.dev/api/v3.1`. `https://backend.composio.dev/api/v3` is the previous version and remains supported.

DEPRECATED: Use POST /api/v3.1/toolkits/{toolkit_slug}/scopes/recommended instead, discovering its `grant_context` options with GET /api/v3.1/toolkits/{toolkit_slug}/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`

**Endpoint:** `https://backend.composio.dev/api/v3.1/tools/scopes/required`

**Summary:** Get required scopes for tools (DEPRECATED)

DEPRECATED: Use POST /api/v3.1/toolkits/{toolkit_slug}/scopes/recommended instead, discovering its `grant_context` options with GET /api/v3.1/toolkits/{toolkit_slug}/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.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key`

### Request Body

**Schema:**

- `tools` (array<string>) *(required)*: Tool slugs to resolve scopes for. All tools must belong to the same toolkit.
- `version` (string): Toolkit version to resolve scopes against for the requested toolkit. Defaults to `latest` when omitted on REST API v3.1.

**Example:**

```json
{
  "tools": [
    "string"
  ],
  "version": "string"
}
```

### Responses

#### 200 - Successfully retrieved scopes for the specified tools

**Response Schema:**

- `scopes_required` (array<string>) *(required)*: A combined list of all unique scopes required by the specified tools
- `per_tool_requirements` (array<object>) *(required)*: Per-tool structured scope requirements. Null scope_requirements marks unmigrated legacy tools.
  - Array items:
    - `tool` (string) *(required)*
    - `scope_requirements` (object,null) *(required)*

**Example Response:**

```json
{
  "scopes_required": [
    "string"
  ],
  "per_tool_requirements": [
    {
      "tool": "string",
      "scope_requirements": null
    }
  ]
}
```

#### 400 - Bad request - Invalid body parameters or tools from different toolkits

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized - Authentication credentials are missing or invalid

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Not found - One or more tools could not be resolved for the requested version

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal server error - Something went wrong on the server

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example requests

Python uses `requests`; TypeScript uses Node.js fetch. Replace sample IDs and values before sending these requests.

Set `COMPOSIO_API_KEY` before running these requests.

#### Python

```python
import os
import requests
import json

response = requests.request("POST", "https://backend.composio.dev/api/v3.1/tools/scopes/required",
    headers={"Content-Type": "application/json", "x-api-key": os.environ["COMPOSIO_API_KEY"]},
    json=json.loads("{\"tools\":[\"string\"],\"version\":\"string\"}"))
response.raise_for_status()
print(response.text)
```

#### TypeScript

```typescript
const response = await fetch("https://backend.composio.dev/api/v3.1/tools/scopes/required", {
  method: "POST",
  headers: { "Content-Type": "application/json", "x-api-key": process.env["COMPOSIO_API_KEY"]! },
  body: JSON.stringify({
  "tools": [
    "string"
  ],
  "version": "string"
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());
```

#### API

```bash
curl -X POST "https://backend.composio.dev/api/v3.1/tools/scopes/required" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tools": [
      "string"
    ],
    "version": "string"
  }'
```

---

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.

## Tool-endpoint version defaults on v3.1

On v3.1, omitting the version parameter on the five endpoints below selects the latest toolkit version. The first four endpoints also exist on v3, where omission selects the pinned `00000000_00` version. `POST /tools/scopes/required` is v3.1-only.

| Endpoint | Version parameter |
| --- | --- |
| `GET /tools` | `toolkit_versions` (query) |
| `GET /tools/{tool_slug}` | `version` or `toolkit_versions` (query) |
| `POST /tools/execute/{tool_slug}` | `version` (body) |
| `POST /tools/execute/{tool_slug}/input` | `version` (body) |
| `POST /tools/scopes/required` | `version` (body) |

A v3.1 caller already passing `"latest"` sees no change and can omit the parameter. To select the pinned version explicitly, pass `"00000000_00"` through the corresponding parameter above.

This version-default change is limited to the five endpoints above.