Skip to main content
GET
https://sandbox.getcollate.io/api
/
v1
/
tables
/
{id}
/
sampleData
GET /v1/tables/{id}/sampleData
from metadata.sdk import configure
from metadata.sdk.entities import Tables

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

table_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

# Get sample data
sample = Tables.get_sample_data(table_id)
for row in sample.get("rows", []):
    print(row)

# Add sample data
Tables.add_sample_data(table_id, {
    "columns": [
        {"name": "id", "dataType": "INT"},
        {"name": "name", "dataType": "VARCHAR"},
        {"name": "email", "dataType": "VARCHAR"},
        {"name": "created_at", "dataType": "TIMESTAMP"}
    ],
    "rows": [
        [1, "Alice Johnson", "[email protected]", "2024-01-15T10:30:00Z"],
        [2, "Bob Smith", "[email protected]", "2024-02-20T14:15:00Z"],
        [3, "Carol Williams", "[email protected]", "2024-03-10T09:45:00Z"]
    ]
})

# Delete sample data
Tables.delete_sample_data(table_id)
{
  "columns": [
    {"name": "agent_id", "dataType": "VARCHAR"},
    {"name": "performance_score", "dataType": "DECIMAL"}
  ],
  "rows": [
    ["AGT-001", 92.5],
    ["AGT-002", 87.3],
    ["AGT-003", 95.1]
  ]
}

Table Sample Data

Manage sample data rows for a table. Sample data provides a preview of the table’s contents and is useful for data discovery and documentation.

Get Sample Data

GET /v1/tables/{id}/sampleData
id
string
required
UUID of the table.

Add Sample Data

PUT /v1/tables/{id}/sampleData
id
string
required
UUID of the table.
columns
array
required
Array of column references describing the sample data columns.
rows
array
required
Array of row arrays. Each row is an array of values matching the column order.

Delete Sample Data

DELETE /v1/tables/{id}/sampleData
id
string
required
UUID of the table.
GET /v1/tables/{id}/sampleData
from metadata.sdk import configure
from metadata.sdk.entities import Tables

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

table_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

# Get sample data
sample = Tables.get_sample_data(table_id)
for row in sample.get("rows", []):
    print(row)

# Add sample data
Tables.add_sample_data(table_id, {
    "columns": [
        {"name": "id", "dataType": "INT"},
        {"name": "name", "dataType": "VARCHAR"},
        {"name": "email", "dataType": "VARCHAR"},
        {"name": "created_at", "dataType": "TIMESTAMP"}
    ],
    "rows": [
        [1, "Alice Johnson", "[email protected]", "2024-01-15T10:30:00Z"],
        [2, "Bob Smith", "[email protected]", "2024-02-20T14:15:00Z"],
        [3, "Carol Williams", "[email protected]", "2024-03-10T09:45:00Z"]
    ]
})

# Delete sample data
Tables.delete_sample_data(table_id)
{
  "columns": [
    {"name": "agent_id", "dataType": "VARCHAR"},
    {"name": "performance_score", "dataType": "DECIMAL"}
  ],
  "rows": [
    ["AGT-001", 92.5],
    ["AGT-002", 87.3],
    ["AGT-003", 95.1]
  ]
}

Returns

Get returns the sample data object with columns and rows arrays. Add returns the updated sample data object. Delete returns no content (204).

Response

columns
array
Array of column definitions for the sample data.
rows
array
Array of row arrays. Each row contains values in the same order as the columns.

Error Handling

CodeError TypeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission
404NOT_FOUNDTable does not exist or has no sample data