Chuyển tới nội dung chính

Data API management API

Data API service accounts and OAuth2 clients.

This page lists 29 endpoints (OpenAPI tag data-api). It is generated from openapi.json; see the REST API overview for authentication, CSRF and error conventions.

MethodPathOperation idNotes
GET/api/ws/{workspace}/data-api/activity/callsactivity_calls
GET/api/ws/{workspace}/data-api/activity/summaryactivity_summary
DELETE/api/ws/{workspace}/data-api/clients/{id}revoke_client
GET/api/ws/{workspace}/data-api/endpointslist_endpoints
POST/api/ws/{workspace}/data-api/endpointscreate_endpoint
GET/api/ws/{workspace}/data-api/endpoints/{id}get_endpoint
PATCH/api/ws/{workspace}/data-api/endpoints/{id}update_endpoint
DELETE/api/ws/{workspace}/data-api/endpoints/{id}delete_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/bookmarkbookmark_endpoint
DELETE/api/ws/{workspace}/data-api/endpoints/{id}/bookmarkunbookmark_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/disabledisable_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/enableenable_endpointThe other half of disable, and the reason disable keeps live_version_id: without this route that promise is unfalsifiable, and an endpoint taken out of...
GET/api/ws/{workspace}/data-api/endpoints/{id}/grantslist_endpoint_grants
POST/api/ws/{workspace}/data-api/endpoints/{id}/grantsgrant_endpoint_invoke
DELETE/api/ws/{workspace}/data-api/endpoints/{id}/grants/{service_account_id}revoke_endpoint_invoke
POST/api/ws/{workspace}/data-api/endpoints/{id}/previewpreview_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/publishpublish_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/restorerestore_endpointThe other half of trash, and the reason trash keeps the invoke grants and the live version pointer: without this route that promise is unfalsifiable.
POST/api/ws/{workspace}/data-api/endpoints/{id}/rollbackrollback_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/trashtrash_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/trytry_endpoint
POST/api/ws/{workspace}/data-api/endpoints/{id}/validatevalidate_endpoint
GET/api/ws/{workspace}/data-api/endpoints/{id}/versionslist_endpoint_versions
GET/api/ws/{workspace}/data-api/openapiget_openapi
GET/api/ws/{workspace}/data-api/service-accountslist_service_accounts
POST/api/ws/{workspace}/data-api/service-accountscreate_service_account
DELETE/api/ws/{workspace}/data-api/service-accounts/{id}delete_service_account
GET/api/ws/{workspace}/data-api/service-accounts/{id}/clientslist_clients
POST/api/ws/{workspace}/data-api/service-accounts/{id}/clientsissue_client

GET /api/ws/{workspace}/data-api/activity/calls​

Operation id: activity_calls. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
rangequeryActivityRangeyes
endpoint_idquerystring (uuid)no
status_codequeryinteger (int32)no
error_codequerystringno
request_idquerystringno
include_trialsquerybooleannoOff by default. A trial is not consumer traffic, so it must be asked for.
beforequerystring (date-time)noKeyset cursor: return rows strictly older than this.
limitqueryinteger (int64)noHow many rows to return. Default 50, maximum 200; a larger value is clamped to 200 rather than refused.

Response 200 (application/json): array of ActivityCallDto

FieldTypeRequiredDescription
idstring (uuid)yes
tsstring (date-time)yes
endpoint_idstring (uuid), nullableno
endpoint_namestring, nullableno
request_methodstring, nullablenoWhat the caller asked for. The ONLY identification a row carries when endpoint_id is null — see migration 0125.
request_pathstring, nullableno
status_codeinteger (int32)yes
error_codestring, nullableno
duration_msinteger (int32)yes
cache_hitbooleanyes
client_idstring, nullableno
request_idstringyes
actor_user_idstring (uuid), nullablenoNon-null ⇒ a Try-it run by this person, not consumer traffic.
StatusMeaning
200Individual calls in the range, most recent first
401Not authenticated
403Missing data_api_endpoint:read permission
500Internal error

GET /api/ws/{workspace}/data-api/activity/summary​

Operation id: activity_summary. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
rangequeryActivityRangeyes

Response 200 (application/json): ActivitySummaryDto

FieldTypeRequiredDescription
totalActivityRowyesOne line of the statistics table, or — with endpoint_id: None — either the grand total or the unmatched-request bucket, depending on which grouping set produced it.
endpointsActivityRow[]yes
retention_daysinteger (int64), nullablenoDataApiConfig::access_log_retention_days, passed through so the UI can disable ranges that reach past it (spec §4.7).
StatusMeaning
200Call statistics for the range
401Not authenticated
403Missing data_api_endpoint:read permission
500Internal error

DELETE /api/ws/{workspace}/data-api/clients/{id}​

Operation id: revoke_client. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing service_account:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesClient id
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Client revoked. Tokens already minted stay valid for up to DATA_API_TTL_SECS.
401Not authenticated
403Missing service_account:manage permission
404No such client in this workspace
500Internal error

GET /api/ws/{workspace}/data-api/endpoints​

Operation id: list_endpoints. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
trashedquerybooleannoList only trashed endpoints when true; only untrashed ones when absent or false

Response 200 (application/json): array of DataApiEndpointListItemDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
bookmarkedbooleanyesWhether the CALLER has starred this endpoint. Per user, never global.
StatusMeaning
200Endpoint drafts in the workspace, each with the caller's own bookmarked flag
401Not authenticated
403Missing data_api_endpoint:read permission
500Internal error

POST /api/ws/{workspace}/data-api/endpoints​

Operation id: create_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission — :read does not imply authoring.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Request body (application/json): CreateEndpointInput

FieldTypeRequiredDescription
namestringyes
pathstringyesFree-form and user-typed. Total-reject, not normalised: a leading slash is optional and one trailing slash is absorbed, but anything else out of shape — an empty segment, a ./.. segment, percent-encoding, a query string, a fragment,...
database_idstring (uuid)yesThe connection this endpoint queries. Validated against the CALLER's workspace by the route before it is stored — it arrives from the request body, so nothing else would stop it naming another workspace's database.
statementsStatementSpec[]yesThe statements this endpoint runs, in order. Required and non-empty: [egret_dataapi_api::validate_statements] refuses an empty list, a name that is not an identifier, and a repeated name, all as a 400 naming the reason — the schema's own...
methodstring, nullableno
descriptionstringno
folder_idstring (uuid), nullableno
paramsParamSpec[], nullableno
outputOutputSpecno
cacheCacheSpecno
limitsLimitsSpecno
rate_limitRateLimitSpecno
source_kindstring, nullableno
source_refstring (uuid), nullableno

Response 201 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
201Draft created
400Empty name or path, or an unsupported method
401Not authenticated
403Missing data_api_endpoint:manage permission — :read does not imply authoring
404No such database in this workspace
409Another endpoint already serves that method and path
500Internal error

GET /api/ws/{workspace}/data-api/endpoints/{id}​

Operation id: get_endpoint. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200The endpoint draft
401Not authenticated
403Missing data_api_endpoint:read permission
404No such endpoint in this workspace
500Internal error

PATCH /api/ws/{workspace}/data-api/endpoints/{id}​

Operation id: update_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): UpdateEndpointInput

FieldTypeRequiredDescription
namestring, nullableno
pathstring, nullableno
methodstring, nullableno
descriptionstring, nullableno
database_idstring (uuid), nullableno
statementsStatementSpec[], nullablenoReplaces the whole list when present. There is no per-statement patch: the order is part of the definition, so "edit statement 2" and "insert a statement" would need an addressing scheme the list itself already is.
paramsParamSpec[], nullableno
outputOutputSpecno
cacheCacheSpecno
limitsLimitsSpecno
rate_limitRateLimitSpecno
source_kindstring, nullableno
folder_idstring (uuid), nullableno
source_refstring (uuid), nullableno

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200Draft updated
400Empty name or path, or an unsupported method
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint, or no such database, in this workspace
409Another endpoint already serves that method and path, or the endpoint is in the trash — restore it before editing it
500Internal error

DELETE /api/ws/{workspace}/data-api/endpoints/{id}​

Operation id: delete_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Endpoint and its published versions deleted
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint in this workspace
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/bookmark​

Operation id: bookmark_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Endpoint bookmarked for the caller
401Not authenticated
403Missing data_api_endpoint:read permission
404No such endpoint in this workspace
500Internal error

DELETE /api/ws/{workspace}/data-api/endpoints/{id}/bookmark​

Operation id: unbookmark_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Endpoint bookmark removed for the caller
401Not authenticated
403Missing data_api_endpoint:read permission
404No such endpoint in this workspace
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/disable​

Operation id: disable_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200Stopped serving. The live version pointer is kept, so re-enabling needs no re-publish.
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint in this workspace
409The endpoint is in the trash — restore it first
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/enable​

Operation id: enable_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

The other half of disable, and the reason disable keeps live_version_id: without this route that promise is unfalsifiable, and an endpoint taken out of service could only come back by publishing a NEW version — a fresh describe, a new version number, and a fresh chance for the definition to have drifted in the meantime.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200Serving again, from the same version that was live before
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint in this workspace
409The endpoint has never been published, so there is nothing to serve, or it is in the trash — restore it first
500Internal error

GET /api/ws/{workspace}/data-api/endpoints/{id}/grants​

Operation id: list_endpoint_grants. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:manage — listing the grantees is a manage operation, not a read.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): array of DataApiEndpointGrantDto

FieldTypeRequiredDescription
idstring (uuid)yesThe access_grants row id.
service_account_idstring (uuid)yesThe granted service account (its users.id).
service_account_namestring, nullablenoThe account's display name, so the list is readable without a second call. None if the account row has since been deleted.
created_atstring (date-time)yes
StatusMeaning
200Service accounts granted invoke on this endpoint
401Not authenticated
403Missing data_api_endpoint:manage — listing the grantees is a manage operation, not a read
404No such endpoint in this workspace
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/grants​

Operation id: grant_endpoint_invoke. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage — granting invoke rights mutates the authorization graph, so :read does not reach it.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): GrantInvokeInput

FieldTypeRequiredDescription
service_account_idstring (uuid)yesThe service account to grant. Must live in this workspace.

Response 200 (application/json): DataApiEndpointGrantDto

FieldTypeRequiredDescription
idstring (uuid)yesThe access_grants row id.
service_account_idstring (uuid)yesThe granted service account (its users.id).
service_account_namestring, nullablenoThe account's display name, so the list is readable without a second call. None if the account row has since been deleted.
created_atstring (date-time)yes
StatusMeaning
200Granted (idempotent)
401Not authenticated
403Missing data_api_endpoint:manage — granting invoke rights mutates the authorization graph, so :read does not reach it
404No such endpoint, or no such service account, in this workspace
500Internal error

DELETE /api/ws/{workspace}/data-api/endpoints/{id}/grants/{service_account_id}​

Operation id: revoke_endpoint_invoke. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
service_account_idpathstring (uuid)yesService account to revoke
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Revoked (idempotent). Takes effect on the caller's NEXT request — unlike revoking a client, which cannot recall an already-issued token before its 600s TTL expires
401Not authenticated
403Missing data_api_endpoint:manage
404No such endpoint, or no such service account, in this workspace
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/preview​

Operation id: preview_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission, or the engine's policy denies a table the query names.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): PreviewEndpointInput

FieldTypeRequiredDescription
siblingsstring[]noThe SQL text of the endpoint's OTHER statements, as they are on screen.
paramsParamSpec[]noThe parameter declarations as they are on screen right now.
valuesobjectnoThe author's test values, one list per parameter name. A list, not a scalar, because a repeated parameter is a list on the serving path too and preview must resolve it the same way.
outputOutputSpecyesThe response contract as it is on screen — carried for ONE part of it, transform, and applied to nothing.
database_idstring (uuid)yesThe database picker's current value. Workspace-scoped by connection_safety, which answers NotFound for a database belonging to another workspace — this id comes from a request body, so it is exactly the shape that could name someone...

Response 200 (application/json): DataApiPreviewDto

FieldTypeRequiredDescription
columnsColumnMeta[]yes
rowsobject[][]yes
row_countinteger (int64)yes
truncatedbooleanyesTrue when the result was longer than [PREVIEW_MAX_ROWS] and this is a prefix of it. The connector fetches cap + 1 and sets this rather than truncating silently, so row_count == 100 alone cannot tell "exactly at" from "over".
transform_declaredbooleanyesTrue when the draft declares an output.transform — so columns and rows above are the STATEMENT's, and a consumer receives something else entirely (the script's output, described by returns).
generated_sqlstring, nullablenoThe template the statement's build_sql script returned — \{\{ \}\} intact, before any render — or None when the author wrote the SQL themselves (package S Task 7).
StatusMeaning
200The draft ran; up to 100 rows, with the engine's own column names
400Not a single SELECT, a parameter mismatch, a test value that does not satisfy its declared type, SQL the engine rejects — with the engine's own message — or a governed database reached through a connection that does not run queries as the...
401Not authenticated
403Missing data_api_endpoint:manage permission, or the engine's policy denies a table the query names
404No such endpoint in this workspace, or a database_id belonging to another workspace
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/publish​

Operation id: publish_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission, or the engine's policy denies a table.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): PublishEndpointInput

FieldTypeRequiredDescription
notestringnoFree-form "what changed", stored on the version.
acknowledge_breakingstring, nullablenoThe acknowledgement issued by POST …/validate for the breaking changes this publish would make, required only when there are some.

Response 200 (application/json): DataApiPublishedDto

FieldTypeRequiredDescription
version_idstring (uuid)yes
versioninteger (int32)yes
statestringyes
breaking_changesContractChange[], nullablenoThe breaking changes this publish made, which the caller acknowledged to get here (package 6).
compared_againststring (uuid), nullablenoThe version [Self::breaking_changes] is a statement ABOUT: whatever was live at the instant of the publish.
rollback_breaksContractChange[], nullablenoWhat a rollback did to the consumers of the version it moved OFF, classified by the same [crate::contract::compare_contracts] publish uses — and refusing nothing.
StatusMeaning
200A new immutable version was frozen and is now live
400The definition does not validate
401Not authenticated
403Missing data_api_endpoint:manage permission, or the engine's policy denies a table
404No such endpoint in this workspace
409The draft was edited while it was being published; the endpoint is in the trash — restore it first; or this version would break consumers of the live one and acknowledge_breaking was absent, stale, or sent when nothing breaks. The message...
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/restore​

Operation id: restore_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

The other half of trash, and the reason trash keeps the invoke grants and the live version pointer: without this route that promise is unfalsifiable.

Comes back disabled, never live. See [EndpointStore::restore].

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200Endpoint restored from the trash, disabled — never straight back to serving
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint in this workspace
409The endpoint is not in the trash
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/rollback​

Operation id: rollback_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): RollbackEndpointInput

FieldTypeRequiredDescription
versioninteger (int32), nullableno
version_idstring (uuid), nullableno

Response 200 (application/json): DataApiPublishedDto

FieldTypeRequiredDescription
version_idstring (uuid)yes
versioninteger (int32)yes
statestringyes
breaking_changesContractChange[], nullablenoThe breaking changes this publish made, which the caller acknowledged to get here (package 6).
compared_againststring (uuid), nullablenoThe version [Self::breaking_changes] is a statement ABOUT: whatever was live at the instant of the publish.
rollback_breaksContractChange[], nullablenoWhat a rollback did to the consumers of the version it moved OFF, classified by the same [crate::contract::compare_contracts] publish uses — and refusing nothing.
StatusMeaning
200The named version is live again
400Name exactly one of version or version_id
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint here, or no such version OF THIS ENDPOINT
409The endpoint is in the trash — restore it before changing which version it serves; or the named version can no longer be published onto its database (it became governed without a per-principal connection, or a shared cache became...
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/trash​

Operation id: trash_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiEndpointDto

FieldTypeRequiredDescription
idstring (uuid)yes
folder_idstring (uuid), nullableno
namestringyes
descriptionstringyes
pathstringyes
methodstringyes
database_idstring (uuid)yes
statementsStatementSpec[]yesThe endpoint's statements, in execution order.
paramsParamSpec[]yes
outputOutputSpecyes
cacheCacheSpecyes
limitsLimitsSpecyes
rate_limitRateLimitSpecyes
source_kindstringyes
source_refstring (uuid), nullableno
live_version_idstring (uuid), nullablenoThe version currently served. Never written by this module — publishing is a separate lifecycle.
statestringyes
created_bystring (uuid), nullableno
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoWhen this endpoint was moved to the trash, or null if it is live in the authoring sense — present, listed, editable.
StatusMeaning
200Endpoint moved to the trash. Reversible: the row, its published versions and its invoke grants are all kept.
401Not authenticated
403Missing data_api_endpoint:manage permission
404No such endpoint in this workspace
409The endpoint is live — disable it first, so trashing can never take a served URL off the internet by surprise
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/try​

Operation id: try_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage — a trial runs a query as somebody else, so :read does not reach it.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Request body (application/json): TryRequest

FieldTypeRequiredDescription
service_account_idstring (uuid)yes
paramsobjectnoValues exactly as they would arrive on the query string. A Vec per key because a repeated parameter is a LIST (P4.5), and a trial that could only send one value could not exercise the case most likely to be wrong.

Response 200 (application/json): TryResponse

FieldTypeRequiredDescription
statusinteger (int32)yesThe status the SERVING path returned. The trial itself is a 200 whenever it ran — a 403 from the endpoint is a result, not a failure of the trial.
bodyobjectyesThe serving path's own body, verbatim: on success the spec §4.4 envelope \{status, message, data, meta\} — data an array for a one-statement endpoint and an object keyed by statement name for several — or, for an endpoint published with...
requestTryRequestEchoyes
StatusMeaning
200The trial RAN. status and body are the serving path's own answer — a 403 or a 429 in there is a result, not a failure of this route
401Not authenticated
403Missing data_api_endpoint:manage — a trial runs a query as somebody else, so :read does not reach it
404No such endpoint, or no such service account, in this workspace
413The trial RAN, but its result is larger than a console trial will read back; lower the endpoint's row limit or call it with a client
500Internal error

POST /api/ws/{workspace}/data-api/endpoints/{id}/validate​

Operation id: validate_endpoint. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing data_api_endpoint:manage permission, or the engine's policy denies a table the query names.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): DataApiValidationDto

FieldTypeRequiredDescription
statementsStatementSnapshot[]yesExactly what publish would freeze: one entry per statement, in the author's order, each carrying the output schema describe resolved for it — so an author sees the contract before committing to it.
against_liveContractDiffno
acknowledge_breakingstring, nullablenoThe value to send back as acknowledge_breaking on POST …/publish, present exactly when against_live.breaking is non-empty.
StatusMeaning
200The definition is publishable; the resolved output schema is returned, together with what publishing it would do to consumers of the live version and the acknowledgement to send if that includes a breaking change
400Not a single SELECT, a parameter mismatch, an enum without an allowed list, a shared cache on a delegated connection, or SQL the engine rejects
401Not authenticated
403Missing data_api_endpoint:manage permission, or the engine's policy denies a table the query names
404No such endpoint in this workspace, or the query names a relation that does not exist
500Internal error

GET /api/ws/{workspace}/data-api/endpoints/{id}/versions​

Operation id: list_endpoint_versions. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesEndpoint id
workspacepathstringyes

Response 200 (application/json): array of DataApiEndpointVersionDto

FieldTypeRequiredDescription
idstring (uuid)yes
versioninteger (int32)yes
notestringyes
is_livebooleanyesTrue for the version endpoints.live_version_id points at.
created_bystring (uuid), nullableno
created_atstring (date-time)yes
snapshotEndpointSnapshotyesThe frozen definition. This is the only thing P4 may read to decide what a request returns — see the module comment.
breaking_changesContractChange[], nullablenoWhat publishing this version did to the consumers of the one it replaced (package 6), and therefore what its created_by accepted when they acknowledged it.
compared_against_versioninteger (int32), nullablenoThe version NUMBER [Self::breaking_changes] was compared against — whatever was live when this one was published.
StatusMeaning
200Published versions, newest first, each with its frozen snapshot
401Not authenticated
403Missing data_api_endpoint:read permission
404No such endpoint in this workspace
500Internal error

GET /api/ws/{workspace}/data-api/openapi​

Operation id: get_openapi. Auth: Session cookie. Forbidden (403): Missing data_api_endpoint:manage permission. The gate matches /grants LIST, not the other read routes: this document is the grant roster, resolved per service account.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
service_account_idquerystring (uuid)yesWhose invoke rights the document describes.
endpoint_idquerystring (uuid)noNarrow to a single endpoint's contract, e.g. for a per-endpoint download.

Response 200 (application/json): object

StatusMeaning
200OpenAPI 3.0.3 document describing what service_account_id may invoke. servers[0].url already carries the workspace slug, so joining it with a paths key gives the URL a consumer calls. Cache-Control: no-store: the document is per...
400The workspace has more live endpoints than one document may describe; request them one at a time with endpoint_id
401Not authenticated
403Missing data_api_endpoint:manage permission. The gate matches /grants LIST, not the other read routes: this document is the grant roster, resolved per service account
404No such service account in this workspace
409A described endpoint's output naming collides; re-publish it
500Internal error

GET /api/ws/{workspace}/data-api/service-accounts​

Operation id: list_service_accounts. Auth: Session cookie. Forbidden (403): Missing service_account:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Response 200 (application/json): array of DataApiServiceAccountDto

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
emailstringyesThe synthetic address users.email requires. Not a mailbox.
created_atstring (date-time)yes
StatusMeaning
200Service accounts in the workspace
401Not authenticated
403Missing service_account:read permission
500Internal error

POST /api/ws/{workspace}/data-api/service-accounts​

Operation id: create_service_account. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing service_account:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Request body (application/json): CreateServiceAccountInput

FieldTypeRequiredDescription
namestringyes
descriptionstringno

Response 201 (application/json): DataApiServiceAccountDto

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
emailstringyesThe synthetic address users.email requires. Not a mailbox.
created_atstring (date-time)yes
StatusMeaning
201Service account created
400Empty or unusable name
401Not authenticated
403Missing service_account:manage permission
409A service account with that name already exists here
500Internal error

DELETE /api/ws/{workspace}/data-api/service-accounts/{id}​

Operation id: delete_service_account. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing service_account:manage permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesService account id (a users.id)
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Service account, its grants and all its clients deleted
401Not authenticated
403Missing service_account:manage permission
404No such service account in this workspace
409The account still owns content that has no delete rule
500Internal error

GET /api/ws/{workspace}/data-api/service-accounts/{id}/clients​

Operation id: list_clients. Auth: Session cookie. Forbidden (403): Missing service_account:read permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesService account id
workspacepathstringyes

Response 200 (application/json): array of DataApiClientDto

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
client_idstringyes
expires_atstring (date-time), nullableno
last_used_atstring (date-time), nullableno
revoked_atstring (date-time), nullableno
created_atstring (date-time)yes
StatusMeaning
200The account's OAuth2 clients. Never carries secret material.
401Not authenticated
403Missing service_account:read permission
404No such service account in this workspace
500Internal error

POST /api/ws/{workspace}/data-api/service-accounts/{id}/clients​

Operation id: issue_client. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing service_account:manage permission — :read does not imply issuing.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesService account id
workspacepathstringyes

Request body (application/json): IssueClientInput

FieldTypeRequiredDescription
namestringyes
expires_atstring (date-time), nullablenoOptional hard expiry. Absent means the client lives until revoked.

Response 201 (application/json): DataApiNewClientDto

FieldTypeRequiredDescription
idstring (uuid)yes
client_idstringyes
client_secretstringyesShown once; not recoverable afterwards.
token_endpointstringyesWhere to exchange these for a token.
StatusMeaning
201Client issued; client_secret is shown ONCE and is not recoverable
400expires_at out of range
401Not authenticated
403Missing service_account:manage permission — :read does not imply issuing
404No such service account in this workspace
500Internal error