> ## Documentation Index
> Fetch the complete documentation index at: https://uiform-codex-generated-frontend-snippets.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore Workflow Version

Restore a workflow graph version into a new workflow draft.

```python Python theme={null}
workflow_version_id = "wfv_abc123"
print(workflow_version_id)
```

```typescript TypeScript theme={null}
const workflowVersionId = "wfv_abc123";
console.log(workflowVersionId);
```

```go Go theme={null}
workflowVersionID := "wfv_abc123"
_ = workflowVersionID
```

```java Java theme={null}
String workflowVersionId = "wfv_abc123";
System.out.println(workflowVersionId);
```

```bash cURL theme={null}
curl -X POST "https://api.retab.com/v1/workflows/versions/wfv_abc123/restore?workflow_id=wf_abc123" \
  -H "Authorization: Bearer $RETAB_API_KEY"
```


## OpenAPI

````yaml POST /v1/workflows/versions/{workflow_version_id}/restore
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/versions/{workflow_version_id}/restore:
    post:
      tags:
        - Workflows
        - Workflow Versions
      summary: Restore Workflow Version
      operationId: restore_workflow_version
      parameters:
        - in: path
          name: workflow_version_id
          required: true
          schema:
            type: string
            title: Workflow Version Id
        - in: query
          name: workflow_id
          required: true
          schema:
            type: string
            description: Workflow to restore into a new draft
            title: Workflow Id
          description: Workflow to restore into a new draft
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Workflow:
      properties:
        id:
          type: string
          title: Id
          description: Unique ID for this workflow
        name:
          type: string
          title: Name
          description: The name of the workflow
          default: Untitled Workflow
        description:
          type: string
          title: Description
          description: Description of the workflow
          default: ''
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
          description: >-
            Project that owns this workflow. Null only on legacy rows that
            predate the project backfill.
        published:
          anyOf:
            - $ref: '#/components/schemas/WorkflowPublished'
            - type: 'null'
          description: Published workflow metadata when a published version exists
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        capabilities:
          anyOf:
            - items:
                type: string
                enum:
                  - workflow:view
                  - workflow:edit
                  - workflow:run
                  - workflow:delete
                  - workflow:publish
                  - workflow:review
                  - workflow:manage
              type: array
            - type: 'null'
          title: Capabilities
          description: Server-derived permissions for the current actor.
        authz_status:
          anyOf:
            - type: string
              enum:
                - provisioning
                - ready
                - failed
                - deleting
                - deleted
            - type: 'null'
          title: Authz Status
          description: Provisioning state of this workflow's WorkOS authorization resource.
      type: object
      required:
        - created_at
        - id
        - updated_at
      title: Workflow
      description: A workflow and its current configuration.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    WorkflowPublished:
      properties:
        version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Id
          description: Published content-addressed workflow version ID
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
          description: When the workflow was last published
        description:
          type: string
          title: Description
          description: >-
            Release note attached to the currently published version. Echoes the
            `description` body passed to `POST /v1/workflows/{id}/publish` so
            the caller can confirm it was stored without a separate fetch.
          default: ''
      type: object
      title: WorkflowPublished
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          default: null
        ctx:
          type: object
          title: Context
          default: {}
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````