POST
/v1/databases/{databaseId}/tablesbetaapiKeyworkspace
When to use
Create a typed table in the managed app schema.
For agents
Requires admin permission. Primary keys must be non-nullable scalar columns. Arbitrary DDL is not accepted.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const result = await client.databases.createTable('dbas_crm123', {
"name": "customers",
"columns": [
{
"name": "id",
"type": "text",
"nullable": false
},
{
"name": "name",
"type": "text",
"nullable": false
}
],
"primaryKey": [
"id"
]
});Request body
{
"name": "customers",
"columns": [
{
"name": "id",
"type": "text",
"nullable": false
},
{
"name": "name",
"type": "text",
"nullable": false
}
],
"primaryKey": [
"id"
]
}Response
{
"data": {
"name": "customers"
}
}