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

# Create campaign model

> Registers a new WhatsApp campaign message template for the tenant on the
given channel/provider, then submits it for provider approval. The
template name is validated against provider-specific rules before being
reserved.



## OpenAPI

````yaml /api/services-api.yaml post /v1/tenants/{tenantID}/campaigns-models
openapi: 3.0.3
info:
  description: >-
    Talqui is an omnichannel customer service platform that unifies
    conversations from WhatsApp, Instagram, Telegram, and many other channels
    into a single attendant panel, alongside a broader ecosystem of plugins and
    integrations. This API gives developers programmatic access to Talqui's
    services layer, exposing the operations needed to read and manage tenants,
    conversations, plugins, and related resources that power that platform.


    Authentication is available on behalf of an Operator (the default for this
    API), a Plugin Connection, or a Plugin — see the [Talqui authentication
    guide](https://docs.talqui.chat/guides/introduction/authentication/) for how
    each token is obtained and when to use it.


    Need help or have questions not covered here? Reach out to
    support@talqui.com.
  license:
    name: ISC
    url: https://opensource.org/license/isc-license-txt
  title: Talqui - Services API
  version: 0.69.1
servers:
  - description: Production
    url: https://services-api.talqui.chat
security: []
tags:
  - name: Tenants
  - name: Settings
  - name: Analytics/Reports
  - name: Analytics
  - name: Campaigns
  - name: Campaigns/Models
  - name: Contacts
  - name: Contacts/Imports
  - name: Handoff links
  - name: Inboxes
  - name: Messages
  - name: Notifications
  - name: Sessions
  - name: Operators/Shortcuts
  - name: Operators
  - name: Plugins
  - name: Setup
  - name: Uploads
paths:
  /v1/tenants/{tenantID}/campaigns-models:
    post:
      tags:
        - Campaigns/Models
      summary: Create campaign model
      description: |-
        Registers a new WhatsApp campaign message template for the tenant on the
        given channel/provider, then submits it for provider approval. The
        template name is validated against provider-specific rules before being
        reserved.
      operationId: CreateCampaignModelController
      parameters:
        - in: path
          name: tenantID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                campaignModelChannel:
                  description: The channel this campaign model targets (e.g. whatsapp).
                  type: string
                campaignModelChannelID:
                  description: >-
                    Identifier of the specific channel connection this campaign
                    model belongs to.
                  type: string
                campaignModelDescription:
                  description: >-
                    Free-text description of the campaign model, for internal
                    reference only.
                  type: string
                campaignModelGatewayMeta:
                  default: {}
                  description: >-
                    Provider-specific display/gateway configuration for this
                    template.
                  properties:
                    displayFormat:
                      description: How the provider should render this template in its UI.
                      enum:
                        - ORDER_DETAILS
                      type: string
                  type: object
                campaignModelMeta:
                  additionalProperties: {}
                  description: Arbitrary metadata attached to the campaign model.
                  type: object
                campaignModelName:
                  description: The name of the campaign model.
                  type: string
                campaignModelSlots:
                  default:
                    body: {}
                    buttons: []
                    footer: {}
                    header: {}
                  description: >-
                    The template content, broken down by provider slot
                    (header/body/buttons/footer).
                  properties:
                    body:
                      additionalProperties: {}
                      default: {}
                      description: >-
                        Body slot content and variable bindings for the
                        template.
                      type: object
                    buttons:
                      default: []
                      description: Interactive buttons attached to the template.
                      items:
                        properties:
                          example:
                            description: >-
                              Example values for variables used in this button,
                              for provider review.
                            items:
                              type: string
                            type: array
                          otp_type:
                            description: >-
                              The one-time-password delivery mode, when type is
                              OTP.
                            enum:
                              - COPY_CODE
                              - ONE_TAP
                              - ZERO_TAP
                            type: string
                          phone_number:
                            description: Target phone number, when type is PHONE_NUMBER.
                            type: string
                          text:
                            description: Label text shown on the button.
                            type: string
                          ttl_minutes:
                            description: >-
                              Minutes before a one-time code button expires,
                              when type is OTP.
                            type: number
                          type:
                            description: The interactive button type.
                            enum:
                              - ORDER_DETAILS
                              - QUICK_REPLY
                              - URL
                              - PHONE_NUMBER
                              - COPY_CODE
                              - VOICE_CALL
                              - OTP
                            type: string
                          url:
                            description: Target URL, when type is URL.
                            type: string
                        required:
                          - type
                        type: object
                      type: array
                    footer:
                      default: {}
                      description: Footer slot content for the template.
                      properties:
                        text:
                          description: Footer text shown below the template body.
                          type: string
                      type: object
                    header:
                      additionalProperties: {}
                      default: {}
                      description: >-
                        Header slot content and variable bindings for the
                        template.
                      type: object
                  type: object
                campaignModelTags:
                  default: []
                  description: Arbitrary tags for organizing/filtering campaign models.
                  items:
                    type: string
                  type: array
                campaignModelType:
                  description: The template type/category as defined by the provider.
                  type: string
              required:
                - campaignModelName
                - campaignModelType
                - campaignModelChannel
                - campaignModelChannelID
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  campaignModel:
                    additionalProperties: false
                    description: The newly created campaign model.
                    properties:
                      __campaignModelErrorCode:
                        description: >-
                          Provider error code, present when the template was
                          refused.
                        type: number
                      __campaignModelErrorMessage:
                        description: >-
                          Provider error message, present when the template was
                          refused.
                        type: string
                      approvedAt:
                        description: >-
                          When the provider approved the template, if
                          applicable.
                        format: date-time
                        nullable: true
                        type: string
                      campaignModelChannel:
                        description: >-
                          The channel this campaign model targets (e.g.
                          whatsapp).
                        type: string
                      campaignModelChannelID:
                        description: >-
                          Identifier of the specific channel connection this
                          campaign model belongs to.
                        type: string
                      campaignModelDescription:
                        description: >-
                          Free-text description of the campaign model, for
                          internal reference only.
                        type: string
                      campaignModelExternalID:
                        description: The provider-assigned identifier for this template.
                        type: string
                      campaignModelGatewayMeta:
                        additionalProperties: {}
                        description: >-
                          Provider-specific display/gateway configuration for
                          this template.
                        type: object
                      campaignModelGatewayRaw:
                        additionalProperties: {}
                        description: Raw, unprocessed payload as returned by the provider.
                        type: object
                      campaignModelID:
                        description: Unique identifier for this campaign model.
                        type: string
                      campaignModelMeta:
                        additionalProperties: {}
                        description: Arbitrary metadata attached to the campaign model.
                        type: object
                      campaignModelName:
                        description: The name of the campaign model.
                        type: string
                      campaignModelSlots:
                        additionalProperties: false
                        description: The template content, broken down by provider slot.
                        properties:
                          body:
                            additionalProperties: false
                            description: Body slot of the template.
                            properties:
                              content:
                                description: Resolved body content.
                                type: string
                              text:
                                description: Resolved body text.
                                type: string
                              variables:
                                description: Variables referenced in the body slot content.
                                items:
                                  additionalProperties: false
                                  properties:
                                    fallback:
                                      description: >-
                                        Value used when the variable cannot be
                                        resolved.
                                      type: string
                                    id:
                                      description: >-
                                        Variable identifier within the body
                                        slot.
                                      type: string
                                    key:
                                      description: >-
                                        Variable name as it appears in the body
                                        content.
                                      type: string
                                    type:
                                      description: The expected variable type.
                                      type: string
                                  required:
                                    - id
                                    - key
                                    - type
                                  type: object
                                type: array
                            required:
                              - content
                              - text
                              - variables
                            type: object
                          buttons:
                            description: Interactive buttons attached to the template.
                            items:
                              additionalProperties: false
                              properties:
                                example:
                                  description: >-
                                    Example value for variables used in this
                                    button, for provider review.
                                  type: string
                                otpType:
                                  description: >-
                                    The one-time-password delivery mode, when
                                    type is OTP.
                                  enum:
                                    - COPY_CODE
                                    - ONE_TAP
                                    - ZERO_TAP
                                  type: string
                                phoneNumber:
                                  description: >-
                                    Target phone number, when type is
                                    PHONE_NUMBER.
                                  type: string
                                text:
                                  description: Label text shown on the button.
                                  type: string
                                ttlMinutes:
                                  description: >-
                                    Minutes before a one-time code button
                                    expires, when type is OTP.
                                  type: number
                                type:
                                  description: The interactive button type.
                                  enum:
                                    - ORDER_DETAILS
                                    - QUICK_REPLY
                                    - URL
                                    - PHONE_NUMBER
                                    - COPY_CODE
                                    - VOICE_CALL
                                    - OTP
                                  type: string
                                url:
                                  description: Target URL, when type is URL.
                                  type: string
                              required:
                                - type
                                - text
                              type: object
                            type: array
                          footer:
                            additionalProperties: false
                            description: Footer slot of the template.
                            properties:
                              text:
                                description: Footer text shown below the template body.
                                type: string
                            type: object
                          header:
                            additionalProperties: false
                            description: Header slot of the template.
                            properties:
                              content:
                                additionalProperties: {}
                                description: Raw provider-specific header content.
                                properties: {}
                                type: object
                              preview:
                                description: Preview text shown for the header slot.
                                type: string
                              text:
                                description: Resolved header text.
                                type: string
                              type:
                                description: Media type of the header slot.
                                enum:
                                  - text
                                  - image
                                  - video
                                  - document
                                  - location
                                type: string
                              variables:
                                description: >-
                                  Variables referenced in the header slot
                                  content.
                                items:
                                  additionalProperties: false
                                  properties:
                                    fallback:
                                      description: >-
                                        Value used when the variable cannot be
                                        resolved.
                                      type: string
                                    id:
                                      description: >-
                                        Variable identifier within the header
                                        slot.
                                      type: string
                                    key:
                                      description: >-
                                        Variable name as it appears in the
                                        header content.
                                      type: string
                                    type:
                                      description: The expected variable type.
                                      type: string
                                  required:
                                    - id
                                    - key
                                    - type
                                  type: object
                                type: array
                            required:
                              - content
                              - preview
                              - text
                              - variables
                            type: object
                        required:
                          - header
                          - body
                          - footer
                          - buttons
                        type: object
                      campaignModelStatus:
                        description: >-
                          Current approval status of the template with the
                          provider.
                        type: string
                      campaignModelTags:
                        description: Tags used for organizing/filtering campaign models.
                        items:
                          type: string
                        type: array
                      campaignModelType:
                        description: The template type/category as defined by the provider.
                        type: string
                      createdAt:
                        description: When this campaign model was created.
                        format: date-time
                        type: string
                      createdBy:
                        description: Identifier of who created this campaign model.
                        type: string
                      deletedAt:
                        description: >-
                          When this campaign model was soft-deleted, if
                          applicable.
                        format: date-time
                        type: string
                      evaluatingAt:
                        description: >-
                          When the provider started evaluating the template, if
                          applicable.
                        format: date-time
                        nullable: true
                        type: string
                      modelVariables:
                        description: >-
                          Variables that must be filled in when sending this
                          template.
                        items:
                          additionalProperties: false
                          properties:
                            fallback:
                              description: Value used when the variable cannot be resolved.
                              type: string
                            key:
                              description: >-
                                The variable name as it appears in the template
                                slot content.
                              type: string
                            required:
                              description: >-
                                Whether the provider requires this variable to
                                be filled.
                              type: boolean
                            type:
                              description: The expected variable type.
                              type: string
                          required:
                            - key
                          type: object
                        type: array
                      processingAt:
                        description: >-
                          When the template was submitted for provider review,
                          if applicable.
                        format: date-time
                        nullable: true
                        type: string
                      refusedAt:
                        description: When the provider refused the template, if applicable.
                        format: date-time
                        nullable: true
                        type: string
                      tenantID:
                        description: The tenant this campaign model belongs to.
                        type: string
                      updatedAt:
                        description: When this campaign model was last updated.
                        format: date-time
                        type: string
                      updatedBy:
                        description: Identifier of who last updated this campaign model.
                        type: string
                    required:
                      - tenantID
                      - campaignModelID
                      - campaignModelChannel
                      - campaignModelChannelID
                      - campaignModelExternalID
                      - campaignModelType
                      - campaignModelName
                      - campaignModelTags
                      - campaignModelStatus
                      - campaignModelMeta
                      - campaignModelSlots
                      - campaignModelGatewayRaw
                      - campaignModelGatewayMeta
                      - processingAt
                      - evaluatingAt
                      - approvedAt
                      - refusedAt
                      - createdBy
                      - createdAt
                      - updatedBy
                      - updatedAt
                    type: object
                required:
                  - campaignModel
                type: object
          description: Response for status 200.
        '400':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/MissingTenantIDError'
                        - $ref: '#/components/schemas/RequestValidationError'
                        - $ref: '#/components/schemas/CampaignModelNameInvalidError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            MissingTenantIDError (error_code 1001): tenantID absent from the
            URL. | RequestValidationError (error_code 1002): request body fails
            schema validation. | CampaignModelNameInvalidError (error_code
            1065): campaignModelName fails provider-specific naming rules.
        '401':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/UnauthorizedError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: 'UnauthorizedError (error_code 1003): missing/invalid operator token.'
        '403':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/ForbiddenError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: 'ForbiddenError (error_code 1004): operator token rejected upstream.'
        '409':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/CampaignModelNameUnavailableError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            CampaignModelNameUnavailableError (error_code 1066):
            campaignModelName already registered for this tenant/channel.
        '500':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/UnknownError'
                    maxItems: 1
                    minItems: 1
                    type: array
                required:
                  - errors
                type: object
          description: >-
            UnknownError (error_code 5999): Unexpected internal error not
            otherwise documented for this endpoint.
      security:
        - operatorAuth: []
components:
  schemas:
    MissingTenantIDError:
      additionalProperties: false
      properties:
        error:
          enum:
            - MissingTenantIDError
          type: string
        error_code:
          enum:
            - 1001
          type: number
        message:
          example: tenantID is required.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    RequestValidationError:
      additionalProperties: false
      properties:
        error:
          enum:
            - RequestValidationError
          type: string
        error_code:
          enum:
            - 1002
          type: number
        fields:
          items:
            additionalProperties: false
            properties:
              allowed:
                type: string
              field:
                type: string
              received:
                type: string
            required:
              - field
              - received
              - allowed
            type: object
          type: array
        message:
          example: Invalid request data.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
        - fields
      type: object
    CampaignModelNameInvalidError:
      additionalProperties: false
      properties:
        error:
          enum:
            - CampaignModelNameInvalidError
          type: string
        error_code:
          enum:
            - 1065
          type: number
        message:
          example: campaignModelName must contain at least one letter or digit.
          type: string
        statusCode:
          enum:
            - 400
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    UnauthorizedError:
      additionalProperties: false
      properties:
        error:
          enum:
            - UnauthorizedError
          type: string
        error_code:
          enum:
            - 1003
          type: number
        message:
          example: You are not authorized to perform this request.
          type: string
        statusCode:
          enum:
            - 401
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    ForbiddenError:
      additionalProperties: false
      properties:
        error:
          enum:
            - ForbiddenError
          type: string
        error_code:
          enum:
            - 1004
          type: number
        message:
          example: You do not have access to this resource.
          type: string
        statusCode:
          enum:
            - 403
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    CampaignModelNameUnavailableError:
      additionalProperties: false
      properties:
        error:
          enum:
            - CampaignModelNameUnavailableError
          type: string
        error_code:
          enum:
            - 1066
          type: number
        message:
          example: Could not derive an available campaignModelName for this channel.
          type: string
        statusCode:
          enum:
            - 409
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
    UnknownError:
      additionalProperties: false
      properties:
        error:
          enum:
            - UnknownError
          type: string
        error_code:
          enum:
            - 5999
          type: number
        message:
          example: For some unknown reason your request has not succeeded.
          type: string
        statusCode:
          enum:
            - 500
          type: number
      required:
        - statusCode
        - error
        - error_code
        - message
      type: object
  securitySchemes:
    operatorAuth:
      bearerFormat: JWT
      description: >-
        Behalf of an Operator (default). A JWT issued by Talqui Core when an
        operator signs in, scoped to every tenant that operator belongs to. Send
        as `Authorization: Bearer <jwt-token>`.
      scheme: bearer
      type: http

````

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