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

Data Apps API

Per-workspace data apps: CRUD, folders, trash, bookmarks, revisioned drafts, publish, versions.

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

MethodPathOperation idNotes
GET/api/ws/{workspace}/appslist
POST/api/ws/{workspace}/appscreate
GET/api/ws/{workspace}/apps/capabilitiescapabilities
GET/api/ws/{workspace}/apps/{id}get_one
PATCH/api/ws/{workspace}/apps/{id}update
DELETE/api/ws/{workspace}/apps/{id}delete_app
POST/api/ws/{workspace}/apps/{id}/bookmarkbookmark_add
DELETE/api/ws/{workspace}/apps/{id}/bookmarkbookmark_remove
GET/api/ws/{workspace}/apps/{id}/draftdraft_get
PUT/api/ws/{workspace}/apps/{id}/draftdraft_put
POST/api/ws/{workspace}/apps/{id}/duplicateduplicate
PATCH/api/ws/{workspace}/apps/{id}/folderset_folder
POST/api/ws/{workspace}/apps/{id}/publishpublish
POST/api/ws/{workspace}/apps/{id}/restorerestore
POST/api/ws/{workspace}/apps/{id}/ticketticket
POST/api/ws/{workspace}/apps/{id}/trashtrash
GET/api/ws/{workspace}/apps/{id}/versionsversions
GET/api/ws/{workspace}/apps/{id}/versions/{version_id}version_get
POST/api/ws/{workspace}/apps/{id}/versions/{version_id}/restoreversion_restore

GET /api/ws/{workspace}/apps​

Operation id: list. Auth: Session cookie. Forbidden (403): Missing app:read, or the apps feature is disabled.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
trashedquerybooleannoList the trash bin instead of live apps when true

Response 200 (application/json): array of AppSummary

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
folder_idstring (uuid), nullableno
owner_user_idstring (uuid), nullableno
is_ownerbooleanyesThe caller created this app (metadata only; access is role/share based).
updated_atstring (date-time)yes
deleted_atstring (date-time), nullablenoSet while the app is in the trash.
bookmarkedbooleanyesBookmarked by the caller.
draft_revisioninteger (int64)yes
latest_version_nointeger (int32), nullablenoNone until the first publish.
can_writebooleanyesThe caller holds app:write on THIS app (per object: a share on one app makes it true on that row only).
can_managebooleanyesThe caller holds app:manage on THIS app (sharing, permanent delete).
StatusMeaning
200Apps in the workspace, most recently updated first
401Not authenticated
403Missing app:read, or the apps feature is disabled
500Internal error

POST /api/ws/{workspace}/apps​

Operation id: create. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write, or the apps feature is disabled.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Request body (application/json): AppCreate

FieldTypeRequiredDescription
namestringyes
descriptionstring, nullableno
folder_idstring (uuid), nullablenoAn app folder of this workspace.
databasestring, nullablenoA database (by name) of this workspace; the template's connection cell is pre-filled with it.

Response 201 (application/json): AppDetail

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
folder_idstring (uuid), nullableno
owner_user_idstring (uuid), nullableno
is_ownerbooleanyes
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullableno
bookmarkedbooleanyes
draft_revisioninteger (int64)yes
latest_version_nointeger (int32), nullableno
can_writebooleanyesThe caller holds app:write on THIS app (per object: a share on one app makes it true on that row only).
can_managebooleanyesThe caller holds app:manage on THIS app (sharing, permanent delete).
StatusMeaning
201App created with a revision-1 draft from the template
400Empty name
401Not authenticated
403Missing app:write, or the apps feature is disabled
404The folder or database is not in this workspace
500Internal error

GET /api/ws/{workspace}/apps/capabilities​

Operation id: capabilities. Auth: Session cookie. Forbidden (403): Missing app:read, or the apps feature is disabled.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Response 200 (application/json): AppCapabilities

FieldTypeRequiredDescription
can_createbooleanyesThe caller holds app:write in the workspace: POST /apps will not be refused for lack of permission.
StatusMeaning
200What the caller may do with apps in this workspace
401Not authenticated
403Missing app:read, or the apps feature is disabled
500Internal error

GET /api/ws/{workspace}/apps/{id}​

Operation id: get_one. Auth: Session cookie. Forbidden (403): Missing app:read on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Response 200 (application/json): AppDetail

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
folder_idstring (uuid), nullableno
owner_user_idstring (uuid), nullableno
is_ownerbooleanyes
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullableno
bookmarkedbooleanyes
draft_revisioninteger (int64)yes
latest_version_nointeger (int32), nullableno
can_writebooleanyesThe caller holds app:write on THIS app (per object: a share on one app makes it true on that row only).
can_managebooleanyesThe caller holds app:manage on THIS app (sharing, permanent delete).
StatusMeaning
200The app (also when trashed; see deleted_at)
401Not authenticated
403Missing app:read on this app
404No such app in this workspace
500Internal error

PATCH /api/ws/{workspace}/apps/{id}​

Operation id: update. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Request body (application/json): AppUpdate

FieldTypeRequiredDescription
namestring, nullableno
descriptionstring, nullableno

Response 200 (application/json): AppDetail

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
folder_idstring (uuid), nullableno
owner_user_idstring (uuid), nullableno
is_ownerbooleanyes
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullableno
bookmarkedbooleanyes
draft_revisioninteger (int64)yes
latest_version_nointeger (int32), nullableno
can_writebooleanyesThe caller holds app:write on THIS app (per object: a share on one app makes it true on that row only).
can_managebooleanyesThe caller holds app:manage on THIS app (sharing, permanent delete).
StatusMeaning
200App renamed / re-described
400Empty name
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
409The app is in the trash
500Internal error

DELETE /api/ws/{workspace}/apps/{id}​

Operation id: delete_app. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:manage on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes
StatusMeaning
204The app is permanently deleted, with its draft, versions, shares and every user's bookmark of it. Irreversible
401Not authenticated
403Missing app:manage on this app
404No such app in this workspace
409The app is not in the trash; move it to Trash first
500Internal error

POST /api/ws/{workspace}/apps/{id}/bookmark​

Operation id: bookmark_add. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:read on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes
StatusMeaning
204App bookmarked for the caller
401Not authenticated
403Missing app:read on this app
404No such app in this workspace
500Internal error

DELETE /api/ws/{workspace}/apps/{id}/bookmark​

Operation id: bookmark_remove. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:read on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes
StatusMeaning
204The caller's bookmark removed
401Not authenticated
403Missing app:read on this app
404No such app in this workspace
500Internal error

GET /api/ws/{workspace}/apps/{id}/draft​

Operation id: draft_get. Auth: Session cookie. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Response 200 (application/json): AppDraft

FieldTypeRequiredDescription
sourcestringyes
layoutobjectnomarimo's grid-layout companion file, verbatim JSON; omitted for the default vertical arrangement.
revisioninteger (int64)yes
StatusMeaning
200The draft; ETag is its quoted revision
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
500Internal error

PUT /api/ws/{workspace}/apps/{id}/draft​

Operation id: draft_put. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
If-MatchheaderstringyesThe revision the edit is based on, quoted or bare
workspacepathstringyes

Request body (application/json): AppSaveDraft

FieldTypeRequiredDescription
sourcestringyesmarimo source, at most 1 MiB (1 048 576 bytes).
layoutobjectnoThe complete new layout state; omit or send null to clear it.

Response 200 (application/json): AppDraftSaved

FieldTypeRequiredDescription
revisioninteger (int64)yes
StatusMeaning
200Saved; ETag is the new quoted revision
400If-Match is not a revision
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
409Stale revision (reload current_revision), or the app is in the trash
413Source exceeds 1 MiB
428If-Match is missing
500Internal error

POST /api/ws/{workspace}/apps/{id}/duplicate​

Operation id: duplicate. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app, or app:write in the workspace.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp to copy
workspacepathstringyes

Response 201 (application/json): AppDetail

FieldTypeRequiredDescription
idstring (uuid)yes
namestringyes
descriptionstringyes
folder_idstring (uuid), nullableno
owner_user_idstring (uuid), nullableno
is_ownerbooleanyes
created_atstring (date-time)yes
updated_atstring (date-time)yes
deleted_atstring (date-time), nullableno
bookmarkedbooleanyes
draft_revisioninteger (int64)yes
latest_version_nointeger (int32), nullableno
can_writebooleanyesThe caller holds app:write on THIS app (per object: a share on one app makes it true on that row only).
can_managebooleanyesThe caller holds app:manage on THIS app (sharing, permanent delete).
StatusMeaning
201A new app named Copy of <name>, owned by the caller, in the source's folder, whose revision-1 draft is the source's current draft (source and layout). Versions, shares and bookmarks are not copied
401Not authenticated
403Missing app:write on this app, or app:write in the workspace
404No such app in this workspace
409The app is in the trash
500Internal error

PATCH /api/ws/{workspace}/apps/{id}/folder​

Operation id: set_folder. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Request body (application/json): AppSetFolder

FieldTypeRequiredDescription
folder_idstring (uuid), nullableno
StatusMeaning
204App moved to the folder (or back to Uncategorized)
401Not authenticated
403Missing app:write on this app
404No such app, or the folder is not an app folder of this workspace
409The app is in the trash
500Internal error

POST /api/ws/{workspace}/apps/{id}/publish​

Operation id: publish. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Request body (application/json): AppPublish, one of null, AppPublish.

Response 201 (application/json): AppVersionSummary

FieldTypeRequiredDescription
idstring (uuid)yes
version_nointeger (int32)yes
from_revisioninteger (int64), nullablenoThe draft revision this version was published from; None for a restore.
restored_fromstring (uuid), nullablenoThe version this one republished; None for a publish.
published_bystring (uuid), nullableno
published_atstring (date-time)yes
StatusMeaning
201The draft published as a new version
400The body is not an AppPublish
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
409expected_revision is stale (reload current_revision), or the app is in the trash
500Internal error

POST /api/ws/{workspace}/apps/{id}/restore​

Operation id: restore. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes
StatusMeaning
204App restored from the trash
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
500Internal error

POST /api/ws/{workspace}/apps/{id}/ticket​

Operation id: ticket. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:read (run) or app:write + query:run (edit).

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Request body (application/json): AppTicketRequest

FieldTypeRequiredDescription
modeAppTicketModeyes
version_idstring (uuid), nullablenoRun mode only: the version to open. Omitted = the latest published version.

Response 200 (application/json): AppTicket

FieldTypeRequiredDescription
urlstringyes
StatusMeaning
200A one-time URL for the apps-origin iframe
400An edit ticket cannot name a version
401Not authenticated
403Missing app:read (run) or app:write + query:run (edit)
404No such app or version in this workspace
409The app is in the trash, or (run) has no published version
500Internal error
503The apps origin is not configured

POST /api/ws/{workspace}/apps/{id}/trash​

Operation id: trash. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes
StatusMeaning
204App moved to the trash
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
500Internal error

GET /api/ws/{workspace}/apps/{id}/versions​

Operation id: versions. Auth: Session cookie. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
workspacepathstringyes

Response 200 (application/json): array of AppVersionSummary

FieldTypeRequiredDescription
idstring (uuid)yes
version_nointeger (int32)yes
from_revisioninteger (int64), nullablenoThe draft revision this version was published from; None for a restore.
restored_fromstring (uuid), nullablenoThe version this one republished; None for a publish.
published_bystring (uuid), nullableno
published_atstring (date-time)yes
StatusMeaning
200Published versions, newest first
401Not authenticated
403Missing app:write on this app
404No such app in this workspace
500Internal error

GET /api/ws/{workspace}/apps/{id}/versions/{version_id}​

Operation id: version_get. Auth: Session cookie. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
version_idpathstring (uuid)yesVersion id
workspacepathstringyes

Response 200 (application/json): AppVersion

FieldTypeRequiredDescription
idstring (uuid)yes
version_nointeger (int32)yes
from_revisioninteger (int64), nullablenoThe draft revision this version was published from; None for a restore.
restored_fromstring (uuid), nullablenoThe version this one republished; None for a publish.
published_bystring (uuid), nullableno
published_atstring (date-time)yes
sourcestringyes
StatusMeaning
200The version with its source
401Not authenticated
403Missing app:write on this app
404No such app in this workspace, or no such version of it
500Internal error

POST /api/ws/{workspace}/apps/{id}/versions/{version_id}/restore​

Operation id: version_restore. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing app:write on this app.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesApp id
version_idpathstring (uuid)yesVersion to republish
workspacepathstringyes

Response 201 (application/json): AppVersionSummary

FieldTypeRequiredDescription
idstring (uuid)yes
version_nointeger (int32)yes
from_revisioninteger (int64), nullablenoThe draft revision this version was published from; None for a restore.
restored_fromstring (uuid), nullablenoThe version this one republished; None for a publish.
published_bystring (uuid), nullableno
published_atstring (date-time)yes
StatusMeaning
201The version's source republished as a new version; the draft is untouched
401Not authenticated
403Missing app:write on this app
404No such app in this workspace, or no such version of it
409The app is in the trash
500Internal error