Skip to content
Navigation

Create a data-object definition

Creates a new organization-level definition. Authorization: organization administrators only — other callers get 403. Body describes the schema: nameSingular/namePlural, labels, fields[] (13 field types, plus composites), fieldGroups[], labelFieldKey, icon/color. Invalid schema returns 422 validation_failed (with issues). Returns 201 with { definition }.

POST
https://api.cloudraker.com/objects/definitions
Try it
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Request body JSON required

  • nameSingular
    string
    required
    maxLength: 64 · minLength: 1
  • labelSingular
    string
    required
    maxLength: 200 · minLength: 1
  • labelPlural
    string
    required
    maxLength: 200 · minLength: 1
  • namePlural
    string
    required
    maxLength: 64 · minLength: 1
  • icon
    string
    required
    maxLength: 64 · minLength: 1
  • labelFieldKey
    string
    required
    minLength: 1
  • fields
    array of
    map<unknown>
    required

    Field descriptors. Each names a key, a type and its type-specific options.

  • description
    optional
    string

    Free-form description of the definition. Omitted means empty.

    maxLength: 2000
  • color
    optional
    string
    or null
  • fieldGroups
    optional
    array of
    map<unknown>

Returns

201

The created definition.

JSON
  • definition
    object
    required
    • _id
      string
      required
    • nameSingular
      string
      required
    • namePlural
      string
      required
    • labelSingular
      string
      required
    • labelPlural
      string
      required
    • description
      string
      required
    • icon
      string
      required
    • color
      string | null
      required
    • labelFieldKey
      string
      required

      Field key whose value is the object’s display label.

    • fields
      array of
      map<unknown>
      required

      The type-discriminated field model (13 field types plus composites). Emitted permissively so the resource stays navigable.

    • fieldGroups
      array of
      map<unknown>
      required
    • version
      number
      required

      Bumps only on a schema-affecting change.

    • archivedAt
      required

      Any of the following:

      • string
      • null
    • createdAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • updatedAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • createdBy
      string
      required

403

Caller is not an org admin.

422

validation_failed — the definition body is invalid (see issues).

Type to search…

↑↓ navigate↵ selectEsc close