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

# Version To Draft

> Copy any selected published version into a NEW independent draft.

version_id is the automation_versions resource UUID from the versions list,
never version_int. The source draft and live definition remain unchanged.
An older version of an active parent can be selected. Copies start with a
fresh re-entry ledger and can enroll original contacts on explicit
activation, even with re_entry_mode=never. Pause the original first to stop
new admissions; its existing runs continue. Location is the new resource.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/automations/{automation_id}/versions/{version_id}/draft
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/hubs/{hub_id}/automations/{automation_id}/versions/{version_id}/draft:
    post:
      tags:
        - automations
      summary: Version To Draft
      description: >-
        Copy any selected published version into a NEW independent draft.


        version_id is the automation_versions resource UUID from the versions
        list,

        never version_int. The source draft and live definition remain
        unchanged.

        An older version of an active parent can be selected. Copies start with
        a

        fresh re-entry ledger and can enroll original contacts on explicit

        activation, even with re_entry_mode=never. Pause the original first to
        stop

        new admissions; its existing runs continue. Location is the new
        resource.
      operationId: >-
        automations.post_automations_post_teams_by_team_id_hubs_by_hub_id_automations_by_automation_id_versions_by_version_id_draft
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
        - in: path
          name: automation_id
          required: true
          schema:
            title: Automation Id
            type: string
        - in: path
          name: version_id
          required: true
          schema:
            format: uuid
            title: Version Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AutomationCopyEnvelope'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/AutomationResponse'
          description: Independent draft created
          headers:
            Location:
              description: Canonical URL of the new automation (GET follows)
              schema:
                type: string
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Bad request
        '401':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not authenticated
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Forbidden
        '404':
          content:
            application/vnd.api+json:
              examples:
                automation_not_found:
                  value:
                    errors:
                      - code: automation_not_found
                        detail: Automation 'id' not found.
                        meta:
                          request_id: request-id
                        status: '404'
                        title: Not Found
                automation_version_not_found:
                  value:
                    errors:
                      - code: automation_version_not_found
                        detail: >-
                          Published version 'uuid' not found for this
                          automation.
                        meta:
                          request_id: request-id
                        status: '404'
                        title: Not Found
                hub_not_found:
                  value:
                    errors:
                      - code: hub_not_found
                        detail: Hub 'hub' not found or does not belong to team 'team'.
                        meta:
                          request_id: request-id
                        status: '404'
                        title: Not Found
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not found
        '415':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Unsupported media type (requires application/vnd.api+json)
        '422':
          content:
            application/vnd.api+json:
              examples:
                graph_validation_error:
                  value:
                    errors:
                      - code: graph_validation_error
                        detail: >-
                          Cannot copy node 'branch': missing, deleted or
                          cross-team tag 'id'.
                        meta:
                          request_id: request-id
                        source:
                          pointer: >-
                            /data/attributes/definition/nodes/0/config/condition_tree/groups/0/conditions/0/value/tag_id
                        status: '422'
                        title: Unprocessable Entity
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Graph validation error
        '429':
          content:
            application/vnd.api+json:
              examples:
                rate_limited:
                  value:
                    errors:
                      - code: rate_limited
                        detail: Too many requests. Please try again later.
                        meta:
                          request_id: request-id
                        status: '429'
                        title: Too Many Requests
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: 'Shared authoring limit: 60 requests/hour per client IP'
        '503':
          content:
            application/vnd.api+json:
              examples:
                service_unavailable:
                  value:
                    errors:
                      - code: service_unavailable
                        detail: Service temporarily unavailable.
                        meta:
                          request_id: request-id
                        status: '503'
                        title: Service Unavailable
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Service temporarily unavailable
      security:
        - HTTPBearer: []
components:
  schemas:
    AutomationCopyEnvelope:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/AutomationCopyResource'
      required:
        - data
      title: AutomationCopyEnvelope
      type: object
    AutomationResponse:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/AutomationResource'
      required:
        - data
      title: AutomationResponse
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    AutomationCopyResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/AutomationCopyAttributes'
        type:
          const: automations
          title: Type
          type: string
      required:
        - type
        - attributes
      title: AutomationCopyResource
      type: object
    AutomationResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/AutomationAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        type:
          const: automations
          default: automations
          title: Type
          type: string
      required:
        - id
        - attributes
      title: AutomationResource
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    AutomationCopyAttributes:
      additionalProperties: false
      properties:
        name:
          maxLength: 255
          minLength: 1
          title: Name
          type: string
      title: AutomationCopyAttributes
      type: object
    AutomationAttributes:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        current_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Version Id
        deleted_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Deleted At
        hub_id:
          title: Hub Id
          type: string
        name:
          title: Name
          type: string
        re_entry_interval_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Re Entry Interval Seconds
        re_entry_mode:
          title: Re Entry Mode
          type: string
        settings:
          additionalProperties: true
          title: Settings
          type: object
        status:
          title: Status
          type: string
        subject_type:
          default: contact
          title: Subject Type
          type: string
        team_id:
          title: Team Id
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - team_id
        - hub_id
        - name
        - status
        - re_entry_mode
        - re_entry_interval_seconds
        - current_version_id
        - settings
        - created_by
        - created_at
        - updated_at
      title: AutomationAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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