curl --request POST \
--url https://api.egp.scale.com/v5/sgp/secrets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"value": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.egp.scale.com/v5/sgp/secrets"
payload = {
"key": "<string>",
"value": "<string>",
"description": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', value: '<string>', description: '<string>'})
};
fetch('https://api.egp.scale.com/v5/sgp/secrets', 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.egp.scale.com/v5/sgp/secrets",
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([
'key' => '<string>',
'value' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.egp.scale.com/v5/sgp/secrets"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.egp.scale.com/v5/sgp/secrets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/sgp/secrets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"key": "<string>",
"cloud_secret_path": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "sgp_cloud_secret",
"description": "<string>",
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Secret
Create an account-level secret.
The secret value is stored in the cloud provider’s secret store. SGP only stores metadata (key name, description, audit info). The value is never returned by any API. Returns 409 if a secret with the same key already exists.
curl --request POST \
--url https://api.egp.scale.com/v5/sgp/secrets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"value": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.egp.scale.com/v5/sgp/secrets"
payload = {
"key": "<string>",
"value": "<string>",
"description": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', value: '<string>', description: '<string>'})
};
fetch('https://api.egp.scale.com/v5/sgp/secrets', 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.egp.scale.com/v5/sgp/secrets",
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([
'key' => '<string>',
'value' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.egp.scale.com/v5/sgp/secrets"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.egp.scale.com/v5/sgp/secrets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/sgp/secrets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"key": "<string>",
"cloud_secret_path": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "sgp_cloud_secret",
"description": "<string>",
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Body
Request body for creating a secret.
Secret name (e.g. openai-api-key). Must be lowercase alphanumeric with hyphens (no dots or underscores), so it maps 1:1 to a valid secret name on every cloud backend (AWS / Azure Key Vault / GCP Secret Manager).
1 - 90^[a-z0-9]([a-z0-9-]*[a-z0-9])?$The secret value to store
1Optional human-readable description
Response
Successful Response
API response model for a secret. Never includes the secret value.
The identity that created the entity.
Show child attributes
Show child attributes
"sgp_cloud_secret"User who last updated the secret.
Timestamp of last update.

