Skip to main content
You can edit a session through the API or from a run step. For the in-app workflow, see Time tracking. When you need to correct the check-in or check-out time for a session, update the session data through the ION API. The steps below walk through querying for a session and updating its times.

Get the session ID and information

Query for the sessions you want to edit. This query returns the last five sessions. To narrow the results, query by user or another parameter:
{
  sessions (last: 5){
    edges {
      node {
        id
        _etag
        runStep {
          runId
          position
        }
        checkIn
        checkOut
        createdBy {
          email
        }
      }
    }
  }
}

Update the session data

Once you have the id and _etag, use this mutation and input to modify the session data:
mutation UpdateSession($input: UpdateSessionInput!) {
  updateSession(input: $input) {
    session {
        checkIn
        checkOut
        id
    }
  }
}
Provide these query variables:
{
  "input": {
    "id": "<from previous step>",
    "etag": "<from previous step>",
    "checkIn": "<use your own value here>",
    "checkOut": "<use your own value here>"
  }
}