# Correct an event

Source: https://amanucci.com/fr/docs/developers/api/cases/correctEvent

## POST /v1/entities/{entityId}/events/{eventId}/correct

Correct an event

Correct an event's reading — booked or not, its period filed or not. The human's claims (`human:<you>` at 1.000) cite a `low_confidence_material` case this act opens with you as its opener and closes `corrected` naming the NEW event version, in one transaction; the re-decide trigger runs the ADE under the same automation policy. A booked entry is then reversed and re-posted; when its period was declared to the state, the pair is dated in the next open period, waits for a signed confirm, and its grids are routed into the next return (61/62) — or refused by name where the pack has no route. A fact about the law (`account.*`, `vat.*`, `tag.*`) is refused. The client-minted `id` is the case's and the idempotency key: a retry answers 200 with the stored result. Not a signed act: it posts nothing itself. While a file of the invoice's document states another invoice, a client seat stating its total, currency or payee account is 403 `correction_needs_keep` ( (q)): the firm keeps one first.

Operation ID: `correctEvent`

### Parameters

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

### Request body

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

### Responses

#### 200 A retry of the same id: the stored result.

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

#### 201 The claims landed and the event has a new version.

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

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