Skip to main content
POST
/
secret-references
curl -X POST https://api.portkey.ai/v1/secret-references \
-H "x-portkey-api-key: PORTKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "name": "my-aws-secret",
    "manager_type": "aws_sm",
    "auth_config": {
        "aws_auth_type": "accessKey",
        "aws_access_key_id": "AKIA...",
        "aws_secret_access_key": "wJal...",
        "aws_region": "us-east-1"
    },
    "secret_path": "prod/api-keys/openai"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "slug": "<string>",
  "object": "secret-reference"
}

Authorizations

x-portkey-api-key
string
header
required

Body

application/json
name
string
required
Required string length: 1 - 255
manager_type
enum<string>
required
Available options:
aws_sm,
azure_kv,
hashicorp_vault
auth_config
object
required
secret_path
string
required
Maximum string length: 1024
organisation_id
string<uuid>

Required if not using API key auth

slug
string

Auto-generated from name if omitted

Maximum string length: 255
Pattern: ^[a-zA-Z0-9_-]+$
description
string | null
Maximum string length: 1024
secret_key
string | null
Maximum string length: 255
allow_all_workspaces
boolean
default:true

Cannot be true when allowed_workspaces is provided

allowed_workspaces
string[]

Array of workspace UUIDs or slugs. Mutually exclusive with allow_all_workspaces=true.

Minimum array length: 1
tags
object

Response

Successful response

id
string<uuid>
slug
string
object
enum<string>
Available options:
secret-reference
Last modified on March 9, 2026