# PUT Update Session

{% hint style="warning" %}
You can only update **`redirect_url`**, **`language`** while the session has not yet been completed by the User
{% endhint %}

{% hint style="warning" %}
You can only update the **`theme`** when the session has not yet started, and the status is **`IDLE`**
{% endhint %}

{% hint style="warning" %}
You can only update the **`sms.to`** when the session has not yet started, and the **`sms`** delivery status is an error.
{% endhint %}

```
https://openapi.paveapi.com/v1/sessions/:session_key
```

Replace **`:session_key`** with the unique **`session_key`** returned from your previous request, and PAVE will update the corresponding session detail&#x73;**.**&#x20;

| Path Parameters   | Type   | Description                                 |
| ----------------- | ------ | ------------------------------------------- |
| **`session_key`** | string | The session ID generated when first created |

| Headers             | Type   | DescriptionAPI                                     |
| ------------------- | ------ | -------------------------------------------------- |
| **`API-Key`**       | string | Your account's API-Key                             |
| **`API-Token`**     | string | The API-Token                                      |
| **`API-Timestamp`** | string | UTC Datetime string, example: 2021-05-30T12:49:19Z |

| Body Parameters | Type   | Description                                                                       |
| --------------- | ------ | --------------------------------------------------------------------------------- |
| **`session`**   | object | Single-level object, described in Create New Session                              |
| **`vehicle`**   | object | Single-level object, described in Create New Session                              |
| **`sms`**       | object | Single-level object, described in Create New Session**Sample Response - 200: Ok** |

#### Sample Session Payload

<pre><code><strong>{
</strong>            "session": {
                "theme": "LITE",
                "redirect_url": "https://www.url-to-redirect-user-to.com",
                "language": "EN",
                "client_id": "SOUTH234889"
            }
<strong>}
</strong></code></pre>

#### Sample Vehicle Payload

```
{ 
            "vehicle": {
                "vin":"JN1CV6AR9BMXXXXXX",
                "year":"2011",
                "make":"Infiniti",
                "model":"G37",
                "body_type":"Sedan",
                "trim":"Luxury",
                "transmission":"Automatic",
                "ext_col":"Malbec Black",
                "int_col":"Wheat",
                "odom_reading":330477,
                "odom_unit":"KILOMETRES"
            }
}
```

#### Sample SMS Payload

```
{
            "sms": {
                "to": "647-455-XXXX",
                "to_name": "Jane Smith",
                "from": "647-422-XXXX",
                "by": "Steve Test Dealer"
            }
}
```

```
{
            "sms": {
                "to": "647-455-XXXX"
            }
}
```

#### Sample Response (200: Ok)

Updated successfully retrieved.

```
{
    "session_key": "XXX-ABCDE12345",
    "theme": "PRO",
    "active": true,
    "status": "IDLE",
    "redirect_url": "https://dev.paveinspect.com/valet/XXX-ABCDE12345/?l=en",
    "inspect_started_at": "",
    "inspect_ended_at": "",
    "created_at": "2021-05-25T11:50:49.000000Z",
    "updated_at": "2021-05-25T11:59:20.000000Z",
    "language": "EN",
    "options": {
        "client_id": "SOUTH234889",
        "sms": {
            "to": "647-455-XXXX",
            "to_name": "Jane Smith",
            "from": "647-422-XXXX",
            "by": "Steve's Test Dealer",
            "delivery_status": "201 Created",
            "delivery_message": ""            
        }
    },
    "vehicle": {
        "vin": "JN1CV6AR9BMXXXXXX"
    }
}
```

#### Sample Response (404: Not Found)

Could not find a session matching the **`session_key`**.

```
{
    "message": "Session :session_key cannot be found."
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paveapi.com/integrations/developer-docs/sessions-1/update-a-session-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
