> ## 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 Table Schema

Return the column schema for a CSV-backed table.

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

  client = Retab()

  schema = client.tables.schema(table_id="workflow_table_123")
  print(schema)
  ```

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

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

  const schema = await client.tables.schema("workflow_table_123");
  console.log(schema);
  ```

  ```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)
  	}

  	schema, err := client.Tables.Schema(ctx, "workflow_table_123")
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(*schema)
  }
  ```

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

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

  schema = client.tables.schema(table_id: 'workflow_table_123')
  puts schema
  ```

  ```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 schema = client.tables().schema("workflow_table_123").await?;
      println!("{:?}", schema);
      Ok(())
  }
  ```

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

  use Retab\Client;

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

  $result = $client->tables()->schema(
      tableId: 'workflow_table_123',
  );
  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.Tables.SchemaAsync("workflow_table_123");
  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.tables().schema("workflow_table_123");
      System.out.println(result);
    }
  }
  ```

  ```bash cURL theme={null}
  curl https://api.retab.com/v1/tables/workflow_table_123/schema \
    -H "Authorization: Bearer $RETAB_API_KEY"
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/tables/{table_id}/schema
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/tables/{table_id}/schema:
    get:
      tags:
        - Tables
      summary: Table.Get Schema
      operationId: get_table_schema
      parameters:
        - in: path
          name: table_id
          required: true
          schema:
            type: string
            title: Table Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowTableSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowTableSchemaResponse:
      properties:
        table_id:
          type: string
          title: Table Id
        columns:
          items:
            $ref: '#/components/schemas/WorkflowTableColumn'
          type: array
          title: Columns
          default: []
      type: object
      required:
        - table_id
      title: WorkflowTableSchemaResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    WorkflowTableColumn:
      properties:
        name:
          type: string
          title: Name
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
          default: {}
        sample_values:
          items:
            type: string
          type: array
          title: Sample Values
          default: []
        required:
          type: boolean
          title: Required
          default: false
        unique:
          type: boolean
          title: Unique
          default: false
      type: object
      required:
        - name
      title: WorkflowTableColumn
    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

````