Templates
Validate template
Check a template document for errors without publishing it.
POST
/
templates
/
validate
Validate template
curl --request POST \
--url https://www.orgo.ai/api/templates/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/yaml' \
--data '"<string>"'import requests
url = "https://www.orgo.ai/api/templates/validate"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/yaml"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/yaml'},
body: JSON.stringify('<string>')
};
fetch('https://www.orgo.ai/api/templates/validate', 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://www.orgo.ai/api/templates/validate",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/yaml"
],
]);
$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://www.orgo.ai/api/templates/validate"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.orgo.ai/api/templates/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/yaml")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/templates/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/yaml'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"ok": true,
"template": {
"api_version": "orgo.ai/v1",
"template": {
"name": "claude-code",
"version": "1.0.0",
"description": "<string>"
},
"hardware": {},
"secrets": [
{}
],
"vars": {},
"env": {},
"build": {},
"files": "<array>",
"apps": "<array>",
"triggers": "<array>",
"terminal": "<array>",
"hooks": {},
"telemetry": {},
"egress_policy": {},
"streaming": "<array>"
},
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "<string>",
"hint": "<string>"
}
]
}{
"error": "Invalid API key"
}{
"ok": true,
"template": {
"api_version": "orgo.ai/v1",
"template": {
"name": "claude-code",
"version": "1.0.0",
"description": "<string>"
},
"hardware": {},
"secrets": [
{}
],
"vars": {},
"env": {},
"build": {},
"files": "<array>",
"apps": "<array>",
"triggers": "<array>",
"terminal": "<array>",
"hooks": {},
"telemetry": {},
"egress_policy": {},
"streaming": "<array>"
},
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "<string>",
"hint": "<string>"
}
]
}Validates a template against the
orgo.ai/v1 schema and returns either the normalized document or a structured list of errors. This endpoint has no side effects — nothing is written, so it is cheap enough to call on every keystroke in an editor.
Request body
The raw template document, as YAML (Content-Type: application/yaml) or JSON.
Response
true if the template is valid.The normalized template (sugar expanded into canonical form). Present when
ok is true.Example
curl -X POST https://www.orgo.ai/api/templates/validate \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/yaml" \
--data-binary @claude-code.yaml
import os, requests
r = requests.post(
"https://www.orgo.ai/api/templates/validate",
headers={
"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}",
"Content-Type": "application/yaml",
},
data=open("claude-code.yaml").read(),
)
result = r.json()
if not result["ok"]:
for e in result["errors"]:
print(f"{e['field']}: {e['message']}")
import { readFileSync } from "node:fs";
const r = await fetch("https://www.orgo.ai/api/templates/validate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORGO_API_KEY}`,
"Content-Type": "application/yaml",
},
body: readFileSync("claude-code.yaml", "utf8"),
});
const result = await r.json();
if (!result.ok) console.error(result.errors);
Response — valid
{
"ok": true,
"template": {
"api_version": "orgo.ai/v1",
"template": { "name": "claude-code", "version": "1.0.0" }
}
}
Response — invalid
{
"ok": false,
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "cpu must be one of 1, 2, 4, 8, 16"
}
]
}
Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Body
application/yamlapplication/json
The body is of type string.
Response
Validation result
An orgo.ai/v1 template document. Only api_version and template are required. See the full JSON Schema at GET /template-schema, or the schema guide at https://docs.orgo.ai/guides/templates/schema.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Validate template
curl --request POST \
--url https://www.orgo.ai/api/templates/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/yaml' \
--data '"<string>"'import requests
url = "https://www.orgo.ai/api/templates/validate"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/yaml"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/yaml'},
body: JSON.stringify('<string>')
};
fetch('https://www.orgo.ai/api/templates/validate', 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://www.orgo.ai/api/templates/validate",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/yaml"
],
]);
$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://www.orgo.ai/api/templates/validate"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.orgo.ai/api/templates/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/yaml")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/templates/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/yaml'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"ok": true,
"template": {
"api_version": "orgo.ai/v1",
"template": {
"name": "claude-code",
"version": "1.0.0",
"description": "<string>"
},
"hardware": {},
"secrets": [
{}
],
"vars": {},
"env": {},
"build": {},
"files": "<array>",
"apps": "<array>",
"triggers": "<array>",
"terminal": "<array>",
"hooks": {},
"telemetry": {},
"egress_policy": {},
"streaming": "<array>"
},
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "<string>",
"hint": "<string>"
}
]
}{
"error": "Invalid API key"
}{
"ok": true,
"template": {
"api_version": "orgo.ai/v1",
"template": {
"name": "claude-code",
"version": "1.0.0",
"description": "<string>"
},
"hardware": {},
"secrets": [
{}
],
"vars": {},
"env": {},
"build": {},
"files": "<array>",
"apps": "<array>",
"triggers": "<array>",
"terminal": "<array>",
"hooks": {},
"telemetry": {},
"egress_policy": {},
"streaming": "<array>"
},
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "<string>",
"hint": "<string>"
}
]
}