> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firstresonance.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit time-tracking session data

> Update the check-in and check-out times for a time-tracking session through the ION GraphQL API.

You can edit a session through the API or from a run step. For the in-app workflow, see [Time tracking](/build-hardware/runs-and-execution/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.

<Frame caption="Walkthrough of editing time-tracking session data through the API.">
  <iframe width="100%" height="400" src="https://www.loom.com/embed/362ae8fc8801403a972264820be2fb29?sid=90365257-2538-46e6-9586-53b2a30658a0" frameBorder="0" allowFullScreen />
</Frame>

## 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:

```graphql theme={null}
{
  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:

```graphql theme={null}
mutation UpdateSession($input: UpdateSessionInput!) {
  updateSession(input: $input) {
    session {
        checkIn
        checkOut
        id
    }
  }
}
```

Provide these query variables:

```json theme={null}
{
  "input": {
    "id": "<from previous step>",
    "etag": "<from previous step>",
    "checkIn": "<use your own value here>",
    "checkOut": "<use your own value here>"
  }
}
```

## Related

* [Time tracking](/build-hardware/runs-and-execution/time-tracking)
