# Assign or unassign a firm person

Source: https://amanucci.com/docs/developers/api/assignments/appendAssignment

## POST /v1/engagements/{engagementId}/assignments

Assign or unassign a firm person

Assign a firm person to this client, or unassign them — an APPEND under optimistic concurrency, never an update, so who worked which client, when, survives as history. `expectedSeq` is the pinned-row key: a byte-identical retry is duplicate-ok with a 200, a stale expectation is a 409. Only an `accountant` head on the engagement's firm may write ( (d): a staffer widening their own portfolio is the write that must be impossible); the subject must hold a current `staff` or `accountant` seat there, or the append is 409. A closed engagement takes no assignment.

Operation ID: `appendAssignment`

### Parameters

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

### Request body

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

### Responses

#### 200 The appended version, or the identical one a retry found already there.

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

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