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

# Listar matrículas

> As matrículas do club — o direito de um aluno a uma entrega —, da mais
nova para a mais antiga. Os filtros se combinam.




## OpenAPI

````yaml GET /v1/enrollments
openapi: 3.0.3
info:
  title: weve API
  description: >
    Integrações da Weve para quem tem um club: o servidor MCP, o webhook de
    venda

    que a sua plataforma manda e os webhooks de saída que o club manda para o
    seu sistema.
  version: 0.2.0
servers:
  - url: https://api.useweve.com
    description: produção
security: []
tags:
  - name: api
paths:
  /v1/enrollments:
    get:
      tags:
        - api
      summary: Lista as matrículas
      description: |
        As matrículas do club — o direito de um aluno a uma entrega —, da mais
        nova para a mais antiga. Os filtros se combinam.
      operationId: listApiEnrollments
      parameters:
        - name: student_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: delivery_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/WebhookEnrollmentStatus'
        - $ref: '#/components/parameters/ApiLimit'
        - $ref: '#/components/parameters/ApiPage'
      responses:
        '200':
          description: A página pedida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiEnrollmentList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/ApiKeyUnauthorized'
        '403':
          $ref: '#/components/responses/ApiKeyForbidden'
        '422':
          description: '`status` fora dos valores aceitos (`invalid_status`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          $ref: '#/components/responses/ApiKeyTooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKey: []
components:
  schemas:
    WebhookEnrollmentStatus:
      type: string
      enum:
        - active
        - expired
        - revoked
    ApiEnrollmentList:
      type: object
      required:
        - data
        - total
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEnrollment'
        total:
          type: integer
          description: Quantas matrículas o filtro alcança, em todas as páginas.
    ErrorEnvelope:
      type: object
      description: >-
        Envelope único de erro da API. O `code` é o contrato com o cliente — a
        `message` é diagnóstico, e pode mudar.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
    WebhookEnrollment:
      type: object
      required:
        - id
        - status
        - source
        - student
        - delivery
        - cohort
        - product
        - purchase_id
        - subscription_id
        - starts_at
        - expires_at
        - revoked_at
        - revoke_reason
      description: A matrícula — o direito de um aluno a uma entrega — como está agora.
      properties:
        id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/WebhookEnrollmentStatus'
        source:
          $ref: '#/components/schemas/EnrollmentSource'
        student:
          $ref: '#/components/schemas/WebhookStudent'
        delivery:
          $ref: '#/components/schemas/WebhookNamedRef'
        cohort:
          allOf:
            - $ref: '#/components/schemas/WebhookNamedRef'
          nullable: true
        product:
          allOf:
            - $ref: '#/components/schemas/WebhookNamedRef'
          nullable: true
          description: O produto da compra ou da assinatura que abriu a matrícula.
        purchase_id:
          type: string
          format: uuid
          nullable: true
        subscription_id:
          type: string
          format: uuid
          nullable: true
        starts_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: Nulo é vitalício.
        revoked_at:
          type: string
          format: date-time
          nullable: true
        revoke_reason:
          type: string
          nullable: true
    EnrollmentSource:
      type: string
      enum:
        - purchase
        - subscription
        - manual
        - invitation
        - import
        - open_access
        - registration_link
    WebhookStudent:
      type: object
      required:
        - id
        - name
        - email
        - created_at
      description: >
        O aluno, como está no momento em que o evento é montado — segundos
        depois

        do fato. O documento (CPF) não sai em evento nenhum.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          format: email
        created_at:
          type: string
          format: date-time
    WebhookNamedRef:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
  parameters:
    ApiLimit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    ApiPage:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
  responses:
    BadRequest:
      description: Requisição malformada
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ApiKeyUnauthorized:
      description: Chave ausente, inválida, vencida ou revogada (`unauthorized`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ApiKeyForbidden:
      description: |
        A chave vale, mas não alcança o pedido: falta o escopo `write`
        (`insufficient_scope`), quem a criou não administra o club
        (`forbidden`), ou o club desligou o acesso por chave
        (`agent_access_disabled`, `agent_access_admins_only`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ApiKeyTooManyRequests:
      description: Teto de requisições atingido (`rate_limited`); espere o `Retry-After`
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    InternalError:
      description: >-
        Falha inesperada. O corpo nunca traz o erro real — ele fica no log e no
        rastreamento.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        A chave de API do club (`weve_sk_…`), criada em **Ajustes › Chaves de
        API**.

        Vale para UM club, age em nome de quem a criou e com o papel dessa

        pessoa. O escopo `read` libera as leituras; `write`, o resto.

````