# Open the firm's door

Source: https://amanucci.com/docs/developers/api/people/createFirmInvite

## POST /v1/firms/{firmId}/invites

Open the firm's door

Invite somebody into a FIRM — one of the two doors. The body carries a client-minted uuid v7 id: a retry with the same id returns the existing invite as a 200-shaped duplicate rather than minting a second. Role and portfolio are fixed HERE, by an `accountant` of the firm; a staffer meets 403 `authority-required`. A fresh invite's link (`/invite#token=…` on the web app) is mailed to its address after the invite commits (`inviteMailed`); a duplicate mails nothing.

Operation ID: `createFirmInvite`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "firmId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateFirmInvite"
      }
    }
  }
}
```

### Responses

#### 200 Duplicate-ok: this id, or an open invite for this address, already existed. No token.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateInviteResult"
    }
  }
}
```

#### 201 The invite, and (on a fresh create only) its plaintext token.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateInviteResult"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
