> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/api/permission.md).

# Permission

Permission

## List role assignments for a user

> Retrieves a list of all roles assigned to the specific user within the tenant.<br>

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TenantUserRoleAssignmentListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TenantUserRoleAssignmentResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"List of tenant user role assignments"}},"schemas":{"TenantUserRoleAssignmentResponseSchema":{"title":"TenantUserRoleAssignmentResponseSchema","type":"object","required":["tenantRole","assignedAt","assignedBy","createdAt","lastModifiedAt","tenantUserRoleAssignmentUid","isSystemRole"],"properties":{"tenantRole":{"$ref":"#/components/schemas/BasicTenantRoleResponseSchema"},"organization":{"$ref":"#/components/schemas/BasicOrganizationResponseSchema"},"store":{"$ref":"#/components/schemas/BasicStoreResponseSchema"},"assignedAt":{"type":"string","format":"date-time","description":"When the role was assigned"},"assignedBy":{"$ref":"#/components/schemas/OptionalUID"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"tenantUserRoleAssignmentUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"BasicTenantRoleResponseSchema":{"title":"BasicTenantRoleResponseSchema","type":"object","required":["name","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"BasicOrganizationResponseSchema":{"title":"BasicOrganizationResponseSchema","type":"object","required":["name","organizationUid"],"properties":{"name":{"type":"string"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"BasicStoreResponseSchema":{"title":"BasicStoreResponseSchema","type":"object","required":["name","storeUid","organizationUid","organizationName"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"},"organizationName":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}}},"paths":{"/tenants/{tenantUid}/users/{tenantUserUid}/roles":{"get":{"summary":"List role assignments for a user","description":"Retrieves a list of all roles assigned to the specific user within the tenant.\n","tags":["Permission"],"responses":{"200":{"$ref":"#/components/responses/TenantUserRoleAssignmentListResponse"}},"operationId":"list-tenant-user-role-assignments","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}]}}}}
```

## Assign a role to a user

> Assigns a new role to the user. Can be a tenant-wide role or scoped to a specific store.\
> \
> Required permissions: TENANT\_USER\_ROLE\_ASSIGNMENT<br>

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"TenantUserRoleAssignmentRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserRoleAssignmentRequestSchema"}}},"description":"Tenant user role assignment request"}},"schemas":{"TenantUserRoleAssignmentRequestSchema":{"title":"TenantUserRoleAssignmentRequestSchema","type":"object","required":["tenantRoleUid"],"properties":{"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"description":"A tenantRole can be assigned at three levels:\n- Only set a tenantRoleUid in the request: The role will be assigned at tenant level\n- Set organizationUid and tenantRoleUid: The role will be assigned at organization level\n- Set storeUid and tenantRoleUid: The role will be assigned at store level\n\nAn error occurs if both storeUid and organizationUid is set in the request.\n\nThe levels are ranked this way, from top to bottom: tenant, organization, store\n\nA permission set at higher level overrides lower level assignments.\n"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"TenantUserRoleAssignmentResponseSchema":{"title":"TenantUserRoleAssignmentResponseSchema","type":"object","required":["tenantRole","assignedAt","assignedBy","createdAt","lastModifiedAt","tenantUserRoleAssignmentUid","isSystemRole"],"properties":{"tenantRole":{"$ref":"#/components/schemas/BasicTenantRoleResponseSchema"},"organization":{"$ref":"#/components/schemas/BasicOrganizationResponseSchema"},"store":{"$ref":"#/components/schemas/BasicStoreResponseSchema"},"assignedAt":{"type":"string","format":"date-time","description":"When the role was assigned"},"assignedBy":{"$ref":"#/components/schemas/OptionalUID"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"tenantUserRoleAssignmentUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"BasicTenantRoleResponseSchema":{"title":"BasicTenantRoleResponseSchema","type":"object","required":["name","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"BasicOrganizationResponseSchema":{"title":"BasicOrganizationResponseSchema","type":"object","required":["name","organizationUid"],"properties":{"name":{"type":"string"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"BasicStoreResponseSchema":{"title":"BasicStoreResponseSchema","type":"object","required":["name","storeUid","organizationUid","organizationName"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"},"organizationName":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}},"responses":{"TenantUserRoleAssignmentResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserRoleAssignmentResponseSchema"}}},"description":"Tenant user role assignment response"}}},"paths":{"/tenants/{tenantUid}/users/{tenantUserUid}/roles":{"post":{"summary":"Assign a role to a user","description":"Assigns a new role to the user. Can be a tenant-wide role or scoped to a specific store.\n\nRequired permissions: TENANT_USER_ROLE_ASSIGNMENT\n","tags":["Permission"],"requestBody":{"$ref":"#/components/requestBodies/TenantUserRoleAssignmentRequest"},"responses":{"201":{"$ref":"#/components/responses/TenantUserRoleAssignmentResponse"}},"operationId":"create-tenant-user-role-assignment"}}}}
```

## Get a role assignment

> Retrieves details of a specific role assignment.\
> \
> Required permissions: TENANT\_USER\_ROLE\_ASSIGNMENT<br>

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TenantUserRoleAssignmentResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserRoleAssignmentResponseSchema"}}},"description":"Tenant user role assignment response"}},"schemas":{"TenantUserRoleAssignmentResponseSchema":{"title":"TenantUserRoleAssignmentResponseSchema","type":"object","required":["tenantRole","assignedAt","assignedBy","createdAt","lastModifiedAt","tenantUserRoleAssignmentUid","isSystemRole"],"properties":{"tenantRole":{"$ref":"#/components/schemas/BasicTenantRoleResponseSchema"},"organization":{"$ref":"#/components/schemas/BasicOrganizationResponseSchema"},"store":{"$ref":"#/components/schemas/BasicStoreResponseSchema"},"assignedAt":{"type":"string","format":"date-time","description":"When the role was assigned"},"assignedBy":{"$ref":"#/components/schemas/OptionalUID"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"tenantUserRoleAssignmentUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"BasicTenantRoleResponseSchema":{"title":"BasicTenantRoleResponseSchema","type":"object","required":["name","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"BasicOrganizationResponseSchema":{"title":"BasicOrganizationResponseSchema","type":"object","required":["name","organizationUid"],"properties":{"name":{"type":"string"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"BasicStoreResponseSchema":{"title":"BasicStoreResponseSchema","type":"object","required":["name","storeUid","organizationUid","organizationName"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"},"organizationName":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}}},"paths":{"/tenants/{tenantUid}/users/{tenantUserUid}/roles/{tenantUserRoleAssignmentUid}":{"get":{"summary":"Get a role assignment","description":"Retrieves details of a specific role assignment.\n\nRequired permissions: TENANT_USER_ROLE_ASSIGNMENT\n","tags":["Permission"],"responses":{"200":{"$ref":"#/components/responses/TenantUserRoleAssignmentResponse"}},"operationId":"get-tenant-user-role-assignment"}}}}
```

## Remove a role assignment

> Removes a specific role assignment from the user.\
> \
> Required permissions: TENANT\_USER\_ROLE\_ASSIGNMENT<br>

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/users/{tenantUserUid}/roles/{tenantUserRoleAssignmentUid}":{"delete":{"summary":"Remove a role assignment","description":"Removes a specific role assignment from the user.\n\nRequired permissions: TENANT_USER_ROLE_ASSIGNMENT\n","tags":["Permission"],"responses":{"204":{"description":"Role assignment removed"}},"operationId":"delete-tenant-user-role-assignment"}}}}
```

## List available permissions

> List available permissions

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PermissionMetadataResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PermissionMetadataResponseSchema"}}}}}}}},"schemas":{"PermissionMetadataResponseSchema":{"title":"PermissionMetadataResponseSchema","type":"object","description":"PermissionMetadataResponseSchema","required":["permission","description","roleTypes"],"properties":{"permission":{"type":"string"},"description":{"type":"string"},"roleTypes":{"type":"array","items":{"$ref":"#/components/schemas/PermissionLevelENUM"}}}},"PermissionLevelENUM":{"title":"PermissionLevelENUM","enum":["TENANT","STORE"],"type":"string"}}},"paths":{"/metadata/permissions":{"get":{"summary":"List available permissions","tags":["Permission"],"responses":{"200":{"$ref":"#/components/responses/PermissionMetadataResponse"}},"operationId":"get-metadata-permissions","description":"List available permissions"}}}}
```

## List tenant roles

> List tenant roles\
> \
> Required permissions: TENANT\_ROLE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TenantRoleListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TenantRoleResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"TenantRoleResponseSchema":{"title":"TenantRoleResponseSchema","type":"object","required":["name","description","externalId","permissions","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}}},"paths":{"/tenants/{tenantUid}/tenant-roles":{"get":{"summary":"List tenant roles","tags":["Permission"],"responses":{"200":{"$ref":"#/components/responses/TenantRoleListResponse"}},"operationId":"get-tenant-roles","description":"List tenant roles\n\nRequired permissions: TENANT_ROLE","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}]}}}}
```

## Add new tenant role

> Add new tenant role.\
> \
> Required permissions: TENANT\_ROLE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TenantRoleResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoleResponseSchema"}}}}},"schemas":{"TenantRoleResponseSchema":{"title":"TenantRoleResponseSchema","type":"object","required":["name","description","externalId","permissions","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"TenantRoleCreateRequestSchema":{"title":"TenantRoleCreateRequestSchema","type":"object","required":["name","description","permissions"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"tenantRoleUid":{"$ref":"#/components/schemas/UID"}}}},"requestBodies":{"TenantRoleCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoleCreateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/tenant-roles":{"post":{"summary":"Add new tenant role","tags":["Permission"],"responses":{"201":{"$ref":"#/components/responses/TenantRoleResponse"}},"operationId":"post-tenant-role","description":"Add new tenant role.\n\nRequired permissions: TENANT_ROLE","requestBody":{"$ref":"#/components/requestBodies/TenantRoleCreateRequest"}}}}}
```

Get Tenant Role\
\
Required permissions: TENANT\_ROLE
----------------------------------

> Get Tenant Role

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TenantRoleResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoleResponseSchema"}}}}},"schemas":{"TenantRoleResponseSchema":{"title":"TenantRoleResponseSchema","type":"object","required":["name","description","externalId","permissions","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}}},"paths":{"/tenants/{tenantUid}/tenant-roles/{tenantRoleUid}":{"get":{"summary":"Get Tenant Role\n\nRequired permissions: TENANT_ROLE","tags":["Permission"],"responses":{"200":{"$ref":"#/components/responses/TenantRoleResponse"}},"operationId":"get-tenant-role","description":"Get Tenant Role"}}}}
```

## Update Tenant Role

> Update Tenant Role\
> \
> Required permissions: TENANT\_ROLE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"TenantRoleUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoleUpdateRequestSchema"}}}}},"schemas":{"TenantRoleUpdateRequestSchema":{"title":"TenantRoleUpdateRequestSchema","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}}},"TenantRoleResponseSchema":{"title":"TenantRoleResponseSchema","type":"object","required":["name","description","externalId","permissions","tenantRoleUid","isSystemRole"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"tenantRoleUid":{"$ref":"#/components/schemas/UID"},"isSystemRole":{"type":"boolean"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}},"responses":{"TenantRoleResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoleResponseSchema"}}}}}},"paths":{"/tenants/{tenantUid}/tenant-roles/{tenantRoleUid}":{"put":{"description":"Update Tenant Role\n\nRequired permissions: TENANT_ROLE","summary":"Update Tenant Role","operationId":"put-tenant-role","requestBody":{"$ref":"#/components/requestBodies/TenantRoleUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/TenantRoleResponse"}},"tags":["Permission"]}}}}
```

## Delete Tenant Role

> Delete Tenant Role\
> \
> Required permissions: TENANT\_ROLE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Permission","description":"Permission"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/tenant-roles/{tenantRoleUid}":{"delete":{"summary":"Delete Tenant Role","tags":["Permission"],"responses":{"204":{"description":"No Content"}},"operationId":"delete-tenant-role","description":"Delete Tenant Role\n\nRequired permissions: TENANT_ROLE"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/api/permission.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
