# Embed SDK Authentication

Some methods are calling directly Toucan's API, such as:

* [sendPDFReport](/visualizations-and-layouts/embedding/embed-sdk.md#sendpdfreport)
* [insertEmbedById](/visualizations-and-layouts/embedding/embed-sdk.md#insertembedbyid)

If you want to use those methods, you need to pass an authentication token when initializing the SDK. It requires an opaque token, follow the steps to [authenticate embeds](/visualizations-and-layouts/embedding/authentication.md).

As JWT token's payload embed\_context, we recommend to use:

{% code lineNumbers="true" %}

```javascript
{
  // to get from admin inteface
  "iss": "ISS"
  // to get from admin interface
  "aud": "OAUTH_URL/TENAN_ID/oauth/oauth-token",
  // when you want the token to expire, in seconds since 1970-01-01
  "exp": 0,
  "sub": "toucan-embed-client",
  "embed_context": {
    "username": "SDK_TOKEN",
    // to get from admin interface
    "workspace_id": "WORKSPACE_ID"
    "roles": ["ADMIN"],
    // ADMIN role grant access to all apps
    "privileges": {},
    "groups": [],
    "attributes": {}
  }
}
```

{% endcode %}


---

# 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-v3.toucantoco.com/visualizations-and-layouts/embedding/embed-sdk/embed-sdk-authentication.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.
