> ## 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.

# Complete Calendar Event

> Mark a campaign as sent so the calendar stops suggesting it. Requires an API key with project:write. Returns the whole calendar back, so a client never has to guess how the change reordered it. There is deliberately no edit endpoint — Migma’s calendar supports adding, removing and marking done, and nothing else.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/projects/{projectId}/insights/events/{eventId}/complete
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: Events
    description: Record customer events and conversions
  - name: Integrations
    description: Third-party platform integrations
  - name: Campaigns
    description: Create, schedule, send, and manage email campaigns
  - name: Billing
    description: View your plan and credits and create billing links
  - name: Project Editing
    description: Edit project assets, logos, images, and knowledge base entries
paths:
  /v1/projects/{projectId}/insights/events/{eventId}/complete:
    post:
      tags:
        - Projects/Brands
      summary: Complete Calendar Event
      description: >-
        Mark a campaign as sent so the calendar stops suggesting it. Requires an
        API key with project:write. Returns the whole calendar back, so a client
        never has to guess how the change reordered it. There is deliberately no
        edit endpoint — Migma’s calendar supports adding, removing and marking
        done, and nothing else.
      operationId: CompleteBrandCalendarEvent
      parameters:
        - name: projectId
          in: path
          description: Project ID (MongoDB ObjectId)
          required: true
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
        - name: eventId
          in: path
          required: true
          description: The suggestion's id, from the list response.
          schema:
            type: string
      responses:
        '200':
          description: The calendar after the change
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/BrandSuggestions'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    BrandSuggestions:
      type: object
      properties:
        summary:
          type: string
          description: One paragraph on the shape of the calendar as a whole.
        generatedAt:
          type: string
          format: date-time
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/BrandSuggestion'
        total:
          type: integer
          description: How many upcoming campaigns exist in total, regardless of `limit`.
      required:
        - suggestions
    BrandSuggestion:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
          description: Short name for the email, e.g. "Labour Day tech sale email".
        description:
          type: string
          description: One line on what it should say and why now.
        prompt:
          type: string
          description: >-
            A ready-to-send brief — pass it straight to POST
            /v1/projects/emails/generate.
        priority:
          type: string
          enum:
            - high
            - medium
            - low
        category:
          type: string
          description: Short label for display, e.g. "Seasonal", "Promotion".
        suggestedDate:
          type: string
          format: date
          description: >-
            When it is worth sending, as YYYY-MM-DD. Results are ordered by
            this, soonest first, with undated suggestions last; anything already
            sent or in the past is omitted.
        daysUntil:
          type: integer
          description: Days from today to suggestedDate.
      required:
        - id
        - title
        - description
        - prompt
        - priority
    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:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    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 →
        Developers → API Keys.

````