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.
Request examples
curl https://app.filmo.io/api/v1/availability/unavailabilities/unav_8f2a1c \
--request PATCH \
--header "Authorization: Bearer $FILMO_API_KEY" \
--header "Idempotency-Key: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
--header 'Content-Type: application/json' \
--data '{
"action": "finish_now",
"expectedUpdatedAt": "2026-07-20T10:12:31+02:00"
}'Generated from the schema
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]. 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.
Authorizations
Bearer API key with the scope below. availability:write
Headers
Unique identifier of the request, chosen by the client (a UUID works). Between 1 and 255 characters: an empty header is rejected with 400 validation_error, because the client would believe itself protected. Repeating the same key with the SAME body within 24 h returns the stored response without executing again, with the Idempotent-Replay: true header. With a DIFFERENT body it returns 422. It is the safe way to retry after a network timeout.
Limits: min length 1, max length 255
Example:"9f1c2f4e-3a5b-4f6d-8e7a-0b1c2d3e4f5a"
Path parameters
Body
Body schema: UnavailabilityUpdateBody
"edit" corrects the unavailability; "finish_now" closes it right now.
Available options: edit, finish_now
Last modification date you read. If it does not match, the request is rejected.
New start.
New end.
New absence type; null clears it.
Available options: vacation, sick, personal, training, maintenance, inspection, repair, reserved, academic, event, closure, other
New reason; null clears it. Not returned by the API.
Limits: max length 500
Response
Successful response.
Response schema: UnavailabilityResultDto
Envelope: UnavailabilityResultResponse. meta. is present only when the operation is deprecated.
Headers: X-Request-Id · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · ETag · Idempotent-Replay
Result of declaring or updating an unavailability.
Show child attributesHide child attributes
The unavailability as it now stands.
Show child attributesHide child attributes
Unique identifier of the unavailability.
Which resource: staff, vehicle or space.
Identifier of that resource.
Resource name; null if not recorded.
Start of the unavailability in ISO 8601 UTC.
End of the unavailability in ISO 8601 UTC.
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.
Absence type. Only emitted for vehicles and spaces, where it is operational; for staff it is health data and is returned as null.
Last modification in ISO 8601 UTC; null if not recorded.
Commitments of the resource that overlap this unavailability.
Additional information about the response.
Show child attributesHide child attributes
Lifecycle warnings; present only when the operation is deprecated.
Show child attributesHide child attributes
Stable warning code.
Available options: deprecated
For people: what is deprecated, until when, and what to use.
Day (YYYY-MM-DD) the operation stops being served.
operationId of the operation to use instead, or null if there is none.
Where the deprecation is documented (the changelog).
Invalid request (validation_error): malformed query or body. errors[] lists every offending field with its stable code.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Authentication failed (unauthorized, api_key_invalid, api_key_revoked, api_key_expired, api_key_owner_inactive, api_key_owner_not_admin).
Headers: X-Request-Id · Content-Language · Idempotent-Replay
Not allowed (insufficient_scope: the API key does not have the required scope, named in requiredScope; forbidden: the owner of the key lacks the permission the operation requires). insufficient_scope is answered before the request counts against the rate limit, so it carries no RateLimit-* headers; forbidden does.
Headers: X-Request-Id · Content-Language · Idempotent-Replay
Resource not found (not_found): it does not exist or is outside the scope of the API key.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Conflict (conflict): the current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (If-Match) held the resource for more than five seconds. errors[0]. says which: in_progress and lock_timeout are solved by retrying; invalid_state is not, because the state of the resource forbids the operation.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Idempotency-Key reused (idempotency_key_reused): the same key was used before with a different body. Change the key.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Rate limit exceeded (rate_limited): retry after Retry-After seconds; RateLimit-* says which quota ran out.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Retry-After · Idempotent-Replay
Internal error (internal_error).
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Service unavailable (service_unavailable): the feature this operation writes to is switched off for the account. The request is correct; it works again once the feature is switched on.
Headers: X-Request-Id · Content-Language · RateLimit-Limit · RateLimit-Remaining · RateLimit-Reset · Idempotent-Replay
Errors
| Status | Codes | Meaning |
|---|---|---|
| 400 | validation_error | Malformed query or body. errors[] lists every offending field with its stable code. |
| 404 | not_found | It does not exist or is outside the scope of the API key. |
| 409 | conflict | The current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (If-Match) held the resource for more than five seconds. errors[0]. says which: in_progress and lock_timeout are solved by retrying; invalid_state is not, because the state of the resource forbids the operation. |
| 422 | idempotency_key_reused | The same key was used before with a different body. Change the key. |
| 503 | service_unavailable | The feature this operation writes to is switched off for the account. The request is correct; it works again once the feature is switched on. |
401, 403, 429, 500 can be returned by any operation. Errors
Deprecation
This operation is not deprecated. Deprecations are announced with a Deprecation header and a sunset date. Versioning policy
Was this page helpful?