---
title: "Create an organization role"
method: POST
path: "/api/organization-roles"
tags: ["Organization roles"]
---

# Create an organization role

`POST /api/organization-roles`

Create a new organization role with the given data.

## Request body

- object
  - `tenantId` string
  - `name` string, required — The name of the organization role. It must be unique within the organization template.
  - `description` string, nullable — The description of the organization role.
  - `type` 'User' | 'MachineToMachine'
  - `organizationScopeIds` string[], required — An array of organization scope IDs to be assigned to the organization role.
  - `resourceScopeIds` string[], required — An array of resource scope IDs to be assigned to the organization role.

## Response `201`

The organization role was created successfully.

- object
  - `tenantId` string, required
  - `id` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `type` 'User' | 'MachineToMachine', required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — The organization role name is already in use.

---

[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/revisions/a163dc77d842/schema)
