> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Falasefemi2/companyflow/llms.txt
> Use this file to discover all available pages before exploring further.

# List Permissions

> Retrieve all permissions for a role

Get a complete list of all permissions assigned to a specific role. Requires Super Admin or HR Manager permissions.

## Path Parameters

<ParamField path="role_id" type="string" required>
  The unique identifier of the role (UUID format)

  **Example:** `"550e8400-e29b-41d4-a716-446655440000"`
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="array">
  Array of permission objects

  <Expandable title="Permission Object">
    <ResponseField name="id" type="string">
      Unique identifier for the permission
    </ResponseField>

    <ResponseField name="role_id" type="string">
      The role this permission belongs to
    </ResponseField>

    <ResponseField name="action" type="string">
      The action that can be performed (e.g., "read", "write", "delete")
    </ResponseField>

    <ResponseField name="resource" type="string">
      The resource the permission applies to (e.g., "employees", "departments")
    </ResponseField>

    <ResponseField name="conditions" type="object">
      Optional conditions that must be met for the permission to apply
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the permission was created
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions',
    {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN"
  }

  response = requests.get(url, headers=headers)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "770e8400-e29b-41d4-a716-446655440000",
        "role_id": "550e8400-e29b-41d4-a716-446655440000",
        "action": "read",
        "resource": "employees",
        "conditions": null,
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "id": "880e8400-e29b-41d4-a716-446655440001",
        "role_id": "550e8400-e29b-41d4-a716-446655440000",
        "action": "write",
        "resource": "employees",
        "conditions": {
          "department": "engineering"
        },
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "id": "990e8400-e29b-41d4-a716-446655440002",
        "role_id": "550e8400-e29b-41d4-a716-446655440000",
        "action": "read",
        "resource": "departments",
        "conditions": null,
        "created_at": "2024-01-15T10:30:00Z"
      }
    ]
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "success": false,
    "message": "invalid role_id"
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "success": false,
    "message": "unauthorized"
  }
  ```
</ResponseExample>
