---
title: "Assign API resource roles to application"
method: POST
path: "/api/applications/{applicationId}/roles"
tags: ["Applications"]
---

# Assign API resource roles to application

`POST /api/applications/{applicationId}/roles`

Assign API resource roles to the specified application. The API resource roles will be added to the existing API resource roles. Role IDs that are already assigned to the application are silently ignored.

## Path parameters

- `applicationId` string, required

## Request body

- object
  - `roleIds` string[], required — An array of API resource role IDs to assign.

## Response `201`

The API resource roles have been assigned to the application successfully.

- object
  - `roleIds` string[], required — An array of API resource role IDs requested for assignment.
  - `addedRoleIds` string[], required — An array of API resource role IDs newly assigned to the application. Role IDs already attached to the application are silently ignored and not present in this array.

## Other responses

- `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)
