> For the complete documentation index, see [llms.txt](https://manual.firstresonance.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.firstresonance.io/api/examples/edit-time-tracking-session-data.md).

# Edit time-tracking session data

Sessions can be edited via the API or through a run step as seen here! [Time Tracking](/features/runs/time-tracking.md)

## Overview

There are many situations that may necessitate changing the check-in or check-out time for a given session. Use the information below to update check-in/check-out data via the API.

{% embed url="<https://www.loom.com/share/362ae8fc8801403a972264820be2fb29?sid=90365257-2538-46e6-9586-53b2a30658a0>" %}

## Steps

#### 1) Get the session id and information

Use a query similar to this to get sessions. This one is querying for the last 5 sessions in the database, so you may want to query by user or some other parameter instead.

```graphql
{
  sessions (last: 5){
    edges {
      node {
        id
        _etag
        runStep {
          runId
          position
        }
        checkIn
        checkOut
        createdBy {
          email
        }
      }
    }
  }
}
```

#### 2) Update the session data

Once you have the id and etag, use this mutation and input to modify the session data.

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

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://manual.firstresonance.io/api/examples/edit-time-tracking-session-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
