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

# Update a campaign

> Update a campaign's settings. Only draft campaigns can be updated. You can configure the name, subject, template, sender, audience, preview text, reply-to address, and schedule.



## OpenAPI

````yaml PUT /campaigns/{id}
openapi: 3.1.0
info:
  title: SendKit API
  description: The SendKit API allows you to send transactional emails programmatically.
  version: 1.0.0
servers:
  - url: https://api.sendkit.dev
security:
  - bearerAuth: []
paths:
  /campaigns/{id}:
    put:
      tags:
        - Campaigns
      summary: Update a campaign
      description: >-
        Update a campaign's settings. Only draft campaigns can be updated. You
        can configure the name, subject, template, sender, audience, preview
        text, reply-to address, and schedule.
      operationId: updateCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The campaign ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignRequest'
      responses:
        '200':
          description: Campaign updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    UpdateCampaignRequest:
      type: object
      properties:
        name:
          type: string
          description: The campaign name.
          maxLength: 255
        subject:
          type: string
          description: The email subject line.
          maxLength: 255
        email_template_id:
          type: string
          format: uuid
          description: The email template ID to use.
        sender_id:
          type: string
          format: uuid
          description: The sender ID to send from.
        audience_type:
          type: string
          enum:
            - all_contacts
            - contact_list
            - segment
          description: The audience type.
        audience_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            The contact list or segment ID. Required when audience_type is
            contact_list or segment.
        preview_text:
          type: string
          nullable: true
          description: Preview text shown in email clients.
          maxLength: 255
        reply_to:
          type: string
          format: email
          nullable: true
          description: Reply-to email address.
          maxLength: 255
        scheduled_at:
          type: string
          format: date-time
          nullable: true
          description: Schedule the campaign for a future date. Must be in the future.
    Campaign:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          example: March Newsletter
        subject:
          type: string
          nullable: true
          example: Our latest updates
        preview_text:
          type: string
          nullable: true
          example: Check out what's new
        reply_to:
          type: string
          nullable: true
          example: support@example.com
        status:
          type: string
          enum:
            - draft
            - scheduled
            - sending
            - sent
            - partial_sent
          example: draft
        audience_type:
          type: string
          enum:
            - all_contacts
            - contact_list
            - segment
          example: contact_list
        audience_id:
          type: string
          format: uuid
          nullable: true
        template:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
              example: Newsletter Template
        sender:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
              example: Marketing Team
            email:
              type: string
              example: marketing@example.com
        total_recipients:
          type: integer
          example: 1500
        sent_count:
          type: integer
          example: 1200
        failed_count:
          type: integer
          example: 5
        scheduled_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-03-15 10:00:00'
        sent_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-03-11 14:30:00'
        created_at:
          type: string
          format: date-time
          example: '2026-03-10 09:00:00'
    ErrorResponse:
      type: object
      properties:
        name:
          type: string
          description: Error type identifier.
          example: validation_error
        message:
          type: string
          description: Human-readable error message.
          example: The from address domain is not verified.
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Invalid API key.
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Not found.
    ValidationError:
      description: Validation error — invalid or missing parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: The email field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from your SendKit dashboard. Pass it as a Bearer token in the
        Authorization header.

````