---
title: "Create Role"
method: POST
path: "/management/v1/role"
tags: ["role"]
---

# Create Role

`POST /management/v1/role`

## Request

- Base URL: `https://localhost`
- URL: `https://localhost/management/v1/role`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/docs/management/v1/role/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a role with the specified name, description, and permissions.

## Headers

- `x-project-id` string, nullable

## Request body

- CreateRoleRequest
  - `description` string, nullable: Description of the role
  - `name` string, required: Name of the role to create
  - `project-id` string, nullable: Project ID in which the role is created. Deprecated: Please use the `x-project-id` header instead.
  - `provider-id` string, nullable: Provider that owns this role (e.g. `"lakekeeper"`, `"oidc"`). Must be provided together with `source-id`. Omit both to let the server assign `provider-id = "lakekeeper"` and a fresh UUIDv7 `source-id`.
  - `source-id` string, nullable: Identifier of the role in the provider. Must be provided together with `provider-id`.

## Response `201`

Role successfully created

- Role
  - `created-at` string, date-time, required: Timestamp when the role was created
  - `description` string, nullable: Description of the role
  - `id` string, uuid, required: Globally unique UUID identifier
  - `ident` string, required: Composite project-scoped identifier (`provider~source_id`). Unique within a project.
  - `name` string, required: Name of the role
  - `project-id` string, required: Project ID in which the role is created.
  - `provider-id` string, required: Provider that owns this role (e.g. `"lakekeeper"`, `"oidc"`).
  - `source-id` string, required: Identifier of the role in the provider.
  - `updated-at` string, date-time, nullable: Timestamp when the role was last updated

## Other responses

- `4XX`

---

[API](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api.md) - [All operations](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/revisions/c5cb9a12a98c?raw)
