API ReferenceToolkits

Get required scopesv3.1

POST
/api/v3.1/toolkits/{toolkit_slug}/scopes/recommended

Experimental: this endpoint is in beta and its contract may change.

Recommends the required scopes to use the given set of tools.

Authorization

ApiKeyAuth
x-api-key<token>

Project API key authentication

In: header

Path Parameters

toolkit_slugstringRequired

Toolkit to recommend scopes for.

Request Body

application/json

toolsarray of stringRequired

Tool slugs to recommend scopes for; an empty list computes the recommendation across all of the toolkit’s tools.

auth_schemeenum

Auth scheme the connection will use. Defaults to OAUTH2.

Default: "OAUTH2"
Possible values:
OAUTH2OAUTH1API_KEYBASICBILLCOM_AUTHBEARER_TOKENGOOGLE_SERVICE_ACCOUNTNO_AUTHBASIC_WITH_JWTCALCOM_AUTHSERVICE_ACCOUNTSAMLDCR_OAUTHCIMD_OAUTHS2S_OAUTH2
toolkit_versionstring

Toolkit version to compute from; defaults to the latest published version. Pass a concrete version to pin.

Default: "latest"
grant_contextobject

Optional context about your OAuth app or the account being connected that can change which scopes are required, e.g. {"account_type": "Google Workspace"}. Get accepted keys and values from the List grant_context options endpoint.

includearray of string

Scopes the recommendation must include, irrespective of usage.

excludearray of string

Scopes the recommendation must not include; the solver picks documented alternatives and fails when none exist.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v3.1/toolkits/string/scopes/recommended" \  -H "Content-Type: application/json" \  -d '{    "tools": [      "string"    ]  }'
{  "auth_scheme": "string",  "toolkit_version": "string",  "grant_context": {    "property1": "string",    "property2": "string"  },  "scopes": {    "least_privilege": [      "string"    ],    "fewest": [      "string"    ],    "conditional": [      {        "scope": "string",        "when": {          "property1": [            "string"          ],          "property2": [            "string"          ]        },        "for": [          "string"        ]      }    ]  }}