Organization secrets

Store API keys once and read them by name from Python, so credentials stay out of your code.

Organization secrets let your Python call any system that needs a credential, without the credential appearing in code. You store an API key, token, webhook URL or database password once, and your code reads it by name with get_secret. Values are write-only: once saved, nobody can read them back through the dashboard, the API or Copilot.

For example, three actions that call your CRM all read CRM_API_KEY. The key never shows up in their code or version history, and when it rotates you update it in one place.

Use a secret for any credential. Don't put credentials in the organization store, Python modules or action configuration. For an integration you connected in Octocom, such as a store platform or a help desk, read its credentials with get_integration_credentials instead.

Secrets live under Settings -> Advanced -> Secrets.

Use a secret in Python

def execute_action(context):
    key = get_secret("MONDAY_API_KEY")

    response = requests.post(
        "https://api.monday.com/v2",
        headers={"Authorization": key},
        json={"query": "{ boards(limit: 1) { id name } }"},
        timeout=30,
    )
    response.raise_for_status()
    return response.json()

get_secret works in every Python execution in your organization: custom actions, condition providers, prompt sections, event handlers, recurring jobs, custom HTTP endpoints and sidebar widgets and actions. It raises SecretNotFound when no secret has that name, unless you pass a default. Full reference: get_secret.

Create and update secrets

FieldRules
nameUp to 100 characters. Starts with a letter or underscore; letters, digits and underscores only. UPPER_SNAKE_CASE by convention
descriptionOptional, up to 500 characters
valueUp to 20,000 characters

In the dashboard, editing a secret lets you change its name or description without re-entering the value. Leave the value field blank to keep the stored one.

Through Copilot or MCP

Use create_organization_secret with organizationId, name, value and an optional description to save a new credential. Python can then read it with get_secret("NAME"). Existing names are rejected.

Use list_organization_secrets to find a secret's ID, then pass it as secretId to update_organization_secret or archive_organization_secret, along with organizationId. Updates accept any of name, description or value; omit value to keep the stored credential. Renaming requires updating Python references to the old name. Archiving makes the credential unavailable to Python, and restore_organization_secret brings it back.

The tools return metadata only and keep the value out of Octocom's logs and audit records. Your MCP client may still keep the submitted value in its conversation history. Use the dashboard if you do not want to submit a value through a client.

Through the REST API

GET /rest/v1/secrets lists secret metadata (never values), and PATCH /rest/v1/secrets/{id}/json changes settings inside a JSON secret, as described below. Create, replace and archive secrets in the dashboard or through MCP. Those changes need the secrets:write scope (Edit secrets in Roles and permissions).

Change one setting in a JSON secret

Some secrets hold a JSON object, such as a database connection with a host, user and password. Ask Copilot to change one setting in the named secret: it uses patch_organization_secret_json without reading or re-entering the stored password. The saved value must be a JSON object. Patching needs the automations:write scope, because it keeps the stored password while changing settings such as the server it is sent to.

First call list_organization_secrets. Pass the returned id as secretId and its opaque revision as expectedRevision, along with organizationId:

{
  "organizationId": "YOUR_ORGANIZATION_UUID",
  "secretId": "YOUR_SECRET_UUID",
  "expectedRevision": "REVISION_FROM_THE_METADATA_LIST",
  "set": { "permissionMode": "supplied-credential" }
}

This example changes a SQL Server connection's permission policy. Read the SQL Server trust modes before selecting it. It is not required for ordinary secret patches.

  • set replaces top-level fields. An object or array replaces that entire field rather than merging its contents. null stores JSON null.
  • remove is an optional array of top-level names to delete. Missing names are ignored. A name cannot appear in both set and remove.
  • Omitted fields, including passwords, stay unchanged. At least one field must be supplied. The resulting secret has the usual 20,000-character limit.
  • The revision detects concurrent changes, including credential rotation. If it is stale, list the metadata again and review the intended patch before retrying. Do not automatically overwrite a newer change.

Only metadata is returned: id, name, description, hint, lastUsedAt, createdAt, updatedAt and revision. Neither existing JSON field names nor values are returned. Submitted field names and values are kept out of Octocom's audit records and logs, but may remain in the client's history.

The REST equivalent is PATCH /rest/v1/secrets/{id}/json, authenticated with the organization's X-API-Key. Send the same expectedRevision, set and remove fields in the body. Get the ID and revision from GET /rest/v1/secrets. The response is { "data": metadata } with the same metadata fields as MCP; a stale revision returns HTTP 409. Read-only MCP sessions cannot patch secrets.

Values cannot be read back

Once saved, a secret's value is write-only. It is not shown in the dashboard, not returned by the REST API and not readable by Copilot. The only way to read it is get_secret inside a Python execution.

To help you confirm you saved the right thing, each secret shows a short code such as ****4f2a. That code is derived from the value by a one-way hash. It is not part of the secret and does not reveal any of it.

How secrets are protected

  • Encrypted at rest with AES-256-GCM. The stored form is authenticated, so a tampered value fails to decrypt instead of producing something wrong.
  • Only the secrets you ask for are sent to the Python runtime, and only when a script calls get_secret.
  • Removed from output. Values are stripped from stdout, stderr and your action's return value before Octocom logs or displays them.

Output scrubbing recognizes the value exactly as stored. A value you have sliced, encoded or rebuilt piece by piece is not recognized, so never print or return a secret, even partially.

Anyone who can write Python in your organization can read that organization's secrets through get_secret. Grant the permission to edit automations accordingly (see Roles and permissions).

On this page