This endpoint can create a complete table in a single API request, as long as all values below are fully fleshed out. If you want to create the table in multiple steps, then just fill out the name field as shown in the example.
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/table \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'table book {
schema {
int id
text title
text description
}
index = [
{type: "primary", field: [{name: "id"}]}
]
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Test Database",
"description": "My test database description",
"docs": "Documentation",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"auth": true,
"tag": [
"example tag"
],
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The body is of type string.
"table book {\n schema {\n int id\n text title\n text description\n }\n index = [\n {type: \"primary\", field: [{name: \"id\"}]}\n ]\n}\n"
Success!
Show child attributes
Was this page helpful?
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/table \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'table book {
schema {
int id
text title
text description
}
index = [
{type: "primary", field: [{name: "id"}]}
]
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Test Database",
"description": "My test database description",
"docs": "Documentation",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"auth": true,
"tag": [
"example tag"
],
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}