v1

latestOpenAPI 3.0.12026-07-1714724311.1 KB
Fields

Update a Field

Update an existing field.

patch/fields/{collection}/{id}

Path parameters

collectionstring required

Unique identifier of the collection the item resides in.

idstring required

Unique identifier of the field.

Request body

fieldstring

Unique name of the field. Field name is unique within the collection.

typestring

Directus specific data type. Used to cast values in the API.

Example request

{
  "field": "id",
  "type": "integer",
  "schema": {
    "name": "title",
    "table": "posts",
    "type": "string",
    "schema": "public"
  },
  "meta": {
    "id": 3,
    "collection": "posts",
    "field": "title",
    "system-interface": "primary-key",
    "locked": true,
    "hidden": true,
    "sort": 1
  }
}

Response

Successful request