> 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-r/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="/api/client-libraries/redivis-r/reference/organization/organizationusdsecret.md"><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="/api/client-libraries/redivis-r/reference/user/userusdsecret.md"><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="/api/client-libraries/redivis-r/reference/secret/secretusdget_value.md"><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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/secret.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.
