---
title: "Manage User Group Associations for Provider"
method: POST
path: "/providers/{provider_id}/usergroups/{group_id}/associations"
tags: ["Providers", "Groups"]
---

# Manage User Group Associations for Provider

`POST /providers/{provider_id}/usergroups/{group_id}/associations`

## Request

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

Creates or deletes an association between a user group and a secondary organization.
This endpoint is the core mechanism for sharing or un-sharing a user group.

The caller must belong to the owner organization (the provider's primary organization).

#### Sample Request
```
curl -X POST https://console.jumpcloud.com/api/v2/providers/{provider_id}/usergroups/{group_id}/associations \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-org-id: -' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    "op": "add",
    "type": "organization",
    "id": "org-secondary-12345"
  }'
```

## Request body

- ManageAssociationsGroup
  - `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` 'organization', required: Targets which a "organization" can be associated to.

## Response `204`

Association successfully created or deleted

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found - provider, group, or organization not found
- `409`: Conflict - group is already shared to the target organization
- `500`: Internal Server Error

---

[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)
