> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/user-roles.md). Agents can also search and read this documentation through its [MCP server](https://docs.usepylon.com/pylon-docs/~gitbook/mcp).

# User roles

## Get a list of all user roles

> Returns all user roles for the organization, with the actions each role grants.\
> Permission and issue access rule filters use the same filter shape that search endpoints accept;\
> a filter the API can't represent is omitted and marked filter\_unsupported. A "current\_user"\
> value in a filter means the user the permission is checked for.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetUserRolesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserRolesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetUserRolesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/UserRole"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"UserRole":{"properties":{"id":{"description":"The ID of the role.","type":"string"},"issue_access_policy":{"$ref":"#/components/schemas/UserRoleIssueAccessPolicy"},"name":{"description":"The name of the role.","type":"string"},"permissions":{"description":"The actions the role grants. An action with a filter applies only to the objects that match it.","items":{"$ref":"#/components/schemas/UserRolePermission"},"type":"array"},"slug":{"description":"The slug of the role.","type":"string"}},"required":["id","name","permissions","slug"],"type":"object"},"UserRoleIssueAccessPolicy":{"properties":{"default_actions":{"description":"The actions granted on an issue that matches no rule.","items":{"type":"string"},"type":"array"},"rules":{"description":"Rules checked in order. An issue gets only the actions of the first rule that matches it, even when\nthey are fewer than default_actions.","items":{"$ref":"#/components/schemas/UserRoleIssueAccessRule"},"type":"array"}},"required":["default_actions","rules"],"type":"object"},"UserRoleIssueAccessRule":{"properties":{"actions":{"description":"The actions granted on issues for which this is the first matching rule.","items":{"type":"string"},"type":"array"},"filter":{"$ref":"#/components/schemas/Filter"},"filter_unsupported":{"description":"True when the rule has a filter that the API can't represent, so filter is absent.","type":"boolean"},"id":{"description":"The ID of the rule.","type":"string"}},"required":["actions","id"],"type":"object"},"Filter":{"properties":{"field":{"description":"The field for this filter.  For allowed fields, see the documentation for\nthe specific endpoint you are using.\nFor non-compound filters (any operators other than \"and\", \"or\", or \"not\"),\nfield must be set, along with either value or values, depending on the operator.","type":"string"},"operator":{"description":"The operator for this filter. Required unless related_object is set.","enum":["equals","not_equals","contains","does_not_contain","in","not_in","and","or","not","time_is_after","time_is_before","time_range","string_contains","string_does_not_contain","is_set","is_unset","greater_than","less_than","greater_than_or_equals","less_than_or_equals","includes_all_of","starts_with","ends_with","time_is_in_last","time_is_not_in_last","time_is_in_next","time_is_not_in_next","includes_exactly","belongs_to","not_belongs_to"],"type":"string"},"related_object":{"$ref":"#/components/schemas/FilterRelatedObject"},"subfilters":{"description":"Sub-filters for this filter.  Valid only when operator is \"and\", \"or\", or \"not\"; \"not\"\ntakes exactly one subfilter.\nThe maximum allowed depth for a tree of filters is 5, counting the top-level filter.","items":{"$ref":"#/components/schemas/Filter"},"type":"array"},"value":{"description":"The value for this filter. Used by single-valued operators: \"equals\", \"not_equals\",\n\"contains\", \"does_not_contain\", \"string_contains\", \"string_does_not_contain\",\n\"starts_with\", \"ends_with\", \"time_is_after\", \"time_is_before\", \"time_is_in_last\",\n\"time_is_not_in_last\", \"time_is_in_next\", \"time_is_not_in_next\", \"greater_than\",\n\"less_than\", \"greater_than_or_equals\", and \"less_than_or_equals\".\nOn fields that hold user IDs, \"current_user\" means the API token's user; on fields that\nhold team IDs, \"my_teams\" means that user's teams. The same applies to values.","type":"string"},"values":{"description":"The values for this filter. Used by multi-valued operators: \"in\", \"not_in\", \"includes_all_of\",\n\"includes_exactly\", \"belongs_to\", and \"not_belongs_to\". For \"time_range\", set to [start, end].","items":{"type":"string"},"type":"array"}},"type":"object"},"FilterRelatedObject":{"properties":{"custom_field":{"description":"The slug of a relationship custom field to follow. Returned when reading stored filters,\nsuch as ticket form conditions; search filters don't accept it yet.","type":"string"},"filter":{"$ref":"#/components/schemas/Filter"},"relationship":{"description":"The built-in relationship to follow, such as \"account\". Each search endpoint lists the\nrelationships its filter accepts. Exactly one of relationship and custom_field is set.","type":"string"}},"required":["filter"],"type":"object"},"UserRolePermission":{"properties":{"action":{"description":"The action, for example \"read:issue\".","type":"string"},"field_restrictions_unsupported":{"description":"True when the action also hides or locks fields through restrictions that the API can't represent.","type":"boolean"},"filter":{"$ref":"#/components/schemas/Filter"},"filter_unsupported":{"description":"True when the action is limited by a filter that the API can't represent, so filter is absent.","type":"boolean"}},"required":["action"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/user-roles":{"get":{"description":"Returns all user roles for the organization, with the actions each role grants.\nPermission and issue access rule filters use the same filter shape that search endpoints accept;\na filter the API can't represent is omitted and marked filter_unsupported. A \"current_user\"\nvalue in a filter means the user the permission is checked for.\n\n**Rate limit:** 300 requests per minute","operationId":"GetUserRoles","responses":{"200":{"$ref":"#/components/responses/GetUserRolesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a list of all user roles","tags":["user-roles"]}}}}
```


---

# 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://docs.usepylon.com/pylon-docs/developer/api/api-reference/user-roles.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.
