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

# List groups

> Returns a paginated list of groups in your organization, ordered by name ascending.



## OpenAPI

````yaml /api-reference/openapi.json get /groups
openapi: 3.1.0
info:
  title: ClearPolicy API
  description: >-
    Programmatic access to your organization's people, groups, documents, and
    attestation requests.


    Each API token is limited to 60 requests per minute. Successful responses
    and `429 Too Many Requests` responses include `X-RateLimit-Limit`,
    `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers.
  version: 1.0.0
servers:
  - url: https://api.clearpolicy.app/api/v1
security:
  - bearerAuth: []
paths:
  /groups:
    get:
      tags:
        - Groups
      summary: List groups
      description: >-
        Returns a paginated list of groups in your organization, ordered by name
        ascending.
      operationId: listGroups
      parameters:
        - name: per_page
          in: query
          description: Number of results per page (1–100).
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
        - name: page
          in: query
          description: Page number to retrieve.
          schema:
            type: integer
            minimum: 1
            default: 1
      responses:
        '200':
          description: A paginated list of groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedGroups'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    PaginatedGroups:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Group'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    Group:
      type: object
      required:
        - id
        - organization_id
        - name
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: The ULID of the group.
        organization_id:
          type: string
          description: The ULID of the organization.
        name:
          type: string
          description: The name of the group.
        created_at:
          type: string
          format: date-time
          description: When the group was created.
        updated_at:
          type: string
          format: date-time
          description: When the group was last updated.
    PaginationLinks:
      type: object
      properties:
        first:
          type:
            - string
            - 'null'
        last:
          type:
            - string
            - 'null'
        prev:
          type:
            - string
            - 'null'
        next:
          type:
            - string
            - 'null'
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
        from:
          type:
            - integer
            - 'null'
        last_page:
          type: integer
        per_page:
          type: integer
        to:
          type:
            - integer
            - 'null'
        total:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
  responses:
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: Trial expired or subscription inactive.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              payment_url:
                type: string
                format: uri
    TooManyRequests:
      description: >-
        Rate limit exceeded. Each API token is limited to 60 requests per
        minute.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            example: 42
        X-RateLimit-Limit:
          description: Maximum requests allowed per minute for this token.
          schema:
            type: integer
            example: 60
        X-RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit resets.
          schema:
            type: integer
            example: 1719532800
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token created in ClearPolicy API settings with the `api:use`
        scope.

````