Working with the API
Updating relationships
Update supported relationships together with a resource.
Some update endpoints let you update relationships together with the main resource.
For example, an employee can belong to multiple teams. When an endpoint supports updating teams, send the complete list of team IDs you want the employee to have after the update.
Replace behavior
Relationships are replaced when you include them in the request.
| Request body | Result |
|---|---|
{ "username": "mateo" } | Teams stay unchanged |
{ "teams": ["team_123", "team_456"] } | Employee is in exactly those teams |
{ "teams": [] } | Employee is removed from all teams |
Example:
{
"username": "mateo",
"teams": ["team_123", "team_456"]
}After this request, the employee belongs to team_123 and team_456.
Response includes
Updating a relationship does not automatically include it in the response. If the endpoint supports includes, use include[] to request related data in the response:
include[]=teamsSupported relationships are documented per endpoint in the API reference.