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

# Get Campaign Logs

> List per-recipient delivery and engagement logs for a campaign, newest first. Cursor-paginated. Rows come from the tracking worker (D1) and use snake_case field names. Requires API key with email:read.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/campaigns/{id}/logs
openapi: 3.1.0
info:
  title: Migma.ai API (v1)
  description: >-
    API for managing brands, contacts, email generation, sending, and
    integrations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.migma.ai
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Projects/Brands
    description: Manage projects (brands) and import from websites
  - name: Contacts
    description: Manage your contacts, segments, tags, and topics
  - name: Segments
    description: Create and manage dynamic contact segments
  - name: Tags
    description: Organize contacts with tags
  - name: Topics
    description: Manage subscription topics and preferences
  - name: Emails
    description: Generate, send, and export emails
  - name: Email Validation
    description: Validate email content for compatibility and deliverability
  - name: Email Previews
    description: Preview emails across devices and email clients
  - name: Domains
    description: Manage sending domains and verification
  - name: Webhooks
    description: Manage webhook endpoints for real-time event notifications
  - name: Integrations
    description: Third-party platform integrations
  - name: Campaigns
    description: Create, schedule, send, and manage email campaigns
  - name: Project Editing
    description: Edit project assets, logos, images, and knowledge base entries
paths:
  /v1/campaigns/{id}/logs:
    get:
      tags:
        - Campaigns
      summary: Get Campaign Logs
      description: >-
        List per-recipient delivery and engagement logs for a campaign, newest
        first. Cursor-paginated. Rows come from the tracking worker (D1) and use
        snake_case field names. Requires API key with email:read.
      operationId: GetCampaignLogs
      parameters:
        - name: id
          in: path
          description: Campaign ID
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: Number of rows to return (max 100).
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          description: >-
            Opaque cursor from a previous response's nextCursor. Omit for the
            first page.
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: Filter by delivery or engagement status.
          required: false
          schema:
            type: string
            enum:
              - delivered
              - opened
              - clicked
              - bounced
              - spam_report
      responses:
        '200':
          description: Campaign logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseCampaignLogs'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: javascript
          label: Node.js SDK
          source: |-
            import Migma from 'migma';

            const migma = new Migma('YOUR_API_KEY');

            const { data, error } = await migma.campaigns.logs('CAMPAIGN_ID', {
              limit: 50,
              status: 'opened'
            });
components:
  schemas:
    ApiResponseCampaignLogs:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    $ref: '#/components/schemas/CampaignLog'
                nextCursor:
                  type: string
                  nullable: true
                  description: >-
                    Cursor for the next page, or null when there are no more
                    rows.
                hasMore:
                  type: boolean
              required:
                - emails
                - nextCursor
                - hasMore
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    CampaignLog:
      type: object
      description: >-
        A per-recipient delivery and engagement record. Fields are
        tracking-worker (D1) columns in snake_case.
      properties:
        to_email:
          type: string
          description: Recipient email address.
        subject:
          type: string
          nullable: true
          description: Subject line as sent.
        status:
          type: string
          description: Delivery status, e.g. delivered, bounced, complained, suppressed.
        opened_at:
          type: string
          format: date-time
          nullable: true
          description: First open timestamp, or null if not opened.
        clicked_at:
          type: string
          format: date-time
          nullable: true
          description: First click timestamp, or null if not clicked.
        open_count:
          type: integer
          description: Number of recorded opens.
        click_count:
          type: integer
          description: Number of recorded clicks.
        bounce_type:
          type: string
          nullable: true
          description: Bounce classification when the row bounced, e.g. hard or soft.
        complaint_type:
          type: string
          nullable: true
          description: Complaint classification when the recipient reported the message.
        campaign_id:
          type: string
          description: Campaign this row belongs to.
        created_at:
          type: string
          format: date-time
          description: When the send was logged.
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: string
        code:
          type: string
          description: >-
            Machine-readable error code (e.g., IDEMPOTENCY_CONFLICT,
            DOMAIN_CLAIMABLE).
        data:
          type: object
          description: >-
            Additional structured context for the error, such as the affected
            domain.
          additionalProperties: true
      required:
        - success
        - error
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where
        YOUR_API_KEY is obtained from the Migma dashboard under Settings → API
        Integration.

````