v1

latestOpenAPI 3.0.12026-07-1714724311.1 KB
Relations

Update a Relation

Update an existing relation

patch/relations/{id}

Path parameters

idinteger required

Index

Query parameters

fieldsstring[]

Control what fields are being returned in the object.

metastring

What metadata to return in the response.

Request body

collection_manystring

Collection that has the field that holds the foreign key.

collection_onestring

Collection on the one side of the relationship.

field_manystring

Foreign key. Field that holds the primary key of the related collection.

field_onestring

Alias column that serves as the one side of the relationship.

junction_fieldstring

Field on the junction table that holds the primary key of the related collection.

Example request

{
  "field_one": "books"
}

Response

Successful request

Example response

{
  "data": {
    "id": 1,
    "many_collection": "directus_activity",
    "many_field": "user",
    "one_collection": "directus_users"
  }
}