> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ref.scoutos.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ref.scoutos.com/_mcp/server.

# Get a tables schema by ID.

GET https://api.scoutos.com/v2/collections/{collection_id}/tables/{table_id}/schema

Reference: https://ref.scoutos.com/api-sdk/endpoints/tables/get-schema

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `collection_id` (string, required)
- `table_id` (string, required)

## Response

### 200

Successful Response

- `data` (list of ColumnTypeBase, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ColumnTypeBase

- `column_type` (enum, required)
  - Allowed values: `checkbox`, `json`, `number`, `select`, `multi-select`, `text-long`, `text-short`, `datetime`, `url`, `markdown`, `relation`, `people`
- `data_type` (enum, required)
  - Allowed values: `boolean`, `string`, `number`, `datetime`, `string[]`
- `column_id` (string, optional)
- `column_display_name` (string, optional, nullable)
- `hidden` (boolean, optional, default: false)
- `automation_config` (ColumnTypeBaseAutomationConfig, optional, nullable) — Optional automation configuration to automatically calculate values for this column

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ColumnTypeBaseAutomationConfig

Optional automation configuration to automatically calculate values for this column

- TypescriptAutomationConfig: TypescriptAutomationConfig

### ValidationErrorLocItems

- string
- integer

### TypescriptAutomationConfig

TypeScript function-based automation

- `function` (string, required) — TypeScript function code
- `mode` ("typescript", optional)
- `button_text` (string, optional, nullable) — Custom text for the run button
- `executing_text` (string, optional, nullable) — Custom text while executing

## Examples

**Response**

```json
{
  "data": [
    {
      "column_type": "checkbox",
      "data_type": "boolean",
      "column_id": "col_9f8a7b6c",
      "column_display_name": "Is Active",
      "hidden": false,
      "automation_config": {
        "mode": "typescript",
        "button_text": "Toggle Active Status",
        "executing_text": "Updating status...",
        "function": "function toggleActive(row) { return !row.isActive; }"
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```typescript
import { ScoutClient } from "scoutos";

const client = new ScoutClient({ apiKey: "YOUR_API_KEY" });
await client.tables.getSchema("collection_id", "table_id");

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.scoutos.com/v2/collections/collection_id/tables/table_id/schema")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```