Push Secret to Vault
curl --request POST \
--url https://api.example.com/vault-integrations/{id}/secrets \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"mount": "<string>",
"data": {},
"metadata": {}
}
'import requests
url = "https://api.example.com/vault-integrations/{id}/secrets"
payload = {
"path": "<string>",
"mount": "<string>",
"data": {},
"metadata": {}
}
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({path: '<string>', mount: '<string>', data: {}, metadata: {}})
};
fetch('https://api.example.com/vault-integrations/{id}/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.example.com/vault-integrations/{id}/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([
'path' => '<string>',
'mount' => '<string>',
'data' => [
],
'metadata' => [
]
]),
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/vault-integrations/{id}/secrets"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\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/vault-integrations/{id}/secrets")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/vault-integrations/{id}/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 \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"mount": "<string>",
"version": 123
}Credentials & Vault
Push Secret to Vault
Write a KV secret to your underlying vault via a registered integration. The raw values are forwarded to your vault and never stored by ScrapEngine.
POST
/
vault-integrations
/
{id}
/
secrets
Push Secret to Vault
curl --request POST \
--url https://api.example.com/vault-integrations/{id}/secrets \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"mount": "<string>",
"data": {},
"metadata": {}
}
'import requests
url = "https://api.example.com/vault-integrations/{id}/secrets"
payload = {
"path": "<string>",
"mount": "<string>",
"data": {},
"metadata": {}
}
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({path: '<string>', mount: '<string>', data: {}, metadata: {}})
};
fetch('https://api.example.com/vault-integrations/{id}/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.example.com/vault-integrations/{id}/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([
'path' => '<string>',
'mount' => '<string>',
'data' => [
],
'metadata' => [
]
]),
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/vault-integrations/{id}/secrets"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\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/vault-integrations/{id}/secrets")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/vault-integrations/{id}/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 \"path\": \"<string>\",\n \"mount\": \"<string>\",\n \"data\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"mount": "<string>",
"version": 123
}Overview
Writes a KV secret to the vault behind a registered integration. This is the only channel through which a raw username/password ever enters ScrapEngine — the payload is forwarded to your vault in the same request and not persisted on our side. For HashiCorp KV v2 (the default) the secret lands at<mount>/data/<path>; use this endpoint to seed the vault entries that your credential records reference.
Path Parameters
string
required
Integration ID (UUID) of the vault to write to.
Body
string
required
Vault KV path without the mount or
/data/ prefix. 1-200 characters. For KV v2 mounted at secret, this is stored under secret/data/<path>.string
default:"secret"
KV mount point. Defaults to
secret.object
required
Key/value pairs to store under the path. All values must be strings. This is the only channel in which the raw secret enters our system; it is forwarded to your vault and never stored by us.
object
Optional
custom_metadata (KV v2) for free-form labels — name, description, owner, etc. All values must be strings.Example Request
curl -X POST "https://api.scrapengine.io/api/v1/vault-integrations/5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11/secrets" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path": "login-alice",
"mount": "secret",
"data": {
"username": "[email protected]",
"password": "hunter2"
},
"metadata": {
"name": "Alice login",
"description": "app.example.com invoices flow"
}
}'
const response = await fetch(
"https://api.scrapengine.io/api/v1/vault-integrations/5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11/secrets",
{
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SCRAPENGINE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
path: "login-alice",
data: { username: "[email protected]", password: "hunter2" },
}),
},
);
const data = await response.json();
import requests
response = requests.post(
"https://api.scrapengine.io/api/v1/vault-integrations/5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11/secrets",
headers={
"Authorization": f"Bearer {SCRAPENGINE_API_KEY}",
"Content-Type": "application/json",
},
json={
"path": "login-alice",
"data": {"username": "[email protected]", "password": "hunter2"},
},
)
data = response.json()
Response
Success Response (201)
string
The path the secret was written to (as supplied).
string
The mount point used — either what you supplied or the default (
secret).integer
KV v2 version assigned by vault. Omitted for backends that don’t version secrets.
{
"path": "login-alice",
"mount": "secret",
"version": 1
}
Error Responses
| Status | Description |
|---|---|
400 | Invalid body — non-string value in data / metadata, path too long, or the underlying vault rejected the write. |
401 | Unauthorized — invalid or missing API key. |
404 | Integration not found or not owned by the caller. |
Was this page helpful?