# Roles

## List available roles and permissions for the tenant

> Returns role definitions and associated permission.\
> &#x20;           \
> \## Authorization\
> Requires \`tenant.access:read\` scope.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Roles"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"RoleDefinition":{"required":["name","permissions"],"type":"object","properties":{"name":{"type":["null","string"]},"permissions":{"type":["null","array"],"items":{"type":"string"}}},"additionalProperties":false}}},"paths":{"/api/{tenantId}/admin/roles":{"get":{"tags":["Roles"],"summary":"List available roles and permissions for the tenant","description":"Returns role definitions and associated permission.\n            \n## Authorization\nRequires `tenant.access:read` scope.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Roles returned.","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDefinition"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDefinition"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDefinition"}}}}}}}}}}
```

## Get a specific role and permissions for the tenant

> Returns role definition and associated permissions for a single role.\
> &#x20;           \
> \## Authorization\
> Requires \`tenant.access:read\` scope, or the caller must have the same role as \`roleName\`.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Roles"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/admin/roles/{roleName}":{"get":{"tags":["Roles"],"summary":"Get a specific role and permissions for the tenant","description":"Returns role definition and associated permissions for a single role.\n            \n## Authorization\nRequires `tenant.access:read` scope, or the caller must have the same role as `roleName`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"roleName","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Role returned.","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RoleDefinition"}},"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition"}},"text/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition"}}}},"401":{"description":"Caller not authorized.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Role not found.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}},"components":{"schemas":{"RoleDefinition":{"required":["name","permissions"],"type":"object","properties":{"name":{"type":["null","string"]},"permissions":{"type":["null","array"],"items":{"type":"string"}}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}}}
```
