Skip to main content

Create document or record

Motivation​

Create a new CDoc, WDoc, CRecord or WRecord using API

Functional Design​

POST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}

Headers​

KeyValue
AuthorizationBearer {PrincipalToken}
Content-Typeapplication/json

Parameters​

ParameterTypeDescription
ownerstringname of a user who owns the application
appstringname of an application
wsidint64the ID of workspace
pkg, tablestringidentifies a table (document or record)

Body​

JSON object: CDoc/WDoc/CRecord/WRecord

Result​

CodeDescriptionBody
201Createdcurrent WLog offset and the new IDs, see below
400Bad Request, e.g. Record requires sys.ParentIDerror object
401Unauthorizederror object
403Forbiddenerror object
404Table Not Founderror object
405Method Not Allowed, table is an ODoc/ORecorderror object

Example result 201:

{
"currentWLogOffset":114,
"newIDs": {
"1":322685000131212
}
}