---
title: "Update Field Definition"
method: PATCH
path: "/collections/{collectionId}/schema/{fieldDefinitionId}"
tags: ["Schema"]
---

# Update Field Definition

`PATCH /collections/{collectionId}/schema/{fieldDefinitionId}`

## Request

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

This endpoint takes a Field Definition, which is used to update the specified field definition. The easiest way to accomplish this is to modify the values in the response from the GET field definition endpoint and send a PATCH request.

## Path parameters

- `collectionId` integer, required
- `fieldDefinitionId` integer, required

## Request body

- object
  - `name` string: Name of the field
  - `fieldType` string: 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`.
  - `collection` string: Link to the associated collection
  - `isPrimary` boolean: Denotes whether the specified field is part of the primary key. The default value is false
  - `order` string: 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.
  - `default` string: Default value for this field
  - `label` string: Override name for field which is used when displaying to users

## Response `200`

OK with Field Definition containing new or updated fields

- object
  - `uri` string, required: Link to self
  - `name` string, required: Name of the field
  - `fieldType` string, 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`.
  - `collection` string, required: Link to the associated collection
  - `isPrimary` boolean, required: Denotes whether the specified field is part of the primary key. The default value is false
  - `order` string: 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.
  - `default` string: Default value for this field
  - `label` string: Override name for field which is used when displaying to users

---

[API](https://skmtc.dev/lucid/apis/lucid-data-api.md) - [All operations](https://skmtc.dev/lucid/apis/lucid-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lucid/apis/lucid-data-api/revisions/c14ed29dbeab?raw)
