Skip to content

Resource Servers

Resource servers represent the APIs that your OAuth applications access. Each resource server has a unique identifier (typically a URI like https://api.yourdomain.com), a display name, and a set of scopes it supports. Applications can be bound to specific resource servers, and the resource parameter in token requests is validated against these bindings per RFC 8707.

Required scopes: resource_servers:read for GET requests, resource_servers:write for POST / PUT / DELETE.


{
"id": 3,
"identifier": "https://api.yourdomain.com",
"name": "Main API",
"description": "Production backend API",
"enabled": true,
"scopes": ["read", "write", "admin"],
"createdAt": "2026-07-01T10:00:00Z"
}
FieldTypeDescription
idintegerInternal numeric ID
identifierstringUnique URI identifying this resource server (used as the resource value in token requests)
namestringHuman-readable display name
descriptionstring | nullOptional description
enabledbooleanWhether the resource server is active
scopesstring[]Supported scope values
createdAtstringISO-8601 creation timestamp

GET /t/{slug}/api/v1/resource-servers

Response 200 OK:

{
"data": [
{
"id": 3,
"identifier": "https://api.yourdomain.com",
"name": "Main API",
"description": null,
"enabled": true,
"scopes": ["read", "write"],
"createdAt": "2026-07-01T10:00:00Z"
}
],
"meta": { "total": 1, "offset": 0, "limit": 1 }
}

POST /t/{slug}/api/v1/resource-servers
Content-Type: application/json
{
"identifier": "https://api.yourdomain.com",
"name": "Main API",
"description": "Production backend API",
"scopes": ["read", "write", "admin"]
}
FieldRequiredDescription
identifierYesUnique URI for this resource server
nameYesDisplay name
descriptionNoOptional description
scopesNoArray of supported scopes (defaults to empty)

Response 201 Created: Returns the created resource server object.

Returns 409 Conflict if a resource server with the same identifier already exists in the workspace.


GET /t/{slug}/api/v1/resource-servers/{id}

Response 200 OK: Returns the resource server object.


PUT /t/{slug}/api/v1/resource-servers/{id}
Content-Type: application/json
{
"name": "Main API v2",
"description": "Updated backend API",
"scopes": ["read", "write", "admin", "billing"]
}
FieldRequiredDescription
nameYesDisplay name
descriptionNoOptional description
scopesNoSupported scopes (defaults to empty). Full-set replace.

Response 200 OK: Returns the updated resource server object.


DELETE /t/{slug}/api/v1/resource-servers/{id}

Response 204 No Content


List authorized resource servers for an application

Section titled “List authorized resource servers for an application”
GET /t/{slug}/api/v1/applications/{appId}/authorized-resource-servers

Returns the resource servers that an application is authorized to request tokens for. When a token request includes a resource parameter, Kotauth validates the requested resource against this binding list.

Required scope: resource_servers:read

Response 200 OK:

{
"data": [
{
"id": 3,
"identifier": "https://api.yourdomain.com",
"name": "Main API",
"description": null,
"enabled": true,
"scopes": ["read", "write"],
"createdAt": "2026-07-01T10:00:00Z"
}
],
"meta": { "total": 1, "offset": 0, "limit": 1 }
}

Set authorized resource servers for an application

Section titled “Set authorized resource servers for an application”
PUT /t/{slug}/api/v1/applications/{appId}/authorized-resource-servers
Content-Type: application/json
{
"resourceServerIds": [3, 5]
}

Full-set replace — the application will be authorized only for the specified resource servers. Pass an empty array to remove all bindings.

Required scope: resource_servers:write

FieldRequiredDescription
resourceServerIdsYesArray of resource server IDs

Response 204 No Content