# Edit a party

Source: https://amanucci.com/fr/docs/developers/api/parties/updateParty

## POST /v1/entities/{entityId}/parties/{partyId}/revisions

Edit a party

Edit a contact: one call with the `seq` read and every changed fact, appending one revision under the caller, and the party answered as `getParty` reads it. Identity is frozen: a VAT number already set never moves (422 `party_invalid`; a wrong one is a new party and a merge), and one another live contact holds is 422 `party_vat_taken`. The entity's own seller (`sellerPartyId`) takes contact facts only: its name, VAT and enterprise numbers, address and endpoint are the entity's, set through `setEntityIdentity` and `setEntityVatNumber`, and a patch moving one is 422 `party_seller_identity` with nothing written. A head that has moved is 409 `party_conflict` with nothing written, and so is a merged party (edit its winner); a patch the head already holds is duplicate-ok with no revision. Documents already sent keep the details they were sent with.

Operation ID: `updateParty`

### Parameters

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

### Request body

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

### Responses

#### 200 The party as edited.

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

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