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
}
'import requests
url = "https://api.example.com/v1/agent-credentials"
payload = {
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.example.com/v1/agent-credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/agent-credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/agent-credentials"
payload := strings.NewReader("{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/agent-credentials")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/agent-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}"
response = http.request(request)
puts response.read_body{
"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."
}agent-credentials
Request a sandbox-only agent credential
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
}
'import requests
url = "https://api.example.com/v1/agent-credentials"
payload = {
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.example.com/v1/agent-credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/agent-credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/agent-credentials"
payload := strings.NewReader("{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/agent-credentials")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/agent-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"claude-code\",\n \"client\": \"cli\",\n \"organization_name\": \"Example Energy Co\",\n \"user_name\": \"Avery Developer\",\n \"assignment\": \"Prototype bill impact calculations for a customer dashboard\",\n \"tech_stack\": [\n \"typescript\",\n \"node\"\n ],\n \"use_case\": \"Evaluate WattShift bill impact endpoints in sandbox\",\n \"user_email\": \"[email protected]\",\n \"company\": \"Example Energy Co\",\n \"requested_scopes\": [\n \"calculate\",\n \"homes\"\n ],\n \"requested_environment\": \"sandbox\",\n \"requested_ttl_seconds\": 86400\n}"
response = http.request(request)
puts response.read_body{
"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
Required string length:
1 - 255Required string length:
1 - 255Required string length:
10 - 4000Required array length:
1 - 20 elementsMaximum string length:
128Maximum string length:
128Maximum string length:
128Maximum array length:
20Maximum string length:
64Maximum string length:
128Maximum string length:
128Maximum string length:
128Maximum string length:
255Available options:
sandbox, production Required range:
x > 0Maximum string length:
2048Response
200 - application/json
Sandbox credential issuance outcome.
Available options:
issued, needs_more_info, rate_limited, production_denied Available options:
sandbox Available options:
POST Required range:
x > 0⌘I
