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

# List groups

> List all groups for your partner. Requires a partner API token.



## OpenAPI

````yaml get /groups
openapi: 3.1.0
info:
  title: CookieChimp API
  description: |
    API for CookieChimp.com.

    ## Request bodies

    Resource endpoints expect the resource wrapped under its own key, e.g.
    `{"category": {"name": "Analytics"}}` rather than a bare object.
    `PUT /password` wraps in `user`. Two endpoints take their body unwrapped:
    `POST /auth`, which takes `email` and `password` at the top level, and
    `POST /consent-banners/from-template`, which takes `jurisdiction_id` —
    a selector for which template to build from, not an attribute of the
    banner it creates.

    ## Response envelopes

    Listing endpoints — including `GET /groups` and `GET /accounts` — return
    `{"pagination": {...}, "data": [...]}`. `GET /banner-templates` is the
    exception: it returns `{"data": [...]}` with no pagination, being a fixed
    catalogue rather than a collection of the account's records.
    Most single-resource endpoints
    return `{"data": {...}}`; a single group or account is returned unwrapped.
    Resource-deletion endpoints return `{"message": "..."}`; `DELETE /auth`
    returns an empty object.
  version: 1.2.0
servers:
  - url: https://cookiechimp.com/api/v1
security:
  - authorization: []
paths:
  /groups:
    get:
      tags:
        - Groups
      summary: List groups
      description: List all groups for your partner. Requires a partner API token.
      operationId: listGroups
      parameters:
        - $ref: '#/components/parameters/per_page'
        - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: List of groups
          content:
            application/json:
              schema:
                type: object
                properties:
                  pagination:
                    $ref: '#/components/schemas/GroupPagination'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/PartnerTokenRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    per_page:
      name: per_page
      in: query
      description: |
        Number of records to return per page. The effective range is 1–50; any
        value outside it is accepted but falls back to the default of 20.
      required: false
      schema:
        type: integer
        default: 20
    page:
      name: page
      in: query
      description: |
        Page number. Must be a positive integer; anything else returns a `400`.
        Requesting a page past the end returns the last page.
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
  schemas:
    GroupPagination:
      allOf:
        - $ref: '#/components/schemas/BasePagination'
      example:
        prev_url: /api/v1/groups?page=
        next_url: /api/v1/groups?page=2
        count: 68
        page: 1
        prev: null
        next: 2
    Group:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the group
        partner:
          type: string
          readOnly: true
          description: Name of the partner the group belongs to
        name:
          type: string
          description: Name of the group
        external_id:
          type: string
          description: External ID set by the partner
        max_pageviews_per_month:
          type:
            - integer
            - 'null'
          description: Maximum number of pageviews per month
        max_unique_visitors_per_month:
          type:
            - integer
            - 'null'
          description: Maximum number of unique visitors per month
      example:
        id: abc123
        partner: partner_one
        name: Example Ltd
        external_id: ABC_123
        max_pageviews_per_month: 500000
        max_unique_visitors_per_month: 100000
    BasePagination:
      type: object
      properties:
        prev_url:
          type: string
          description: Path to get the previous page
        next_url:
          type: string
          description: Path to get the next page
        count:
          type: integer
          description: Total number of records across all pages
        page:
          type: integer
          description: Current page
        prev:
          type:
            - integer
            - 'null'
          description: Previous page number, or null on the first page
        next:
          type:
            - integer
            - 'null'
          description: Next page number, or null on the last page
    Error:
      type: object
      description: |
        The standard error envelope, used for authentication, authorization,
        pagination and not-found errors.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
      example:
        errors:
          - code: 401
            message: Invalid API Key
  responses:
    BadRequest:
      description: Invalid pagination parameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 400
                message: Invalid page parameter
    PartnerTokenRequired:
      description: >-
        Missing or invalid API token, or a token that does not belong to a
        partner
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 401
                message: API key must belong to a partner
    RateLimited:
      description: |
        Too many requests. The general limit is 300 requests per 5 minutes per
        API token; the auth endpoints are throttled more tightly per IP.
      headers:
        Retry-After:
          description: Seconds until the current rate-limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 429
                message: Too many requests. Please retry later.
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      description: API token obtained from the login endpoint or the dashboard

````