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

# Send or schedule campaign

> Send a campaign immediately or schedule for future delivery



## OpenAPI

````yaml openapi.json POST /campaigns/{id}/send
openapi: 3.0.3
info:
  title: MailGlyph API
  description: >-
    Email platform API for transactional emails, campaigns, and marketing
    automation
  version: 1.0.0
  contact:
    name: MailGlyph Support
    url: https://mailglyph.com
servers:
  - url: https://api.mailglyph.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Public API
    description: Public API endpoints for sending emails and tracking events
  - name: Events
    description: Event ingestion and querying
  - name: Contacts
    description: Contact management operations
  - name: Templates
    description: Email template management
  - name: Campaigns
    description: Email campaign management
  - name: Segments
    description: Audience segmentation
  - name: Workflows
    description: Workflow automation
paths:
  /campaigns/{id}/send:
    post:
      tags:
        - Campaigns
      summary: Send or schedule campaign
      description: Send a campaign immediately or schedule for future delivery
      operationId: sendCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                scheduledFor:
                  type: string
                  format: date-time
                  nullable: true
                  description: >-
                    ISO 8601 timestamp for when to send the campaign. Omit or
                    set to null for immediate send.
      responses:
        '200':
          description: Campaign scheduled/sending
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Campaign'
                  message:
                    type: string
components:
  schemas:
    Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        subject:
          type: string
        body:
          type: string
        from:
          type: string
          format: email
        fromName:
          type: string
          nullable: true
        replyTo:
          type: string
          format: email
          nullable: true
        audienceType:
          type: string
          enum:
            - ALL
            - SEGMENT
            - FILTERED
        audienceCondition:
          $ref: '#/components/schemas/FilterCondition'
        segmentId:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - DRAFT
            - SCHEDULED
            - SENDING
            - SENT
            - CANCELLED
        totalRecipients:
          type: integer
        sentCount:
          type: integer
        deliveredCount:
          type: integer
        openedCount:
          type: integer
        clickedCount:
          type: integer
        bouncedCount:
          type: integer
        scheduledFor:
          type: string
          format: date-time
          nullable: true
        sentAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        segment:
          $ref: '#/components/schemas/Segment'
    FilterCondition:
      type: object
      description: Root segment condition structure using logical groups.
      properties:
        logic:
          type: string
          enum:
            - AND
            - OR
        groups:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/FilterGroup'
      required:
        - logic
        - groups
      additionalProperties: false
    Segment:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - DYNAMIC
            - STATIC
        condition:
          allOf:
            - $ref: '#/components/schemas/FilterCondition'
          nullable: true
        trackMembership:
          type: boolean
        memberCount:
          type: integer
        projectId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FilterGroup:
      type: object
      description: >-
        A group of filters that are combined with AND, with optional nested
        conditions.
      properties:
        filters:
          type: array
          items:
            $ref: '#/components/schemas/SegmentFilter'
        conditions:
          $ref: '#/components/schemas/FilterCondition'
      required:
        - filters
      additionalProperties: false
    SegmentFilter:
      type: object
      description: A single segment filter rule.
      properties:
        field:
          type: string
          description: >-
            Field path to evaluate (for example: email, subscribed, data.plan,
            event.purchase).
        operator:
          type: string
          enum:
            - equals
            - notEquals
            - contains
            - notContains
            - greaterThan
            - lessThan
            - greaterThanOrEqual
            - lessThanOrEqual
            - exists
            - notExists
            - within
            - olderThan
            - triggered
            - triggeredWithin
            - triggeredOlderThan
            - notTriggered
        value:
          description: Comparison value for operators that require it.
        unit:
          type: string
          enum:
            - days
            - hours
            - minutes
          description: >-
            Required for time-based operators such as
            within/olderThan/triggeredWithin/triggeredOlderThan.
      required:
        - field
        - operator
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication. **Secret keys (sk_*)** are required for all
        endpoints except `/v1/track`. **Public keys (pk_*)** only work with the
        `/v1/track` endpoint for client-side event tracking. Workspaces can have
        multiple active keys, and sender-domain operations enforce per-key
        domain scope when configured.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.