Skip to main content
POST
Run a schema statement on a site's database

Authorizations

Authorization
string
header
required

A member credential in the Authorization: Bearer header: a member session JWT, a portal JWT whose login is linked to a membership in that company, an opaque member token, or a verified One Auth identity access token. The credential alone identifies the member and company. Member session JWTs, and portal JWTs the server minted read-only, are refused with 403 on every write.

Path Parameters

site_id
string<uuid>
required

Public id of one of the member's sites.

Body

application/json

One schema statement to run.

statement
string
required

Exactly one statement of a schema form, such as CREATE TABLE, CREATE INDEX, ALTER TABLE with one action, DROP TABLE, DROP INDEX or COMMENT ON. Rails does not read it. The site's backend refuses, with 422, any statement that could read or copy rows (SELECT, INSERT, UPDATE, DELETE, CREATE TABLE ... AS, COPY, WITH, USING and the rest), a second command, a comment, dollar quoting, and a view, function, trigger, extension, role, schema or sequence. It checks for these words anywhere in the text, so a default or comment that holds one is refused too.

Required string length: 1 - 60000

Response

What the statement did.

What a statement did.

status
integer
required

HTTP status code (mirrors the response status line).

data
object
required

What a statement did.

meta
object
required

Envelope metadata present on every response.