> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/client-libraries/redivis-python/reference/secret.md).

# Secret

## *class* <mark style="color:purple;">Secret</mark>

An interface for working with secrets on Redivis, which can either be stored under an organization or user. In order to access organization secrets, you must be an administrator of that organization.

{% hint style="warning" %}
Secrets can currently only be accessed from within a Redivis notebook. If your use case requires external access to secrets, please contact <support@redivis.com> to tell us more about alternate use cases.
{% endhint %}

## Constructors

<table data-header-hidden><thead><tr><th width="368">Method</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/G8XG7SuZrzsxdoILNRgC"><strong><code>organization.secret</code></strong></a>(name)</td><td>Create a reference to a secret owned by an organization.</td></tr><tr><td><a href="/pages/vSY2VUDtqTBGzt1FzN91"><strong><code>user.secret</code></strong></a>(name)</td><td>Create a reference to a secret owned by a user.</td></tr></tbody></table>

## Examples

```python
# secrets are case-sensitive
secret = redivis.user("my_username").secret("EXTERNAL_API_TOKEN")

# Avoid printing secrets, but rather pass them to other methods as needed
make_http_request("https://example.com/api", auth_token=secret.get_value())
```

## Methods

<table data-header-hidden><thead><tr><th width="421">Name</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/tQq1rBbDkioDZI83O7L0"><strong><code>secret.get_value()</code></strong></a>()</td><td>Get the value of a secret, as a string</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.redivis.com/api/client-libraries/redivis-python/reference/secret.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.
