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

# Create automations from recipes

> With validate_only, returns the plan without saving anything. Without it, creates the flows inactive, the emails and WhatsApp texts, and the campaigns as drafts, and records a deployment that can be undone. Nothing is sent. A repeated operation_id returns the deployment already created. Requires an API key with the write scope.



## OpenAPI

````yaml /openapi.en.json post /v1/recipe-deployments
openapi: 3.1.0
info:
  title: Bevits API
  version: 1.0.0
  description: >-
    Public API for querying CRM, purchase, and automation data from a Bevits
    organization, creating automations as drafts for review and activation,
    creating WhatsApp Official campaigns as drafts, and building customer
    segments and tags.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.bevits.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
    description: API availability.
  - name: Identity
    description: Organization and API key identity.
  - name: Customers
    description: Customers and their relationships.
  - name: Segments
    description: Customer segments.
  - name: Purchases
    description: Purchases imported from integrations.
  - name: CRM data
    description: Tags and attribute definitions.
  - name: Automations
    description: Automation flows.
  - name: Campaigns
    description: Email campaigns.
  - name: Account and brand
    description: Account context, brand identity, and images.
  - name: Recipes
    description: Ready-made automations created from recipes, with undo.
  - name: Email templates
    description: Creating and importing email templates.
  - name: Events
    description: Custom events sent by the store and their types.
paths:
  /v1/recipe-deployments:
    post:
      tags:
        - Recipes
      summary: Create automations from recipes
      description: >-
        With validate_only, returns the plan without saving anything. Without
        it, creates the flows inactive, the emails and WhatsApp texts, and the
        campaigns as drafts, and records a deployment that can be undone.
        Nothing is sent. A repeated operation_id returns the deployment already
        created. Requires an API key with the write scope.
      operationId: createFlowsFromRecipes
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFlowsFromRecipesRequest'
            example:
              recipes:
                - recipe: cashback
                  params:
                    cashbackPercent: 10
                    validityDays: 30
                - recipe: abandoned-checkout
              operation_id: 0d6f3c1e-5b7a-4c2e-9f10-6a8b4d2e7c91
              validate_only: true
      responses:
        '200':
          $ref: '#/components/responses/RecipeDeploymentResult'
        '400':
          $ref: '#/components/responses/InvalidBody'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/WriteScopeRequired'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >-
        Unique key for the operation. Repeating the same key with the same body
        returns the original response instead of running it again.
      schema:
        type: string
  schemas:
    CreateFlowsFromRecipesRequest:
      type: object
      properties:
        recipes:
          minItems: 1
          maxItems: 7
          type: array
          items:
            type: object
            properties:
              recipe:
                type: string
                enum:
                  - cashback
                  - abandoned-checkout
                  - post-purchase
                  - winback
                  - vip-campaign
                  - order-shipped
                  - pix-generated
              params:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  anyOf:
                    - type: number
                    - type: boolean
                    - type: string
                    - type: array
                      items:
                        type: string
            required:
              - recipe
        locale:
          type: string
          enum:
            - pt-BR
            - es
            - es-AR
            - en
          description: Language of the generated copy. Defaults to the brand identity's.
        platform:
          type: string
          enum:
            - nuvemshop
            - shopify
            - woocommerce
          description: Store platform. Required when more than one store is connected.
        summary:
          type: string
          maxLength: 500
        validate_only:
          default: false
          type: boolean
          description: Returns the plan without creating anything.
        operation_id:
          $ref: '#/components/schemas/OperationId'
      required:
        - recipes
    OperationId:
      type: string
      minLength: 8
      maxLength: 128
      description: >-
        Optional unique id for this call, such as a UUID. Reuse the same value
        only to retry the same call: the retry returns the first result instead
        of creating again. The same value with a different body is rejected with
        409.
    RecipeDeploymentResult:
      type: object
      properties:
        object:
          type: string
          const: recipe_deployment_result
        validate_only:
          type: boolean
          description: true when the recipes were only planned; nothing was saved.
        plan:
          type: object
          properties:
            platform:
              type: string
              enum:
                - nuvemshop
                - shopify
                - woocommerce
            locale:
              type: string
            currency:
              type: string
            brand_name:
              type: string
            warnings:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  recipe:
                    type: string
                  segment_keys:
                    type: array
                    items:
                      type: string
                required:
                  - code
                additionalProperties: false
            recipes:
              type: array
              items:
                type: object
                properties:
                  recipe:
                    type: string
                  flow_name:
                    type:
                      - string
                      - 'null'
                  steps:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        detail:
                          type: string
                      required:
                        - type
                        - detail
                      additionalProperties: false
                  emails:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        name:
                          type: string
                        subject:
                          type: string
                      required:
                        - key
                        - name
                        - subject
                      additionalProperties: false
                  whatsapp:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        name:
                          type: string
                        text:
                          type: string
                      required:
                        - key
                        - name
                        - text
                      additionalProperties: false
                  campaign:
                    anyOf:
                      - type: object
                        properties:
                          name:
                            type: string
                          segments:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  pattern: ^seg_[A-Za-z0-9_-]+$
                                name:
                                  type: string
                              required:
                                - id
                                - name
                              additionalProperties: false
                          missing_segment_keys:
                            type: array
                            items:
                              type: string
                        required:
                          - name
                          - segments
                          - missing_segment_keys
                        additionalProperties: false
                      - type: 'null'
                required:
                  - recipe
                  - flow_name
                  - steps
                  - emails
                  - whatsapp
                  - campaign
                additionalProperties: false
          required:
            - platform
            - locale
            - currency
            - brand_name
            - warnings
            - recipes
          additionalProperties: false
          description: >-
            What the recipes create. Missing when a repeated operation_id
            returns an earlier deployment.
        deployment:
          $ref: '#/components/schemas/RecipeDeployment'
        next_step:
          type: string
      required:
        - object
        - validate_only
        - next_step
      additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    RateLimitErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          required:
            - retry_after
          properties:
            retry_after:
              type: integer
              minimum: 1
              description: Seconds before retrying.
    RecipeDeployment:
      type: object
      properties:
        object:
          type: string
          const: recipe_deployment
        id:
          type: string
          pattern: ^rdp_[A-Za-z0-9_-]+$
        status:
          type: string
          enum:
            - applied
            - rolled_back
        source:
          type: string
        summary:
          type:
            - string
            - 'null'
        items:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
                enum:
                  - flow
                  - email_template
                  - message_template
                  - email_campaign
                  - brand_asset
              id:
                type: string
              name:
                type: string
              recipe:
                type:
                  - string
                  - 'null'
              html_url:
                type: string
                format: uri
            required:
              - kind
              - id
              - name
              - recipe
            additionalProperties: false
        created_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        rolled_back_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
            - type: 'null'
      required:
        - object
        - id
        - status
        - source
        - summary
        - items
        - created_at
        - rolled_back_at
      additionalProperties: false
    Error:
      type: object
      required:
        - type
        - message
        - request_id
      properties:
        type:
          type: string
          enum:
            - authentication_error
            - conflict
            - internal_error
            - invalid_request
            - not_found
            - permission_denied
            - rate_limited
            - validation_error
        code:
          type: string
          description: >-
            Stable, machine-readable reason within type, such as
            invalid_event_name. Present when the error has a named reason.
        message:
          type: string
        param:
          type: string
          description: >-
            Full path of the offending field, such as customer.email or
            events[3].name.
        suggestion:
          type: string
          description: A value that would be accepted, when there is an obvious one.
        request_id:
          type: string
          pattern: ^req_[a-f0-9]{24}$
  responses:
    RecipeDeploymentResult:
      description: Recipe plan or created deployment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RecipeDeploymentResult'
    InvalidBody:
      description: >-
        Missing request body, a body that is not a JSON object, or an invalid
        route parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing, invalid, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: authentication_error
              message: Invalid API key.
              request_id: req_07f6cdc3c20249d6afcd90b4
    WriteScopeRequired:
      description: The API key does not have the write scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: permission_denied
              code: missing_scope
              message: This API key does not have the required "write" scope.
              param: scope
              request_id: req_07f6cdc3c20249d6afcd90b4
    IdempotencyConflict:
      description: The Idempotency-Key was already used with a different request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: A parameter failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: validation_error
              message: Invalid query parameters.
              param: limit
              request_id: req_07f6cdc3c20249d6afcd90b4
    RateLimited:
      description: Request limit exceeded.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  headers:
    RetryAfter:
      description: Seconds before retrying.
      schema:
        type: integer
        minimum: 1
    RateLimitLimit:
      description: Total limit for the current window.
      schema:
        type: integer
        example: 600
    RateLimitRemaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
        example: 599
    RateLimitReset:
      description: UTC instant when the current window ends.
      schema:
        type: string
        format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: bvt_live_...
      description: API key created in the organization settings.

````

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