*MCP › Reference › Catalog & inventory › Availability*

# Correct or close an unavailability

> With `action: "edit"` it corrects the dates or the type; with `action: "finish_now"` it closes it at this instant, which is the "came back early" case.

`expectedUpdatedAt` is the optimistic lock: copy it from the read and, if someone touched it in the meantime, the request is rejected with 409 `conflict` and nothing is written; read it again and retry. `edit` only applies to a manual unavailability that has not started yet: one created by a task or by a schedule is changed from its source, and one already started can only be closed; both respond 409. Its new start has to be later than now and its end after its start (400 `validation_error` with `errors[0].path` on the field, as with an `absenceType` of another resource type), and on a space the new window cannot fall on its bookings (409). `finish_now` only closes an unavailability in progress —`unavailable`, already started and not yet ended—, also one that comes from a schedule; any other responds 409, and so does one created by a task. `warningCount` is always 0 here: overlapping commitments are counted when the unavailability is declared. On a space it responds 503 `service_unavailable` while space unavailabilities are switched off for the account.

TOOL `filmo_unavailabilities_update` · `availability:write` · 120/min · Server annotation: Idempotent

## Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `unavailabilityId` | string | Yes | Unavailability identifier. |
| `action` | string | Yes | "edit" corrects the unavailability; "finish_now" closes it right now. `edit`, `finish_now` |
| `expectedUpdatedAt` | string<date-time> | Yes | Last modification date you read. If it does not match, the request is rejected. |
| `startDate` | string<date-time> | No | New start. |
| `endDate` | string<date-time> | No | New end. |
| `absenceType` | string | No | New absence type; null clears it. `vacation`, `sick`, `personal`, `training`, `maintenance`, `inspection`, `repair`, `reserved`, `academic`, `event`, `closure`, `other` |
| `reason` | string | No | New reason; null clears it. Not returned by the API. |
| `idempotencyKey` | string | No | Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure. |

## Result

On success the result carries `structuredContent` with `data` and `meta`. These are the attributes of `data`.

| Name | Type | Description |
| --- | --- | --- |
| `availability` | object | The unavailability as it now stands. |
| `availability.id` | string | Unique identifier of the unavailability. |
| `availability.resourceType` | string | Which resource: staff, vehicle or space. |
| `availability.resourceId` | string | Identifier of that resource. |
| `availability.resourceName` | string | Resource name; null if not recorded. |
| `availability.startDate` | string<date-time> | Start of the unavailability in ISO 8601 UTC. |
| `availability.endDate` | string<date-time> | End of the unavailability in ISO 8601 UTC. |
| `availability.state` | string | Declared state. This list only returns `unavailable` windows that have not ended yet, so it is always `unavailable` here; `available` and `unknown` exist as declarations but are not listed. |
| `availability.absenceType` | string | Absence type. Only emitted for vehicles and spaces, where it is operational; for staff it is health data and is returned as null. |
| `availability.updatedAt` | string<date-time> | Last modification in ISO 8601 UTC; null if not recorded. |
| `warningCount` | integer | Commitments of the resource that overlap this unavailability. |

*Call · filmo_unavailabilities_update*

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_unavailabilities_update",
    "arguments": {
      "unavailabilityId": "unav_8f2a1c",
      "action": "edit",
      "expectedUpdatedAt": "2026-09-01T08:00:00Z"
    }
  }
}
```

*Result (generated from the schema)*

```json
{
  "structuredContent": {
    "data": {
      "availability": {
        "id": "id_8f2a1c",
        "resourceType": "<resourceType>",
        "resourceId": "reso_8f2a1c",
        "resourceName": "Example",
        "startDate": "2026-09-01T08:00:00Z",
        "endDate": "2026-09-01T08:00:00Z",
        "state": "<state>",
        "absenceType": "<absenceType>",
        "updatedAt": "2026-09-01T08:00:00Z"
      },
      "warningCount": 1
    },
    "meta": {
      "idempotencyKey": "<the key you sent, or the one the server generated>",
      "rateLimit": {
        "limit": 120,
        "remaining": 119,
        "reset": 42
      }
    }
  }
}
```

## The same operation by REST

This tool runs [`PATCH /api/v1/availability/unavailabilities/{unavailabilityId}`](https://docs.filmo.io/rest-api/endpoint-reference/availability/correct-or-close-an-unavailability).

---

Canonical URL: https://docs.filmo.io/mcp/tools/availability/filmo-unavailabilities-update  
Last updated: 2026-10-25