session_finished (409)
session_finished
HTTP status: 409
Retryable: No. Retrying without changes will fail the same way.
The session has finished, expired or been canceled, so no new invite or link can be sent for it.
When it fires
A POST /v1/sessions/{id}/resend or POST /v1/sessions/{id}/regenerate_link targeted a session that can no longer be re-invited: one that has completed, expired, or been canceled, or is otherwise past the point where a new link helps (for example already processing or awaiting review). A new link would send the applicant to a session they can no longer act on. For a finished session (completed, awaiting_review or processing) the applicant has done their part, so the message names the status and there is nothing to deliver. For an expired or cancelled session the message names the next step: a new session, or for a session that belongs to a reservation from a connected system, the reservation's next step. POST /v1/sessions/{id}/regenerate_link can answer an expired or canceled session that belongs to a reservation with session_already_completed instead, with the same next step. A session paused on funds (payment_required) is not finished: the same request answers it with session_already_completed, whose page gives the next step. A session that can no longer be finished gets session_already_completed too.
How to handle it
For an expired or canceled session, create a new session for the applicant and send the invite, or get a new link, for the new session. A finished session needs no new link. A session that belongs to a reservation from a connected system and was not finished is the exception. Open the applicant's detail page in the console before you create a new session: it shows the reservation's next step, such as reopening it. A session you create is not part of the reservation, so the connected system does not receive its result. A continue_blocked_reason of deadline_passed marks such a session once the reservation's due time has passed.
Example response
{
"error": {
"type": "https://docs-dev.autohost-dev.uk/api/errors/session_finished",
"code": "session_finished",
"message": "Session is 'completed': an invite cannot be sent for a finished session",
"request_id": "req_01HEXAMPLE0000000000000000",
"doc_url": "https://docs-dev.autohost-dev.uk/api/errors/session_finished"
}
}