---
title: "Set a member's enterprise role, or reactivate or deactivate them."
method: PATCH
path: "/enterprises/{enterpriseId}/members/{userId}"
tags: ["enterprises"]
---

# Set a member's enterprise role, or reactivate or deactivate them.

`PATCH /enterprises/{enterpriseId}/members/{userId}`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/enterprises/{enterpriseId}/members/{userId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Changes one thing per request. `role` sets their enterprise role, for
owners only: only the role changes, and an owner or admin gains no
organization or app access from it. A guest or removed member is a
`404` (`enterprise_member_not_found`), and leaving the enterprise
without an owner a `409` (`enterprise_last_owner`).

`active`, as SCIM's attribute of that name, is for owners and admins.
`false` deactivates them, as `DELETE` does, with the same refusals.
`true` reactivates someone the enterprise deactivated: they can sign
in again with the enterprise role they held, and, for a member,
default organizations add them again at their next sign-in. No
organization, grant, invitation, session or API key comes back.
Reactivating an admin or billing manager is for owners. Someone no
longer on one of the enterprise's domains is a `409`
(`enterprise_member_not_claimed`). Someone already active is answered
as they are.

## Request body

- object: Exactly one of `role` and `active`.
  - `role` 'owner' | 'admin' | 'member' | 'billingManager': A person's role in an enterprise.
  - `active` boolean: Whether they can sign in and hold their enterprise role.

## Response `200`

The member's role and whether they are active, as set.

- object
  - `user_id` integer, required
  - `role` 'owner' | 'admin' | 'member' | 'billingManager', required: A person's role in an enterprise.
  - `active` boolean: Present when the request set `active`.

## Other responses

- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
