POST/api/apis/{api_server_id}/scopesAuthenticated

Define a scope on an API server

Defines an API scope on the API server, e.g. notes:read. From then on an authorization request whose RFC 8707 resource names the API server may ask for it, and the access tokens minted for the API server carry it in their scope claim, where the API server's route guards enforce it (requiredScopes / required_scopes). An API server defines at most 100 scopes. Hardcoded API servers cannot define scopes.

operationId post_api_apis_api_server_id_scopesAPI servers

Authentication & permissionsAuthenticated

Any authenticated user

Accepted credentials
Who may call
Any authenticated user
Notes
Organization owners/admins of the owning organization, the owning user of a user-owned API server, or platform administrators.

Path parameters

NameTypeDescription
api_server_id*string

API server id

Request body

Required

application/json
CreateApiServerScopeRequestscope: a single RFC 6749 scope-token (printable ASCII without spaces, " or \, at most 128 characters) that is not an OpenID Connect scope name (openid, profile, email, address, phone, offline_access). description: 1 to 256 characters, shown to users. allow_dynamic_clients (default true): whether dynamically registered clients, which have no app connection, may be granted it. Unknown keys are rejected.
PropertyTypeDescription
scope*string

minLength: 1maxLength: 128pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$

description*string

minLength: 1maxLength: 256

allow_dynamic_clientsboolean
JSONExample
"scope""string"
"description""string"
"allow_dynamic_clients"true

Responses

application/json
ApiServerScopeResponse
PropertyTypeDescription
success*true
scope*ApiServerScope

An OAuth 2.0 scope value (RFC 6749 §3.3) an API server defines for itself, with the description shown to users. Clients request it on an authorization request whose RFC 8707 resource names the API server; it is granted on the access tokens minted for that API server.

api_server_scope_id*string (uuid)
api_server_id*string

minLength: 2maxLength: 64pattern: ^[a-z0-9_-]*$

scope*string

minLength: 1maxLength: 128pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$

description*string

maxLength: 256

allow_dynamic_clients*boolean
created_at*number

minimum: 0

created_by*string (uuid) | null (uuid) | null
JSONExample
"success"true
"scope"
"api_server_scope_id""123e4567-e89b-12d3-a456-426614174000"
"api_server_id""string"
"scope""string"
"description""string"
"allow_dynamic_clients"true
"created_at"1.5
"created_by""123e4567-e89b-12d3-a456-426614174000"

Example request

bashcurl
curl -X POST 'https://auth.schemavaults.com/api/apis/<api_server_id>/scopes' \
  -b 'refresh_token_<auth_server_app_id>=<value>' \
  -H 'Content-Type: application/json' \
  -d '{
  "scope": "string",
  "description": "string",
  "allow_dynamic_clients": true
}'

Other methods on this path