---
title: "Creates and deletes role bindings for a user in a single atomic operation."
method: POST
path: "/iam/users/{user_id}/role-bindings"
tags: ["RoleBindings"]
---

# Creates and deletes role bindings for a user in a single atomic operation.

`POST /iam/users/{user_id}/role-bindings`

If any creation or deletion fails, no changes are applied.

## Path parameters

- `user_id` string, required

## Request body

- ApplyRoleBindingRequest
  - `bindings_to_create` RoleBindingInput[], required
    - `customer_id` string, required
    - `role_id` string, required
    - `scope_object_id` string, required
    - `scope_type` 'org' | 'project', required
  - `bindings_to_delete` string[], required

## Response `200`

Empty Response

## Other responses

- `400` — Error Bad Request
- `403` — Error Permissions
- `404` — Error Not Found
- `500` — Error Internal Server

---

[API](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway.md) · [All operations](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crusoecloud/crusoe-cloud-api-gateway/revisions/a3fd2dedc72b/schema)
