Skip to content

Update Session

Updates the specified session(s). Note that changes to organizationId, startedAtUtc, and machineId will be ignored: a session cannot be moved between organizations or machines once created.

Verb PATCH
Endpoint {base-url}/sessions/management/
Max Page Size N/A

Request Body

{
  "body": [
    {
      "id": 16,
      "machineId": 42,
      "startedAtUtc": "2022-08-31T20:04:33.623",
      "login": "example@example.com",
      "reason": null,
      "loginWasSuccessful": true,
      "endedAtUtc": null,
      "wasAbandoned": false,
      "source": "Web",
      "organizationId": 1
    }
  ]
}

Note

All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.

Returns

On Success

The updated session(s) echoed back.

Response Body

[
  {
    "id": 16,
    "machineId": 42,
    "startedAtUtc": "2022-08-31T20:04:33.623",
    "login": "example@example.com",
    "reason": null,
    "loginWasSuccessful": true,
    "endedAtUtc": "2022-08-31T20:45:12.000",
    "wasAbandoned": false,
    "source": "Web",
    "organizationId": 1
  }
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more of the specified session ids belong to an organization you do not have access to. The organizationId/machineId in the body cannot move a session and are ignored on update.
404 MISSING_RECORD One or more of the specified session ids do not exist.
422 VALIDATION_ERROR A required field is missing or invalid: each record's id must be greater than zero, loginWasSuccessful and wasAbandoned are required, and organizationId must be 1 or greater with a supplied machineId likewise. Those last two are validated even though the update ignores them, so organizationId cannot be omitted here either. Also returned when a value exceeds its length limit (login and reason max 500 characters, source max 50 characters).