> For the complete documentation index, see [llms.txt](https://docs.keyless.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyless.io/web-sdk/web-sdk-reference/add-operationid-to-an-authentication.md).

# Add OperationID to an authentication

Web SDK supports the association of an identifier to an authentication operation for the purpose of audibility, orchestration or analytics.\
\
This feature therefore pairs with the [Telemetry API](https://docs.keyless.io/consumer/server-api/telemetry) which integrators can query to retrieve information about a specific authentication event via the WebSDK.

### Appending the OperationID

The operation must be generated by the integrator and set to the Web SDK, here's how:

{% tabs %}
{% tab title="Headless" %}

```javascript
await openKeylessWebSocketConnection(sym, {
  ...,
  operation: {
    id: OPERATION_ID
  }
})
```

{% endtab %}

{% tab title="Web Components" %}

```html
<kl-auth
  ...
  operation-id="OPERATION_ID"
></kl-auth>
```

{% endtab %}
{% endtabs %}

### Retrieving the KeylessID&#x20;

Note if you are planning to call the [Telemetry API](https://docs.keyless.io/consumer/server-api/telemetry) you'll see you need to include the KeylessID (`{userId`}) that Keyless use to identity that specific user. This can be retrieved via a separate call to the [Check Keyless Client Device API](https://authentication-service.eks.core-staging.keyless.technology/redoc#tag/Public/paths/~1v1~1users~1%7Bcustomer%7D~1%7Busername%7D/get). \
\
In order to use this API you will need:

<table><thead><tr><th width="154.68621826171875">Input</th><th>Explanation</th></tr></thead><tbody><tr><td>api_key</td><td>The authorization key provided to you by Keyless.</td></tr><tr><td>customer</td><td>The name associated with the backend tenant provided to you by Keyless. </td></tr><tr><td>username</td><td>The username provided during WebSDK enrollment and required for ongoing authentications. </td></tr></tbody></table>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.keyless.io/web-sdk/web-sdk-reference/add-operationid-to-an-authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
