> ## 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

> Manage relationships between collections

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

## List Relations

Retrieve all relations.

```bash theme={null}
GET /relations
```

**Example:**

```bash theme={null}
curl "https://your-directus-instance.com/relations" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Get Relation

Retrieve a single relation.

```bash theme={null}
GET /relations/:collection/:field
```

## Create Relation

Create a new relationship.

```bash theme={null}
POST /relations
```

**Request Body (Many-to-One):**

```json theme={null}
{
  "collection": "articles",
  "field": "author",
  "related_collection": "users",
  "meta": {
    "one_field": "articles"
  }
}
```

**Request Body (Many-to-Many):**

```json theme={null}
{
  "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.

```bash theme={null}
PATCH /relations/:collection/:field
```

## Delete Relation

Delete a relation.

```bash theme={null}
DELETE /relations/:collection/:field
```

<Warning>
  Deleting a relation does not delete the underlying foreign key or junction table.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Collections" icon="layer-group" href="/api/rest/collections">
    Manage collections
  </Card>

  <Card title="Fields" icon="input-text" href="/api/rest/fields">
    Manage fields
  </Card>
</CardGroup>
