# Offboard a firm seat

Source: https://amanucci.com/fr/docs/developers/api/people/removeFirmMembership

## POST /v1/firms/{firmId}/memberships/{userId}/removal

Offboard a firm seat

Offboard somebody's FIRM seat: one transaction appends a `removed` version at `expectedSeq + 1`, ends their active assignments on the firm's current engagements, and revokes the pending invites they issued on the firm's authority and the firm invites addressed to them. A removed seat reaches nothing from the next request on — sessions and API keys included. Only an `accountant` head offboards (staff meet 403 `authority-required`); the firm's last accountant stays (409 `membership_last_accountant`); a retry is 200 `duplicate: true`. Re-adding is an ordinary new version — an invite, or `appendFirmMembershipVersion` from the removed head.

Operation ID: `removeFirmMembership`

### Parameters

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

### Request body

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

### Responses

#### 200 The removed head, with what the act ended and revoked — or the byte-identical removal a retry found.

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

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

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

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