> ## 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.

# Get Experiment

> Retrieve a single experiment.

Identified by `experiment_id`. Returns the experiment along with its
latest-run status, score, staleness, and schema-drift detection. Returns
404 if no experiment with that ID exists.

Fetch one experiment by id. The response includes the latest run status,
score, staleness, and schema-drift information — the same shape as the
listing endpoint.

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

  client = Retab()

  experiment = client.workflows.experiments.get(
      experiment_id="exp_abc",
  )
  ```

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

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

  const experiment = await client.workflows.experiments.get("exp_abc");
  ```

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

  import (
  	"context"
  	"fmt"
  	"log"

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

  func ptr[T any](v T) *T { return &v }

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

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

  	experiment, err := client.Workflows.Experiments.Get(ctx, "exp_abc")
  	if err != nil {
  		log.Fatal(err)
  	}

  	fmt.Println(experiment.ID)
  }
  ```

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

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

  experiment = client.workflows.experiments.get(experiment_id: 'exp_abc')

  puts experiment.id
  ```

  ```rust Rust theme={null}
  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 experiment = client.workflows().experiments().get("exp_abc").await?;
      println!("{}", experiment.id);
      Ok(())
  }
  ```

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

  use Retab\Client;

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

  $result = $client->workflows()->experiments()->get(
      experimentId: 'exp_abc123',
  );
  print_r($result);
  ```

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

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

  var result = await client.Workflows.Experiments.GetAsync("exp_abc123");
  Console.WriteLine(result);
  ```

  ```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 result = client.workflows().experiments().get("exp_abc123");
      System.out.println(result);
    }
  }
  ```

  ```curl cURL theme={null}
  curl -X 'GET' \
    'https://api.retab.com/v1/workflows/experiments/exp_abc' \
    -H 'Authorization: Bearer <your-api-key>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "exp_abc",
    "workflow_id": "wf_abc123",
    "block_id": "extract-invoice",
    "block_kind": "extract",
    "n_consensus": 5,
    "document_count": 12,
    "name": "Q1 invoices",
    "last_run_id": "exprun_1",
    "status": "completed",
    "score": 0.87,
    "is_stale": false,
    "schema_drift": "none",
    "schema_drift_detail": null,
    "created_at": "2026-05-01T14:30:00Z",
    "updated_at": "2026-05-02T09:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Experiment not found: exp_abc"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/workflows/experiments/{experiment_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/experiments/{experiment_id}:
    get:
      tags:
        - Workflows
        - Workflow Experiments
      summary: Get Experiment
      description: |-
        Retrieve a single experiment.

        Identified by `experiment_id`. Returns the experiment along with its
        latest-run status, score, staleness, and schema-drift detection. Returns
        404 if no experiment with that ID exists.
      operationId: get_experiment
      parameters:
        - in: path
          name: experiment_id
          required: true
          schema:
            type: string
            title: Experiment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowExperiment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowExperiment:
      properties:
        id:
          type: string
          title: Id
        workflow_id:
          type: string
          title: Workflow Id
        block_id:
          type: string
          title: Block Id
        n_consensus:
          type: integer
          enum:
            - 3
            - 5
            - 7
          title: N Consensus
        document_count:
          type: integer
          title: Document Count
          default: 0
        name:
          type: string
          title: Name
        last_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run Id
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the experiment was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the experiment was last updated
        status:
          type: string
          enum:
            - draft
            - processing
            - completed
            - failed
            - cancelled
          title: Status
          default: draft
        block_type:
          type: string
          enum:
            - extract
            - classifier
            - split
            - for_each
          title: Block Type
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
        is_stale:
          type: boolean
          title: Is Stale
          default: false
        freshness:
          $ref: '#/components/schemas/ArtifactFreshness'
        freshness_state:
          type: string
          enum:
            - fresh
            - stale
            - unknown
          title: Freshness State
          default: unknown
        freshness_reasons:
          items:
            type: string
          type: array
          title: Freshness Reasons
          default: []
        run_plan_mode:
          type: string
          enum:
            - run
            - noop
            - conflict
            - unknown
          title: Run Plan Mode
          default: unknown
        rerunnable_document_count:
          type: integer
          title: Rerunnable Document Count
          default: 0
        schema_drift:
          type: string
          enum:
            - none
            - partial
            - drifted
            - unknown
          title: Schema Drift
          default: unknown
        schema_drift_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Drift Detail
        drift:
          $ref: '#/components/schemas/ArtifactDrift'
      type: object
      required:
        - block_id
        - block_type
        - id
        - n_consensus
        - name
        - workflow_id
      title: WorkflowExperiment
      description: >-
        An experiment that evaluates a workflow block against a set of
        documents, with its latest run status and score.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    ArtifactFreshness:
      properties:
        status:
          type: string
          enum:
            - fresh
            - stale
            - unknown
          title: Status
          default: unknown
        reasons:
          items:
            type: string
            enum:
              - validity_changed
              - inputs_changed
              - engine_changed
              - metrics_engine_changed
              - no_baseline
          type: array
          title: Reasons
          default: []
        validity_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Validity Fingerprint
        input_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Input Fingerprint
        baseline_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Baseline Run Id
      type: object
      title: ArtifactFreshness
    ArtifactDrift:
      properties:
        status:
          type: string
          enum:
            - none
            - drifted
            - broken
            - unknown
          title: Status
          default: unknown
        affected_targets:
          items:
            type: string
          type: array
          title: Affected Targets
          default: []
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: ArtifactDrift
    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

````