---
raw: true
search:
  tags:
    - Access
    - POST
seo:
  description: >-
    Invites a person by email with one or more scoped space roles. A commenter…
    Reference for the POST /v1/spaces/{spaceId}/people endpoint in the Spacefast
    API.
sidebar:
  label: Invite a person
  badge: POST
title: Invite a person
type: openapi-operation
---
Invites a person by email with one or more scoped space roles. A `commenter` role on the live target needs the Space's comments surface set to `everywhere`; under `previews` (the default) target a Version, or get 422 `comments_target_unavailable`.

`POST /v1/spaces/{spaceId}/people`

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

- `email` (string<email>, required)
- `grants` (object[], required)

Request body example:

```json
{
  "email": "user@example.com",
  "grants": [
    {
      "scope": "string",
      "role": "viewer",
      "target": {
        "kind": "live"
      }
    }
  ]
}
```

**Responses**

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

Response example, 201:

```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"
  }
}
```
