Create or Update Secret
curl --request POST \
--url https://api.kardow.com/secrets \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.kardow.com/secrets"
payload = {
"name": "<string>",
"value": "<string>"
}
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({name: '<string>', value: '<string>'})
};
fetch('https://api.kardow.com/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.kardow.com/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([
'name' => '<string>',
'value' => '<string>'
]),
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.kardow.com/secrets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": \"<string>\"\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.kardow.com/secrets")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kardow.com/secrets")
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 \"name\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySecrets
Create or Update Secret
Store a secret value in the encrypted vault (write-only)
POST
/
secrets
Create or Update Secret
curl --request POST \
--url https://api.kardow.com/secrets \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.kardow.com/secrets"
payload = {
"name": "<string>",
"value": "<string>"
}
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({name: '<string>', value: '<string>'})
};
fetch('https://api.kardow.com/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.kardow.com/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([
'name' => '<string>',
'value' => '<string>'
]),
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.kardow.com/secrets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": \"<string>\"\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.kardow.com/secrets")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kardow.com/secrets")
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 \"name\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreates a secret, or replaces the value if the name already exists (use this
for key rotation ā configs referencing
Use the returned
vault:<name> pick up the new value
automatically).
Body Parameters
string
required
Secret name: lowercase letters, digits,
_ or -, max 64 characters.
Example: pdl_api_key.string
required
The secret value. Encrypted at rest; never returned by any API.
Examples
cURL
curl --request POST \
--url "https://api.kardow.com/secrets" \
--header "x-api-key: your-api-key-here" \
--header "Content-Type: application/json" \
--data '{ "name": "pdl_api_key", "value": "sk_live_..." }'
Response
{
"data": {
"name": "pdl_api_key",
"reference": "vault:pdl_api_key"
}
}
reference wherever feature config accepts a secret ā for
example an enrichment provider header:
{ "headers": { "X-Api-Key": "vault:pdl_api_key" } }
Was this page helpful?
āI