---
title: "Assign a member's role"
method: PUT
path: "/members/{id}/role"
tags: ["Roles and members"]
---

# Assign a member's role

`PUT /members/{id}/role`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/members/{id}/role`
- Auth: HTTP bearer

A built-in role (owner, admin, member), a template key or a role id. Only an owner assigns or removes owner; nobody changes someone wider than themselves. A member whose role was changed several times in a row may be refused with 429 `rate_limited` for a few seconds; nothing was changed, so retry after `Retry-After`. A change the identity provider refuses answers 409 `conflict` with `details.reason` `role_change_refused`; nothing was changed. A role naming a member's personal mailbox goes to that member only: otherwise 403 `grant_forbidden` with `details.reason` `personal_mailbox_member_only`. Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `roles.write` (the person confirms at the step_up_url a 403 step_up_required answer carries, which names this client, then send the token in the Primitive-Step-Up header; the token works only with the client it was confirmed for). Needs roles:assign. API keys are refused.

## Path parameters

- `id` string, uuid, required

## Request body

- SetMemberRoleRequest
  - `role` string, required

## Response `200`

Assign a member's role

- object
  - `success` true, required
  - `data` SetMemberRoleResult, required
    - `user_id` string, required
    - `role` string, required
    - `role_id` string
    - `stored_role` string, required
    - `reduction` object, nullable, required

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: feature_disabled: the feature is not enabled for the organization; or not_found: the item the path names does not exist.
- `409`: conflict: the item changed while you edited it, or a member was removed and added back. Look again, then retry.
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

---

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