Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/directus/directus/llms.txt

Use this file to discover all available pages before exploring further.

Relations define how collections are linked together (M2O, O2M, M2M, M2A).

List Relations

Retrieve all relations.
GET /relations
Example:
curl "https://your-directus-instance.com/relations" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Relation

Retrieve a single relation.
GET /relations/:collection/:field

Create Relation

Create a new relationship.
POST /relations
Request Body (Many-to-One):
{
  "collection": "articles",
  "field": "author",
  "related_collection": "users",
  "meta": {
    "one_field": "articles"
  }
}
Request Body (Many-to-Many):
{
  "collection": "articles",
  "field": "tags",
  "related_collection": "tags",
  "meta": {
    "junction_collection": "articles_tags",
    "junction_field": "articles_id",
    "one_collection_field": "tags_id",
    "one_allowed_collections": null
  }
}

Update Relation

Update relation metadata.
PATCH /relations/:collection/:field

Delete Relation

Delete a relation.
DELETE /relations/:collection/:field
Deleting a relation does not delete the underlying foreign key or junction table.

Next Steps

Collections

Manage collections

Fields

Manage fields