---
title: "updateSessionContext"
slug: "api/session/operations/updatesessioncontext"
sidebar:
  order: 148
---

<a id="ref-d4baa966327c"></a>
<a id="ref-896007b4900b"></a>
<a id="ref-1402f1b976b5"></a>

## Synopsis

```text
void updateSessionContext(  SessionId contextId,
    SessionContextData contextData)
throws SessionServiceFault;
```

See also: [SessionId](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [SessionServiceFault](/pCon/configuratorOnline/specs/api/session/faults/sessionservicefault#ref-30a5c7817f4a)

Update the specified session context.

Argument `contextId` must be a session context ID. The operation fails if a session ID is specified.

If field `projectKey` of argument `contextData` is specified, the project key stored in the session context is updated to the specified project key, or reset (becomes unspecified) if the specified project key is the NIL-UUID (may be represented by an empty string).

Replacing the project key in a session context does not close a previously referenced project.

The operation does not ensure that the project key, if specified and not NIL, actually matches the key of one of the session's open projects. However, since the project keys used in the web service APIs are a special kind of V8 UUIDs, attempts to set the project key of the session context to a randomly created UUID will fail.
