> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/api-and-platform/consents/secrets.md).

# Secrets

Secrets are used for authenticating requests through hash digests or encrypted data in client-side environments where generating a consent token is too complicated.\
\
A few use-cases when secrets are used:

* When passing a user ID to a Didomi SDK, a hash digest should be computed and provided to authenticate the user ID provided.
* When loading proofs in a public context. For instance, if you are embedding a consent proof in emails, the proof URL will need to be authenticated via a hash digest.

The `/secrets` API endpoint gives access to the secrets available to an organization on the Didomi platform and that can be used when a secret is required.

We recommend using different secrets by environment (development, staging, production, etc.) and by platform (web, mobile, email, etc.).

{% hint style="danger" %}
Secrets are meant to be reused and organizations are limited to 300 secrets.
{% endhint %}

## Create a secret

Send a `POST /secrets` request to create a new secret. You will need to specify a name to help identify what the secret is used for. The actual secret value will be automatically generated.

**Example**

```javascript
POST /secrets

BODY
{
  "name": "User ID in Web SDK"
  "organization_id": "organization_id"
}
```

[See the API documentation for more details on this endpoint.](https://api.didomi.io/docs/#/consents%2Fevents/post_consents_events)


---

# 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://developers.didomi.io/api-and-platform/consents/secrets.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.
