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

# List Block Versions

List immutable workflow block versions for a workflow.

<RequestExample>
  ```python Python theme={null}
  from retab import Retab

  client = Retab()

  versions = client.workflows.blocks.list_versions(workflow_id="wf_abc123")
  print(versions)
  ```

  ```typescript TypeScript theme={null}
  import { Retab } from "@retab/node";

  const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

  const versions = await client.workflows.blocks.list_versions({
    workflowId: "wf_abc123",
  });
  console.log(versions);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	retab "github.com/retab-dev/retab/clients/go"
  )

  func main() {
  	ctx := context.Background()

  	client, err := retab.NewClient("")
  	if err != nil {
  		log.Fatal(err)
  	}

  	versions, err := client.Workflows.Blocks.ListVersions(ctx, &retab.WorkflowBlocksListVersionsParams{
  		WorkflowID: "wf_abc123",
  	})
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(versions.Data)
  }
  ```

  ```ruby Ruby theme={null}
  require 'retab'

  client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

  versions = client.workflows.blocks.list_versions(workflow_id: 'wf_abc123')
  puts versions
  ```

  ```rust Rust theme={null}
  use retab::resources::workflow_blocks::ListVersionsParams;
  use retab::Retab;

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let client = Retab::new(std::env::var("RETAB_API_KEY")?);

      let versions = client
          .workflows()
          .blocks()
          .list_versions(ListVersionsParams::new("wf_abc123"))
          .await?;
      println!("{:?}", versions.data);
      Ok(())
  }
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  use Retab\Client;

  $client = new Client(apiKey: getenv('RETAB_API_KEY'));

  $versions = $client->workflows()->blocks()->listVersions(
      workflowId: 'wf_abc123',
  );
  print_r($versions);
  ```

  ```csharp C# theme={null}
  using Retab;
  using RetabClient = Retab.Retab;

  var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
  var client = new RetabClient(apiKey);

  var versions = await client.Workflows.Blocks.ListVersionsAsync(new WorkflowBlocksListVersionsOptions
  {
      WorkflowId = "wf_abc123",
  });
  Console.WriteLine(versions);
  ```

  ```java Java theme={null}
  import com.retab.RetabClient;

  public final class Example {
    public static void main(String[] args) throws Exception {
      RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

      var versions = client.workflows().blocks().listVersions(
          "wf_abc123", null, null, null, null, null);
      System.out.println(versions);
    }
  }
  ```

  ```bash cURL theme={null}
  curl "https://api.retab.com/v1/workflows/blocks/versions?workflow_id=wf_abc123" \
    -H "Authorization: Bearer $RETAB_API_KEY"
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/workflows/blocks/versions
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/blocks/versions:
    get:
      tags:
        - Workflows
        - Workflow Blocks
      summary: List Block Versions
      operationId: list_block_versions
      parameters:
        - in: query
          name: workflow_id
          required: true
          schema:
            type: string
            title: Workflow Id
        - in: query
          name: block_id
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by stable block ID
            title: Block Id
          required: false
          description: Filter by stable block ID
        - in: query
          name: workflow_version_id
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by workflow version ID
            title: Workflow Version Id
          required: false
          description: Filter by workflow version ID
        - in: query
          name: before
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Block version cursor before
            title: Before
          required: false
          description: Block version cursor before
        - in: query
          name: after
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Block version cursor after
            title: After
          required: false
          description: Block version cursor after
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of block versions to return
            default: 50
            title: Limit
          required: false
          description: Maximum number of block versions to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowBlockVersionList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowBlockVersionList:
      description: >-
        A page of `WorkflowBlockVersion` resources. `data` holds the items and
        `list_metadata` carries the `before`/`after` cursors; pass `after` to
        fetch the next page.
      properties:
        data:
          items:
            $ref: '#/components/schemas/WorkflowBlockVersion'
          type: array
          title: Data
        list_metadata:
          $ref: '#/components/schemas/ListMetadata'
      type: object
      required:
        - data
        - list_metadata
      title: WorkflowBlockVersionList
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    WorkflowBlockVersion:
      properties:
        id:
          type: string
          title: Id
          description: Public content-addressed block version ID
        block_id:
          type: string
          title: Block Id
          description: Stable logical block ID
        workflow_id:
          type: string
          title: Workflow Id
          description: Source workflow ID
        workflow_version_id:
          type: string
          title: Workflow Version Id
          description: Workflow version this block version belongs to
        type:
          type: string
          enum:
            - start_document
            - start_json
            - note
            - parse
            - edit
            - extract
            - split
            - classifier
            - conditional
            - api_call
            - function
            - while_loop
            - for_each
            - merge_dicts
            - while_loop_sentinel_start
            - while_loop_sentinel_end
            - for_each_sentinel_start
            - for_each_sentinel_end
          title: Type
        label:
          type: string
          title: Label
          default: ''
        position_x:
          type: number
          title: Position X
          default: 0
        position_y:
          type: number
          title: Position Y
          default: 0
        width:
          anyOf:
            - type: number
            - type: 'null'
          title: Width
        height:
          anyOf:
            - type: number
            - type: 'null'
          title: Height
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
        resolved_schemas:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Resolved Schemas
        config_hash:
          type: string
          title: Config Hash
          description: Stable SHA-256 hash of the executable block config
          default: ''
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - block_id
        - created_at
        - id
        - type
        - workflow_id
        - workflow_version_id
      title: WorkflowBlockVersion
      description: Public block version resource without tenant or storage-only fields.
    ListMetadata:
      properties:
        before:
          anyOf:
            - type: string
            - type: 'null'
          title: Before
        after:
          anyOf:
            - type: string
            - type: 'null'
          title: After
      type: object
      required:
        - after
        - before
      title: ListMetadata
      description: Boundary resource IDs for page navigation.
    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

````