---
title: "Update Tenant’s roles based on the specified Tenant Id"
method: PATCH
path: "/tenants/{tenant_id}/roles"
tags: ["tenants"]
---

# Update Tenant’s roles based on the specified Tenant Id

`PATCH /tenants/{tenant_id}/roles`

You need `global.tenant.edit_roles` permission to access this resource

## Path parameters

- `tenant_id` string, required

## Request body

- object
  - `data` object, required
    - `type` 'tenant-policy', required
    - `attributes` object, required
      - `roles` union[], required
        - union
          - object
            - `i18n` object
              - …
            - `role` string — Name of a role
            - `permissions` string[], required — An array of permissions. It can be empty. To get the list of available permissions execute [Get the list of available permissions](../openapi.yaml#/~1permissions) endpoint
            - `scope` 'tenants' | 'contracts' | 'workspaces' — The group of objects, which is affected by this role. Allowed values: "tenants", "contracts", "workspaces"
          - object
            - `i18n` object
              - …
            - `role` string — Name of a role
            - `permissions` string[], required — An array of permissions. It can be empty. To get the list of available permissions execute [Get the list of available permissions](../openapi.yaml#/~1permissions) endpoint
            - `scope` 'tenants' | 'contracts' | 'workspaces' — The group of objects, which is affected by this role. Allowed values: "tenants", "contracts", "workspaces"
            - `newTenantRole` object
              - …
          - NewTenantRole — unresolved $ref

## Response `200`

OK

- object
  - `data` object, required
    - `id` string, required
    - `type` 'tenant-policy', required
    - `attributes` object, required
      - `roles` union[], required
        - union
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
          - object
            - `i18n` object, required
              - …
            - `role` string, required
            - `permissions` string[], required
            - `scope` string, required
    - `relationships` object, required
      - `tenant` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'tenant', required
        - `links` object, required
          - `self` string, required
  - `meta` object, required
  - `links` object, required
    - `self` string, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2.md) · [All operations](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/elastic-io-rest-api-documentation-v2/revisions/411f9f98c01e/schema)
