Get BRK Schema
curl --request POST \
--url https://api.brx.ai/schema_from_id \
--header 'Content-Type: application/json' \
--header 'key: <api-key>' \
--data '
{
"brxId": "brk-12345678-90ab-cdef-1234-567890abcdef"
}
'import requests
url = "https://api.brx.ai/schema_from_id"
payload = { "brxId": "brk-12345678-90ab-cdef-1234-567890abcdef" }
headers = {
"key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({brxId: 'brk-12345678-90ab-cdef-1234-567890abcdef'})
};
fetch('https://api.brx.ai/schema_from_id', 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.brx.ai/schema_from_id",
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([
'brxId' => 'brk-12345678-90ab-cdef-1234-567890abcdef'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.brx.ai/schema_from_id"
payload := strings.NewReader("{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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.brx.ai/schema_from_id")
.header("key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brx.ai/schema_from_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"httpResponse": {
"isError": false,
"statusMsg": "BRK schema fetched successfully",
"brkObject": "{\"brxId\":\"brk-12345678-90ab-cdef-1234-567890abcdef\",\"brxName\":\"Example BRK\",\"description\":\"An example BRK for documentation\",\"prompt\":{\"prompt\":{\"main\":\"This is the main prompt template with {{variable}}\"}},\"processParams\":{\"processType\":0},\"dependantBrxIds\":{\"main_brx_entry_schema\":\"brk-12345678-90ab-cdef-1234-567890abcdef\"}}",
"brxId": "brk-12345678-90ab-cdef-1234-567890abcdef"
}
}{
"httpResponse": {
"isError": true,
"errorID": "bad-request",
"statusMsg": "Missing required parameter: brxId"
}
}{
"httpResponse": {
"isError": true,
"errorID": "unauthorized",
"statusMsg": "Invalid API key"
}
}{
"httpResponse": {
"isError": true,
"errorID": "forbidden",
"statusMsg": "You do not have permission to access this BRK"
}
}{
"httpResponse": {
"isError": true,
"errorID": "not-found",
"statusMsg": "BRK with ID 'brk-12345678-90ab-cdef-1234-567890abcdef' not found"
}
}{
"httpResponse": {
"isError": true,
"errorID": "server-error",
"statusMsg": "An unexpected error occurred while processing your request"
}
}BRK Management
Get BRK Schema
Fetches a BRK schema by its ID. The schema contains all the information needed to initialize and execute a BRK, including input fields, dependencies, and configuration parameters. This endpoint is typically used as the first step in executing a BRK, as you need the schema to properly initialize the BRK with the correct input fields.
POST
/
schema_from_id
Get BRK Schema
curl --request POST \
--url https://api.brx.ai/schema_from_id \
--header 'Content-Type: application/json' \
--header 'key: <api-key>' \
--data '
{
"brxId": "brk-12345678-90ab-cdef-1234-567890abcdef"
}
'import requests
url = "https://api.brx.ai/schema_from_id"
payload = { "brxId": "brk-12345678-90ab-cdef-1234-567890abcdef" }
headers = {
"key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({brxId: 'brk-12345678-90ab-cdef-1234-567890abcdef'})
};
fetch('https://api.brx.ai/schema_from_id', 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.brx.ai/schema_from_id",
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([
'brxId' => 'brk-12345678-90ab-cdef-1234-567890abcdef'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.brx.ai/schema_from_id"
payload := strings.NewReader("{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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.brx.ai/schema_from_id")
.header("key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brx.ai/schema_from_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brxId\": \"brk-12345678-90ab-cdef-1234-567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"httpResponse": {
"isError": false,
"statusMsg": "BRK schema fetched successfully",
"brkObject": "{\"brxId\":\"brk-12345678-90ab-cdef-1234-567890abcdef\",\"brxName\":\"Example BRK\",\"description\":\"An example BRK for documentation\",\"prompt\":{\"prompt\":{\"main\":\"This is the main prompt template with {{variable}}\"}},\"processParams\":{\"processType\":0},\"dependantBrxIds\":{\"main_brx_entry_schema\":\"brk-12345678-90ab-cdef-1234-567890abcdef\"}}",
"brxId": "brk-12345678-90ab-cdef-1234-567890abcdef"
}
}{
"httpResponse": {
"isError": true,
"errorID": "bad-request",
"statusMsg": "Missing required parameter: brxId"
}
}{
"httpResponse": {
"isError": true,
"errorID": "unauthorized",
"statusMsg": "Invalid API key"
}
}{
"httpResponse": {
"isError": true,
"errorID": "forbidden",
"statusMsg": "You do not have permission to access this BRK"
}
}{
"httpResponse": {
"isError": true,
"errorID": "not-found",
"statusMsg": "BRK with ID 'brk-12345678-90ab-cdef-1234-567890abcdef' not found"
}
}{
"httpResponse": {
"isError": true,
"errorID": "server-error",
"statusMsg": "An unexpected error occurred while processing your request"
}
}Authorizations
Body
application/json
Request containing the BRK ID to fetch
The unique identifier of the BRK to fetch
Example:
"brk-12345678-90ab-cdef-1234-567890abcdef"
Response
BRK schema response containing the complete schema definition
Show child attributes
Show child attributes
⌘I