Skip to main content
POST
/
api
/
orchestration
/
fabric
/
{fabricId}
/
secret
Add secret to fabric
curl --request POST \
  --url https://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: <x-auth-token>' \
  --data '
{
  "subKind": "text",
  "properties": {
    "name": "your-secret-name",
    "value": "your-secret-value"
  },
  "kind": "prophecy"
}
'
import requests

url = "https://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret"

payload = {
"subKind": "text",
"properties": {
"name": "your-secret-name",
"value": "your-secret-value"
},
"kind": "prophecy"
}
headers = {
"X-AUTH-TOKEN": "<x-auth-token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-AUTH-TOKEN': '<x-auth-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subKind: 'text',
properties: {name: 'your-secret-name', value: 'your-secret-value'},
kind: 'prophecy'
})
};

fetch('https://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret', 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://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret",
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([
'subKind' => 'text',
'properties' => [
'name' => 'your-secret-name',
'value' => 'your-secret-value'
],
'kind' => 'prophecy'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-AUTH-TOKEN: <x-auth-token>"
],
]);

$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://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret"

payload := strings.NewReader("{\n \"subKind\": \"text\",\n \"properties\": {\n \"name\": \"your-secret-name\",\n \"value\": \"your-secret-value\"\n },\n \"kind\": \"prophecy\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-AUTH-TOKEN", "<x-auth-token>")
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://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret")
.header("X-AUTH-TOKEN", "<x-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"subKind\": \"text\",\n \"properties\": {\n \"name\": \"your-secret-name\",\n \"value\": \"your-secret-value\"\n },\n \"kind\": \"prophecy\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.prophecy.io/api/orchestration/fabric/{fabricId}/secret")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-AUTH-TOKEN"] = '<x-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subKind\": \"text\",\n \"properties\": {\n \"name\": \"your-secret-name\",\n \"value\": \"your-secret-value\"\n },\n \"kind\": \"prophecy\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "id": "4657"
  }
}

Headers

X-AUTH-TOKEN
string
required

Prophecy authentication token. Required for all API requests.

Path Parameters

fabricId
string
required

The unique ID of the parent fabric

Body

application/json

Secret object to be created. Properties vary by subKind.

kind
enum<string>
required

Secret management provider

Available options:
prophecy
subKind
enum<string>
required

Secret sub-type

Available options:
text,
binary,
username_password,
m2m_oauth
properties
object
required

Secret properties that vary by subKind.

Find specific properties in the Secrets > Properties section of the API documentation.

Response

200 - application/json

Secret created successfully

success
enum<boolean>
required

Indicates the request was successful.

Available options:
true
data
object

Response data containing the secret ID.