---
title: "Manage the associations of a routing policy"
method: POST
path: "/identity-provider/policies/{idp_routing_policy_id}/associations"
tags: ["Graph", "Identity Providers"]
---

# Manage the associations of a routing policy

`POST /identity-provider/policies/{idp_routing_policy_id}/associations`

## Request

- Base URL: `https://console.jumpcloud.com/api/v2`
- URL: `https://console.jumpcloud.com/api/v2/identity-provider/policies/{idp_routing_policy_id}/associations`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/docs/identity-provider/policies/:idp_routing_policy_id/associations/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint manages the _direct_ associations of a Routing Policy.

A direct association can be a non-homogeneous relationship between 2 different objects, for example a Routing Policy and Users.

#### Sample Request
```
curl -X POST https://console.jumpcloud.com/api/v2/identity-provider/policies/{IDP_ROUTING_POLICY_ID}/associations?targets=user \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}'
  -d '{"type":"user", "id":"{USER_ID}", "op":"add"}'
```

## Headers

- `x-org-id` string

## Request body

- GraphOperationIDPRoutingPolicy
  - `id` string, required: The ObjectID of graph object being added or removed as an association.
  - `op` 'add' | 'remove' | 'update', required: How to modify the graph connection.
  - `attributes` GraphAttributes, nullable: The graph attributes.
  - `type` 'user' | 'user_group', required: Targets which an "idp_routing_policy" can be associated to.

## Response `204`

OK

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-api-2/revisions/3f09fe63caaa?raw)
