Skip to main content

Execute a Braid

POST /api/braid/{id} runs the complete Braid on the server. A Braid may expose public Input, public Output, both or neither. Effect-only Braids can still complete successfully and return 204.

Request​

FieldValue
MethodPOST
Path/api/braid/{id}
AuthAuthorization: Bearer DATABRAID_TOKEN
BodyOptional JSON or plain text payload
Interactive request

Try it

POST /api/braid/{id}

Response Codes​

StatusMeaning
200Completed with a public Output. Body contains the Braid output.
204Completed without a public Output. No body is returned.
400Invalid request, invalid graph or runtime policy violation.
401Bearer token is missing or invalid.
403Braid is disabled or the operation is forbidden.
429Plan or runtime limit reached.
500Unexpected server or provider-wrapper failure.

All completed or failed execution attempts should expose X-DataBraid-Run-Id when a run record exists.

cURL​

curl --request POST "https://databraid.eu/api/braid/BRAID_ID" \
--header "Authorization: Bearer DATABRAID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"message":"hello"}'

JavaScript​

const response = await fetch("https://databraid.eu/api/braid/BRAID_ID", {
method: "POST",
headers: {
Authorization: "Bearer DATABRAID_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({ message: "hello" }),
});

const runId = response.headers.get("X-DataBraid-Run-Id");
const output = response.status === 204 ? null : await response.json();

Python​

import requests

response = requests.post(
"https://databraid.eu/api/braid/BRAID_ID",
headers={"Authorization": "Bearer DATABRAID_TOKEN"},
json={"message": "hello"},
timeout=120,
)

run_id = response.headers.get("X-DataBraid-Run-Id")
output = None if response.status_code == 204 else response.json()

Runtime Failures​

{
"error": {
"message": "Braid execution failed.",
"code": "runtime_error",
"details": {}
},
"runId": "00000000-0000-0000-0000-000000000000"
}

Validation Failures​

{
"error": {
"message": "Invalid public input payload.",
"code": "validation_error",
"details": {
"field": "message"
}
},
"runId": null
}