Schema

Update Field Definitions

This endpoint allows updating multiple field definitions at once. The easiest way to accomplish this is to modify the values in the response from the get all field definitions endpoint and send a PATCH request. Changing the values will update existing field definitions within the collection's schema. Any fields sent without a uri field will result in an addition to the schema if the name field is unique within the schema. Fields cannot be deleted with this endpoint.

patch/collections/{collectionId}/schema

Request

  • Base URL
    https://data.lucid.app
  • URL
    https://data.lucid.app/collections/{collectionId}/schema
  • Auth
    OAuth 2
    Authorization code: https://lucid.app/oauth2/authorize
    Token URL: https://api.lucid.co/oauth2/token scopes: data-service.admin

Path parameters

collectionIdinteger required

ID of collection to update field definitions for

Request body

uristring required

Link to self

namestring required

Name of the field

fieldTypestring required

Stores the type of the field. The type does not affect how the data is interpreted in the Data Service; it is for use on the client side. Valid values include BOOLEAN, STRING, NUMBER, and ANY.

collectionstring required

Link to the associated collection

isPrimaryboolean required

Denotes whether the specified field is part of the primary key. The default value is false

orderstring

Denotes a default ordering for the fields. This is currently used by the Lucid client to determine the order in which the fields are displayed, unless the context suggests a better ordering.

defaultstring

Default value for this field

labelstring

Override name for field which is used when displaying to users

Example request

[
  {
    "uri": "https://data.lucid.app/collections/2/schema/4",
    "name": "Co1B",
    "fieldType": "STRING",
    "collection": "https://data.lucid.app/collections/2",
    "isPrimary": false,
    "order": "1",
    "default": "5",
    "label": "User Friendly Field Name"
  }
]

Response

OK with Array[Field Definition] containing new or updated fields on the collection

uristring required

Link to self

namestring required

Name of the field

fieldTypestring required

Stores the type of the field. The type does not affect how the data is interpreted in the Data Service; it is for use on the client side. Valid values include BOOLEAN, STRING, NUMBER, and ANY.

collectionstring required

Link to the associated collection

isPrimaryboolean required

Denotes whether the specified field is part of the primary key. The default value is false

orderstring

Denotes a default ordering for the fields. This is currently used by the Lucid client to determine the order in which the fields are displayed, unless the context suggests a better ordering.

defaultstring

Default value for this field

labelstring

Override name for field which is used when displaying to users

Example response

[
  {
    "uri": "https://data.lucid.app/collections/2/schema/4",
    "name": "Co1B",
    "fieldType": "STRING",
    "collection": "https://data.lucid.app/collections/2",
    "isPrimary": false,
    "order": "1",
    "default": "5",
    "label": "User Friendly Field Name"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.