> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/app-maker-open-apis/settings/role.md).

# Role

Define roles and assign permissions.

## Get organizations roles

> Get organizations roles by organization user

```json
{"openapi":"3.0.3","info":{"title":"AppMaker API - OAS 3.0","version":"1.0.0"},"tags":[{"name":"settings","description":"Organization level settings and policy configuration."},{"name":"role","description":"Define roles and assign permissions."}],"servers":[{"url":"https://abp-api.akinon.net/api/v1","description":"Production server"},{"url":"https://abptest-api.akinon.net/api/v1","description":"Test server"},{"url":"http://localhost:5001/api/v1","description":"Local server"}],"security":[{"bearerAuth":[]},{"accessToken":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"accessToken":{"type":"apiKey","in":"header","name":"x-access-token"}},"parameters":{"OrganizationIdPathParam":{"name":"organizationId","in":"path","required":true,"description":"Organization ID","schema":{"$ref":"#/components/schemas/MongoId"}},"LimitQueryParam":{"name":"limit","in":"query","required":false,"description":"The limit of per page","schema":{"type":"integer","default":10}},"PageQueryParam":{"name":"page","in":"query","required":false,"description":"Current page number","schema":{"type":"integer","default":1}},"SortQueryParam":{"name":"sort","in":"query","required":false,"description":"Sort","schema":{"type":"string"}},"TextQueryParam":{"name":"text","in":"query","description":"Text","schema":{"type":"string"}},"PrivilegesQueryParam":{"name":"privileges","in":"query","required":false,"description":"Privileges","schema":{"type":"string"}}},"schemas":{"MongoId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Entity ID"},"Pagination":{"type":"object","required":["totalDocs","limit","page","totalPages","pagingCounter","hasPrevPage","hasNextPage","prevPage","nextPage","docs"],"properties":{"totalDocs":{"type":"integer","description":"The total number of users"},"limit":{"type":"integer","description":"The limit of users per page","default":10},"page":{"type":"integer","description":"Current page","default":1},"totalPages":{"type":"integer","description":"The total number of pages"},"pagingCounter":{"type":"integer","description":"Current page number"},"hasPrevPage":{"type":"boolean","description":"Has previous page"},"hasNextPage":{"type":"boolean","description":"Has next page"},"prevPage":{"type":"integer","description":"Previous page number"},"nextPage":{"type":"integer","description":"Next page number"},"docs":{"description":"Items"}}},"Role":{"required":["name","organization","status","createdAt","updatedAt"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Role name"},"description":{"type":"string","description":"Role description"},"organization":{"$ref":"#/components/schemas/Organization"},"privileges":{"type":"array","items":{"type":"string"},"description":"Role privileges, formatted as (<domain>:<action>)"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Organization":{"type":"object","required":["_id","name","slug","description","owner","isExecutive","status","privileges"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Organization name"},"slug":{"$ref":"#/components/schemas/Slug"},"description":{"type":"string","minLength":2,"maxLength":255,"description":"Organization description"},"owner":{"$ref":"#/components/schemas/MongoId"},"isExecutive":{"type":"boolean","description":"Organization is executive","default":false,"readOnly":true},"status":{"$ref":"#/components/schemas/Status"},"privileges":{"type":"array","items":{"type":"string"},"description":"Organization privileges, formatted as (<domain>:<action>)","default":[]},"imageUrl":{"type":"string","description":"Organization image URL"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Slug":{"type":"string","pattern":"^[a-z0-9-]{2,100}$","minLength":2,"maxLength":100,"description":"Slug"},"Status":{"type":"integer","description":"Status","enum":[0,1]},"ReadOnlyDate":{"type":"string","format":"date-time","readOnly":true,"description":"Date"},"UnauthorizedError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}},"ForbiddenError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}}},"responses":{"GetOrgRolesResponse":{"description":"OK","content":{"application/json":{"schema":{"required":["docs"],"allOf":[{"$ref":"#/components/schemas/Pagination"},{"properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Role"}}}}]}}}},"UnauthorizedErrorResponse":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenErrorResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}}}},"paths":{"/organizations/{organizationId}/roles":{"get":{"tags":["role","settings"],"summary":"Get organizations roles","description":"Get organizations roles by organization user","operationId":"getOrgRoles","parameters":[{"$ref":"#/components/parameters/OrganizationIdPathParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/PageQueryParam"},{"$ref":"#/components/parameters/SortQueryParam"},{"$ref":"#/components/parameters/TextQueryParam"},{"$ref":"#/components/parameters/PrivilegesQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/GetOrgRolesResponse"},"401":{"$ref":"#/components/responses/UnauthorizedErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenErrorResponse"}}}}}}
```

## Create a organization role

> Create a organization role by organization user

```json
{"openapi":"3.0.3","info":{"title":"AppMaker API - OAS 3.0","version":"1.0.0"},"tags":[{"name":"settings","description":"Organization level settings and policy configuration."},{"name":"role","description":"Define roles and assign permissions."}],"servers":[{"url":"https://abp-api.akinon.net/api/v1","description":"Production server"},{"url":"https://abptest-api.akinon.net/api/v1","description":"Test server"},{"url":"http://localhost:5001/api/v1","description":"Local server"}],"security":[{"bearerAuth":[]},{"accessToken":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"accessToken":{"type":"apiKey","in":"header","name":"x-access-token"}},"parameters":{"OrganizationIdPathParam":{"name":"organizationId","in":"path","required":true,"description":"Organization ID","schema":{"$ref":"#/components/schemas/MongoId"}}},"schemas":{"MongoId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Entity ID"},"Date":{"type":"string","format":"date-time","description":"Date"},"UnauthorizedError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}},"ForbiddenError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}}},"requestBodies":{"CreateOrgRoleRequest":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","description":"Role name"},"description":{"type":"string","description":"Role description"},"privileges":{"type":"array","items":{"type":"string","description":"Role privileges"}},"status":{"type":"number","description":"Role status"}}}}}}},"responses":{"CreateOrgRoleResponse":{"description":"Created","content":{"application/json":{"schema":{"properties":{"_id":{"allOf":[{"type":"string"},{"description":"Role id"},{"$ref":"#/components/schemas/MongoId"}]},"organization":{"allOf":[{"type":"string"},{"description":"Organization id"},{"$ref":"#/components/schemas/MongoId"}]},"name":{"type":"string","description":"Role name"},"privileges":{"type":"array","items":{"type":"string","description":"Role privileges"}},"status":{"type":"number","description":"Role status"},"createdAt":{"allOf":[{"type":"string"},{"description":"Created at date"},{"$ref":"#/components/schemas/Date"}]},"updatedAt":{"allOf":[{"type":"string"},{"description":"Updated at date"},{"$ref":"#/components/schemas/Date"}]}}}}}},"ValidationErrorResponse":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"validationError":{"type":"object","properties":{}}}}}}},"UnauthorizedErrorResponse":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenErrorResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}}}},"paths":{"/organizations/{organizationId}/roles":{"post":{"tags":["role","settings"],"summary":"Create a organization role","description":"Create a organization role by organization user","operationId":"createOrgRole","parameters":[{"$ref":"#/components/parameters/OrganizationIdPathParam"}],"requestBody":{"$ref":"#/components/requestBodies/CreateOrgRoleRequest"},"responses":{"201":{"$ref":"#/components/responses/CreateOrgRoleResponse"},"400":{"$ref":"#/components/responses/ValidationErrorResponse"},"401":{"$ref":"#/components/responses/UnauthorizedErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenErrorResponse"}}}}}}
```

## Get a organization role

> Get a organization role by organization user

```json
{"openapi":"3.0.3","info":{"title":"AppMaker API - OAS 3.0","version":"1.0.0"},"tags":[{"name":"settings","description":"Organization level settings and policy configuration."},{"name":"role","description":"Define roles and assign permissions."}],"servers":[{"url":"https://abp-api.akinon.net/api/v1","description":"Production server"},{"url":"https://abptest-api.akinon.net/api/v1","description":"Test server"},{"url":"http://localhost:5001/api/v1","description":"Local server"}],"security":[{"bearerAuth":[]},{"accessToken":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"accessToken":{"type":"apiKey","in":"header","name":"x-access-token"}},"parameters":{"OrganizationIdPathParam":{"name":"organizationId","in":"path","required":true,"description":"Organization ID","schema":{"$ref":"#/components/schemas/MongoId"}},"RoleIdPathParam":{"name":"roleId","in":"path","required":true,"description":"Role ID","schema":{"$ref":"#/components/schemas/MongoId"}}},"schemas":{"MongoId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Entity ID"},"Role":{"required":["name","organization","status","createdAt","updatedAt"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Role name"},"description":{"type":"string","description":"Role description"},"organization":{"$ref":"#/components/schemas/Organization"},"privileges":{"type":"array","items":{"type":"string"},"description":"Role privileges, formatted as (<domain>:<action>)"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Organization":{"type":"object","required":["_id","name","slug","description","owner","isExecutive","status","privileges"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Organization name"},"slug":{"$ref":"#/components/schemas/Slug"},"description":{"type":"string","minLength":2,"maxLength":255,"description":"Organization description"},"owner":{"$ref":"#/components/schemas/MongoId"},"isExecutive":{"type":"boolean","description":"Organization is executive","default":false,"readOnly":true},"status":{"$ref":"#/components/schemas/Status"},"privileges":{"type":"array","items":{"type":"string"},"description":"Organization privileges, formatted as (<domain>:<action>)","default":[]},"imageUrl":{"type":"string","description":"Organization image URL"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Slug":{"type":"string","pattern":"^[a-z0-9-]{2,100}$","minLength":2,"maxLength":100,"description":"Slug"},"Status":{"type":"integer","description":"Status","enum":[0,1]},"ReadOnlyDate":{"type":"string","format":"date-time","readOnly":true,"description":"Date"},"UnauthorizedError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}},"ForbiddenError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}}},"responses":{"GetOrgRoleResponse":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role"}}}},"UnauthorizedErrorResponse":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenErrorResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundRepsonse":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"apiError":{"type":"array","items":{}}}}}}}}},"paths":{"/organizations/{organizationId}/roles/{roleId}":{"get":{"tags":["role","settings"],"summary":"Get a organization role","description":"Get a organization role by organization user","operationId":"getOrgRole","parameters":[{"$ref":"#/components/parameters/OrganizationIdPathParam"},{"$ref":"#/components/parameters/RoleIdPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetOrgRoleResponse"},"401":{"$ref":"#/components/responses/UnauthorizedErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenErrorResponse"},"404":{"$ref":"#/components/responses/NotFoundRepsonse"}}}}}}
```

## Update a organization role

> Update a organization role by organization user

```json
{"openapi":"3.0.3","info":{"title":"AppMaker API - OAS 3.0","version":"1.0.0"},"tags":[{"name":"settings","description":"Organization level settings and policy configuration."},{"name":"role","description":"Define roles and assign permissions."}],"servers":[{"url":"https://abp-api.akinon.net/api/v1","description":"Production server"},{"url":"https://abptest-api.akinon.net/api/v1","description":"Test server"},{"url":"http://localhost:5001/api/v1","description":"Local server"}],"security":[{"bearerAuth":[]},{"accessToken":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"accessToken":{"type":"apiKey","in":"header","name":"x-access-token"}},"parameters":{"OrganizationIdPathParam":{"name":"organizationId","in":"path","required":true,"description":"Organization ID","schema":{"$ref":"#/components/schemas/MongoId"}},"RoleIdPathParam":{"name":"roleId","in":"path","required":true,"description":"Role ID","schema":{"$ref":"#/components/schemas/MongoId"}}},"schemas":{"MongoId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Entity ID"},"Role":{"required":["name","organization","status","createdAt","updatedAt"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Role name"},"description":{"type":"string","description":"Role description"},"organization":{"$ref":"#/components/schemas/Organization"},"privileges":{"type":"array","items":{"type":"string"},"description":"Role privileges, formatted as (<domain>:<action>)"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Organization":{"type":"object","required":["_id","name","slug","description","owner","isExecutive","status","privileges"],"properties":{"_id":{"$ref":"#/components/schemas/MongoId"},"name":{"type":"string","minLength":2,"maxLength":100,"description":"Organization name"},"slug":{"$ref":"#/components/schemas/Slug"},"description":{"type":"string","minLength":2,"maxLength":255,"description":"Organization description"},"owner":{"$ref":"#/components/schemas/MongoId"},"isExecutive":{"type":"boolean","description":"Organization is executive","default":false,"readOnly":true},"status":{"$ref":"#/components/schemas/Status"},"privileges":{"type":"array","items":{"type":"string"},"description":"Organization privileges, formatted as (<domain>:<action>)","default":[]},"imageUrl":{"type":"string","description":"Organization image URL"},"createdAt":{"$ref":"#/components/schemas/ReadOnlyDate"},"updatedAt":{"$ref":"#/components/schemas/ReadOnlyDate"}}},"Slug":{"type":"string","pattern":"^[a-z0-9-]{2,100}$","minLength":2,"maxLength":100,"description":"Slug"},"Status":{"type":"integer","description":"Status","enum":[0,1]},"ReadOnlyDate":{"type":"string","format":"date-time","readOnly":true,"description":"Date"},"UnauthorizedError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}},"ForbiddenError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}}},"requestBodies":{"UpdateOrgRoleRequest":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","description":"Role name"},"description":{"type":"string","description":"Role description"},"privileges":{"type":"array","items":{"type":"string","description":"Role privileges"}},"status":{"type":"number","description":"Role status"}}}}}}},"responses":{"UpdateOrgRoleResponse":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role"}}}},"ValidationErrorResponse":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"validationError":{"type":"object","properties":{}}}}}}},"UnauthorizedErrorResponse":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenErrorResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundRepsonse":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"apiError":{"type":"array","items":{}}}}}}}}},"paths":{"/organizations/{organizationId}/roles/{roleId}":{"put":{"tags":["role","settings"],"summary":"Update a organization role","description":"Update a organization role by organization user","operationId":"updateOrgRole","parameters":[{"$ref":"#/components/parameters/OrganizationIdPathParam"},{"$ref":"#/components/parameters/RoleIdPathParam"}],"requestBody":{"$ref":"#/components/requestBodies/UpdateOrgRoleRequest"},"responses":{"200":{"$ref":"#/components/responses/UpdateOrgRoleResponse"},"400":{"$ref":"#/components/responses/ValidationErrorResponse"},"401":{"$ref":"#/components/responses/UnauthorizedErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenErrorResponse"},"404":{"$ref":"#/components/responses/NotFoundRepsonse"}}}}}}
```

## Delete a organization role

> Delete a organization role by organization user

```json
{"openapi":"3.0.3","info":{"title":"AppMaker API - OAS 3.0","version":"1.0.0"},"tags":[{"name":"settings","description":"Organization level settings and policy configuration."},{"name":"role","description":"Define roles and assign permissions."}],"servers":[{"url":"https://abp-api.akinon.net/api/v1","description":"Production server"},{"url":"https://abptest-api.akinon.net/api/v1","description":"Test server"},{"url":"http://localhost:5001/api/v1","description":"Local server"}],"security":[{"bearerAuth":[]},{"accessToken":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"accessToken":{"type":"apiKey","in":"header","name":"x-access-token"}},"parameters":{"OrganizationIdPathParam":{"name":"organizationId","in":"path","required":true,"description":"Organization ID","schema":{"$ref":"#/components/schemas/MongoId"}},"RoleIdPathParam":{"name":"roleId","in":"path","required":true,"description":"Role ID","schema":{"$ref":"#/components/schemas/MongoId"}}},"schemas":{"MongoId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Entity ID"},"UnauthorizedError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}},"ForbiddenError":{"type":"object","properties":{"apiError":{"type":"array","items":{"type":"string"},"description":"Error message"}}}},"responses":{"NoContentResponse":{"description":"No Content"},"UnauthorizedErrorResponse":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenErrorResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundRepsonse":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"apiError":{"type":"array","items":{}}}}}}}}},"paths":{"/organizations/{organizationId}/roles/{roleId}":{"delete":{"tags":["role","settings"],"summary":"Delete a organization role","description":"Delete a organization role by organization user","operationId":"deleteOrgRole","parameters":[{"$ref":"#/components/parameters/OrganizationIdPathParam"},{"$ref":"#/components/parameters/RoleIdPathParam"}],"responses":{"204":{"$ref":"#/components/responses/NoContentResponse"},"401":{"$ref":"#/components/responses/UnauthorizedErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenErrorResponse"},"404":{"$ref":"#/components/responses/NotFoundRepsonse"}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/app-maker-open-apis/settings/role.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
