Skip to main content
POST
Create an organization secret
Stores a credential once at the organization level so every workspace can use it. Use it for keys many teams share, such as a company OpenAI key, then grant the secret to the agents that need it. An organization secret is visible in every workspace and can be granted to any agent. 1Password-resolved values are workspace-only, so valueSource must be inline here.
Availability: Cloud · Community (self-hosted) · Enterprise (self-hosted)

Authorizations

Authorization
string
header
required

A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.

Body

application/json
name
string
required
Required string length: 1 - 255
Example:

"Anthropic Production"

type
enum<string>
required
Available options:
anthropic,
openai,
generic
hostPattern
string
required

Hostname pattern to match (no ://, /, or spaces). A * wildcard must stand for whole labels and the pattern must end in a literal domain that is not a public suffix (*.example.com is fine, *.com is not).

Example:

"api.anthropic.com"

valueSource
enum<string>
default:inline
Available options:
inline,
onepassword
value
string

The secret value (API key, token, and so on). Required unless valueSource is onepassword.

Required string length: 1 - 10000
opRef
string

1Password secret reference (op://vault/item/field). Required when valueSource is onepassword.

opDisplay
object

Human-readable labels of the picked 1Password vault/item/field, for display only.

pathPattern
string

Optional path pattern to match.

Maximum string length: 1000
injectionConfig
Header injection · object

How the gateway injects this secret into matching outbound requests (generic secrets only). Exactly one variant:

  • Header — { "headerName": "Authorization", "valueFormat": "Bearer {value}" }
  • Query parameter — { "paramName": "key", "paramFormat": "{value}" }
  • URL path template — { "pathTemplate": "/bot{value}" } (must start with / and contain {value} exactly once)
  • URL path regex — { "pathRegex": "^/bot([^/]+)", "pathReplacement": "/bot{value}" } (replacement must contain {value})

Unknown or mixed keys are rejected.

Response

Secret created

The narrowed secret representation returned by create endpoints.

id
string
name
string
type
string
valueSource
enum<string>
Available options:
inline,
onepassword
opRef
string | null
hostPattern
string
pathPattern
string | null
createdAt
string<date-time>
preview
string

Masked preview of the value (inline secrets only).

attachedAgents
string[]

Agent ids the new secret was granted to automatically (workspace secrets only; empty for organization secrets).