> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bedrock.quarry-systems.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Roles by Scope

> Retrieve all roles defined within a specific scope

## Path Parameters

<ParamField path="scopeId" type="string" required>
  The scope ID to get roles for
</ParamField>

## Response

Returns an array of role objects belonging to the specified scope.

<ResponseField name="roles" type="array">
  <Expandable title="Role object">
    <ResponseField name="id" type="string">
      Unique identifier for the role
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name of the role
    </ResponseField>

    <ResponseField name="description" type="string">
      Description of the role
    </ResponseField>

    <ResponseField name="scopeId" type="string">
      The scope this role belongs to
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.example.com/roles/by-scope/scope_123' \
    -H 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const { data } = await axios.get('https://api.example.com/roles/by-scope/scope_123', {
    headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  [
    {
      "id": "role_1",
      "name": "Admin",
      "description": "Full administrative access",
      "scopeId": "scope_123"
    },
    {
      "id": "role_2",
      "name": "Viewer",
      "description": "Read-only access",
      "scopeId": "scope_123"
    }
  ]
  ```
</ResponseExample>
