Menu
Update Relation
Update a Relation
PATCH
/relations/{id}Use it in a workflow
- Add a step and choose the Directus connector.
- Pick the Update Relation action (under Relations).
- Fill in the fields below, then reference the result from later steps as
{{updateRelation.response.data}}.
Request
Path parameters
Query parameters
Request body
Enter the body as JSON in the step's Body field.
{
"collection_many": "string",
"collection_one": "string",
"field_many": "string",
"field_one": "books",
"junction_field": "string"
}
Response
Returns 200 with an object. Read it in later steps with {{updateRelation.response.data.<field>}}.
{
"data": {
"id": 1,
"many_collection": "directus_activity",
"many_field": "user",
"one_collection": "directus_users",
"one_field": null,
"one_collection_field": "string",
"one_allowed_collections": [
"string"
],
"junction_field": null,
"sort_field": "string",
"one_deselect_action": "string"
}
}
Need more? See the Directus guide for connection setup and behaviour shared by every action.
Was this page helpful?