# 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: 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.redivis.com/api/client-libraries/redivis-python/reference/secret.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.
