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

# Create a campaign draft from a campaign template



## OpenAPI

````yaml /openapi.json post /campaign_templates/{id}/campaign_drafts
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /campaign_templates/{id}/campaign_drafts:
    post:
      tags:
        - Campaigns
      summary: Create a campaign draft from a campaign template
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the campaign template
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                business:
                  type: string
                  description: The business ID
              required:
                - business
      responses:
        '200':
          description: The created `Campaign` object
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: The name of the campaign
                  enrolled_customers:
                    anyOf:
                      - type: array
                        items:
                          type: string
                      - type: array
                        items:
                          $ref: '#/components/schemas/Customer'
                    description: The customers enrolled in the campaign
                  segment:
                    type: string
                    nullable: true
                    description: The segment attached to the campaign
                  steps:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - email
                              description: The step type. Always "email" for this step
                            custom_step_id:
                              type: string
                              description: >-
                                Optional. The ID of the custom step to use in
                                this step. The type of the custom step must be
                                "email" as well
                            email_template_id:
                              type: string
                              description: The ID of the email template to use in this step
                          required:
                            - type
                            - email_template_id
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - email
                              description: The step type. Always "email" for this step
                            custom_step_id:
                              type: string
                              description: >-
                                Optional. The ID of the custom step to use in
                                this step. The type of the custom step must be
                                "email" as well
                            subject:
                              type: string
                              description: >-
                                The subject of the email template to use at this
                                step
                            body:
                              type: string
                              description: >-
                                The body of the email template to use at this
                                step
                          required:
                            - type
                            - subject
                            - body
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - sms
                              description: The step type. Always "sms" for this step
                            custom_step_id:
                              type: string
                              description: >-
                                Optional. The ID of the custom step to use in
                                this step. The type of the custom step must be
                                "sms" as well
                            sms_template_id:
                              type: string
                              description: The ID of the SMS template to use in this step
                          required:
                            - type
                            - sms_template_id
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - sms
                              description: The step type. Always "sms" for this step
                            custom_step_id:
                              type: string
                              description: >-
                                Optional. The ID of the custom step to use in
                                this step. The type of the custom step must be
                                "sms" as well
                            message:
                              type: string
                              description: The message to send in this step
                          required:
                            - type
                            - message
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - wait
                              description: The step type. Always "wait" for this step
                            duration:
                              type: integer
                              description: The number of seconds to wait
                          required:
                            - type
                            - duration
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - if
                              description: The step type. Always "if" for this step
                            filter:
                              type: string
                              description: The filter to use in this step
                          required:
                            - type
                            - filter
                    description: The steps of the campaign
                required:
                  - name
                  - enrolled_customers
                  - segment
                  - steps
components:
  schemas:
    Customer:
      type: object
      properties:
        id:
          type: string
          description: The ID of the customer
        external_id:
          type: string
          nullable: true
          description: The external ID of the customer
        email_address:
          type: string
          nullable: true
          description: The email address of the customer
        phone_number:
          type: string
          nullable: true
          description: The phone number of the customer
        full_name:
          type: string
          nullable: true
          description: The full name of the customer
        metadata:
          type: object
          additionalProperties: true
          description: The metadata associated with this customer
        unsubscribed:
          type: string
          enum:
            - future
            - campaign
          nullable: true
          description: The unsubscribe status of the customer
      required:
        - id
        - external_id
        - email_address
        - phone_number
        - full_name
        - metadata
        - unsubscribed
      title: The Customer object
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````