Policy v2 (experimental)
Propose a business-signal source
Propose a business-signal source
POST
/
v2
/
register
/
sources
cURL
# EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
# Propose a source
curl -X POST "https://parmana-api-real.vercel.app/v2/register/sources" \
-H "Authorization: Bearer $PARMANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"erp-ledger","dataOwner":"Finance","signer":{"kind":"system"},"keyId":"erp-2026-01","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----","claims":{"invoiceAmount":"INR"},"canApprove":true}'// EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
// Propose a source
const response = await fetch(
"https://parmana-api-real.vercel.app/v2/register/sources",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PARMANA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "erp-ledger",
dataOwner: "Finance",
signer: { kind: "system" },
keyId: "erp-2026-01",
publicKeyPem:
"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----",
claims: { invoiceAmount: "INR" },
canApprove: true,
}),
},
);
console.log(response.status, await response.text());# EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
# Propose a source
import json
import os
import urllib.request
BODY = r'{"name":"erp-ledger","dataOwner":"Finance","signer":{"kind":"system"},"keyId":"erp-2026-01","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----","claims":{"invoiceAmount":"INR"},"canApprove":true}'
def main() -> None:
request = urllib.request.Request(
"https://parmana-api-real.vercel.app/v2/register/sources",
data=json.dumps(json.loads(BODY)).encode("utf-8"),
method="POST",
headers={
"Authorization": "Bearer " + os.environ.get("PARMANA_API_KEY", ""),
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(request) as response:
print(response.status, response.read().decode("utf-8"))
if __name__ == "__main__":
main()const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dataOwner: '<string>',
signer: {operator: '<string>', reviewDate: '<string>'},
keyId: '<string>',
publicKeyPem: '<string>',
claims: {},
canApprove: true
})
};
fetch('https://parmana-api-real.vercel.app/v2/register/sources', 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://parmana-api-real.vercel.app/v2/register/sources",
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>',
'dataOwner' => '<string>',
'signer' => [
'operator' => '<string>',
'reviewDate' => '<string>'
],
'keyId' => '<string>',
'publicKeyPem' => '<string>',
'claims' => [
],
'canApprove' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://parmana-api-real.vercel.app/v2/register/sources"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://parmana-api-real.vercel.app/v2/register/sources")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://parmana-api-real.vercel.app/v2/register/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "erp-ledger",
"status": "proposed",
"proposedBy": "caller-ops-1",
"approvals": []
}Authorizations
Caller API key issued by scripts/generate-api-key.ts. Sent as Authorization: Bearer . Verified against a stored SHA-256 hash in constant time by packages/api/src/auth/StaticKeyAuthenticator.ts. Required on every route not listed as exempt in this document's top-level description. See /api-reference/authentication.
Body
application/json
Response
The register record the change produced (for example a source, threshold, action, policy version, approver key or role grant). The shape depends on the change (EXPERIMENTAL Policy v2 route).
The response is of type object.
⌘I
cURL
# EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
# Propose a source
curl -X POST "https://parmana-api-real.vercel.app/v2/register/sources" \
-H "Authorization: Bearer $PARMANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"erp-ledger","dataOwner":"Finance","signer":{"kind":"system"},"keyId":"erp-2026-01","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----","claims":{"invoiceAmount":"INR"},"canApprove":true}'// EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
// Propose a source
const response = await fetch(
"https://parmana-api-real.vercel.app/v2/register/sources",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PARMANA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "erp-ledger",
dataOwner: "Finance",
signer: { kind: "system" },
keyId: "erp-2026-01",
publicKeyPem:
"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----",
claims: { invoiceAmount: "INR" },
canApprove: true,
}),
},
);
console.log(response.status, await response.text());# EXPERIMENTAL Policy version 2. Available only where the deployment enables it.
# Propose a source
import json
import os
import urllib.request
BODY = r'{"name":"erp-ledger","dataOwner":"Finance","signer":{"kind":"system"},"keyId":"erp-2026-01","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA...\n-----END PUBLIC KEY-----","claims":{"invoiceAmount":"INR"},"canApprove":true}'
def main() -> None:
request = urllib.request.Request(
"https://parmana-api-real.vercel.app/v2/register/sources",
data=json.dumps(json.loads(BODY)).encode("utf-8"),
method="POST",
headers={
"Authorization": "Bearer " + os.environ.get("PARMANA_API_KEY", ""),
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(request) as response:
print(response.status, response.read().decode("utf-8"))
if __name__ == "__main__":
main()const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dataOwner: '<string>',
signer: {operator: '<string>', reviewDate: '<string>'},
keyId: '<string>',
publicKeyPem: '<string>',
claims: {},
canApprove: true
})
};
fetch('https://parmana-api-real.vercel.app/v2/register/sources', 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://parmana-api-real.vercel.app/v2/register/sources",
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>',
'dataOwner' => '<string>',
'signer' => [
'operator' => '<string>',
'reviewDate' => '<string>'
],
'keyId' => '<string>',
'publicKeyPem' => '<string>',
'claims' => [
],
'canApprove' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://parmana-api-real.vercel.app/v2/register/sources"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://parmana-api-real.vercel.app/v2/register/sources")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://parmana-api-real.vercel.app/v2/register/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"dataOwner\": \"<string>\",\n \"signer\": {\n \"operator\": \"<string>\",\n \"reviewDate\": \"<string>\"\n },\n \"keyId\": \"<string>\",\n \"publicKeyPem\": \"<string>\",\n \"claims\": {},\n \"canApprove\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "erp-ledger",
"status": "proposed",
"proposedBy": "caller-ops-1",
"approvals": []
}