---
title: "Link scopes to role"
method: POST
path: "/api/roles/{id}/scopes"
tags: ["Roles"]
---

# Link scopes to role

`POST /api/roles/{id}/scopes`

Link a list of API resource scopes (permissions) to a role. The original linked scopes will be kept.

## Path parameters

- `id` string, required

## Request body

- object
  - `scopeIds` string[], required — An array of API resource scope IDs to be linked.

## Response `200`

The role was linked to the scopes successfully.

## Other responses

- `201` — Created
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Content

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
