Skip to main content
POST
/
v1
/
agent-credentials
Request a sandbox-only agent credential
curl --request POST \
  --url https://api.example.com/v1/agent-credentials \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent": "claude-code",
  "client": "cli",
  "organization_name": "Example Energy Co",
  "user_name": "Avery Developer",
  "assignment": "Prototype bill impact calculations for a customer dashboard",
  "tech_stack": [
    "typescript",
    "node"
  ],
  "use_case": "Evaluate WattShift bill impact endpoints in sandbox",
  "user_email": "[email protected]",
  "company": "Example Energy Co",
  "requested_scopes": [
    "calculate",
    "homes"
  ],
  "requested_environment": "sandbox",
  "requested_ttl_seconds": 86400
}
'
{
  "outcome": "issued",
  "credential": "wsk_agent_example_token",
  "credential_id": "ws_agent_cred_123456789",
  "key_prefix": "wsk_agent",
  "request_id": "ws_request_123456789",
  "credential_request_id": "ws_cred_request_123456789",
  "expires_at": "2025-01-03T12:00:00.000Z",
  "scopes": [
    "calculate",
    "homes"
  ],
  "environment": "sandbox",
  "production_access": false,
  "revocation_method": "POST",
  "revocation_path": "/v1/agent-credentials/ws_agent_cred_123456789/revoke",
  "next_steps": "Store the credential securely and send it as the x-ws-api-key header on sandbox requests."
}

Body

application/json
organization_name
string
required
Required string length: 1 - 255
user_name
string
required
Required string length: 1 - 255
assignment
string
required
Required string length: 10 - 4000
requested_scopes
string[]
required
Required array length: 1 - 20 elements
Maximum string length: 128
agent
string
Maximum string length: 128
client
string
Maximum string length: 128
tech_stack
string[]
Maximum array length: 20
Maximum string length: 64
use_case
string
Maximum string length: 128
device_segment
string
Maximum string length: 128
project
string
Maximum string length: 128
user_email
string<email>
company
string
Maximum string length: 255
requested_environment
enum<string>
default:sandbox
Available options:
sandbox,
production
requested_ttl_seconds
integer
Required range: x > 0
docs_context
string<uri>
Maximum string length: 2048

Response

200 - application/json

Sandbox credential issuance outcome.

outcome
enum<string>
required
Available options:
issued,
needs_more_info,
rate_limited,
production_denied
request_id
string
required
credential_request_id
string
required
environment
enum<string>
required
Available options:
sandbox
production_access
boolean
required
next_steps
string
required
credential
string
credential_id
string
key_prefix
string
expires_at
string<date-time>
scopes
string[]
revocation_method
enum<string>
Available options:
POST
revocation_path
string
retry_after_seconds
integer
Required range: x > 0