---
title: "Create or update roles"
method: POST
path: "/api/security/roles"
tags: ["roles"]
---

# Create or update roles

`POST /api/security/roles`

Create or update multiple Kibana roles in a single request.

## Headers

- `kbn-xsrf` string, required

## Request body

- KibanaHTTPAPIsSecurityRolesBulkCreateOrUpdatePayload — The request body for bulk creating or updating roles.
  - `roles` object, required

## Response `200`

Indicates a successful call.

- KibanaHTTPAPIsSecurityBulkCreateOrUpdateRolesResponse — The response payload for the bulk create-or-update roles API.
  - `created` string[]
  - `errors` object
  - `noop` string[]
  - `updated` string[]

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
