---
raw: true
search:
  tags:
    - Access
    - PUT
seo:
  description: >-
    Replaces every direct scoped role assigned to one… Reference for the PUT
    /v1/spaces/{spaceId}/people/{personId}/roles endpoint in the Spacefast
    Partner API.
sidebar:
  label: Replace a person's scoped roles
  badge: PUT
title: Replace a person's scoped roles
type: openapi-operation
---
Replaces every direct scoped role assigned to one person. A new `commenter` role on a target the comments surface never shows returns 422 `comments_target_unavailable`; roles the person already holds are kept as they are.

`PUT /v1/spaces/{spaceId}/people/{personId}/roles`

**Request body** (`application/json`, required)

- `grants` (object[], required)

Request body example:

```json
{
  "grants": [
    {
      "scope": "string",
      "role": "viewer",
      "target": {
        "kind": "live"
      }
    }
  ]
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "spaceId": "string",
    "displayName": "string",
    "email": "user@example.com",
    "status": "pending",
    "grants": [
      {
        "id": "string",
        "scope": "string",
        "role": "viewer",
        "target": {
          "kind": "live"
        },
        "createdAt": "2019-08-24T14:15:22Z",
        "revokedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "invitedBy": "string",
    "inviteExpiresAt": "2019-08-24T14:15:22Z",
    "acceptedAt": "2019-08-24T14:15:22Z",
    "revokedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
```
