Skip to main content
POST
/
templates
Publish template
curl --request POST \
  --url https://www.orgo.ai/api/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/yaml' \
  --data '"<string>"'
import requests

url = "https://www.orgo.ai/api/templates"

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', 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",
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"

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")
.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")

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
{
  "ref": "default/claude-code@1.0.0",
  "digest": "<string>",
  "published": "2023-11-07T05:31:56Z",
  "auto_build": "<string>"
}
{
"error": "<string>"
}
{
"error": "Invalid API key"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>",
"errors": [
{
"field": "hardware.cpu",
"code": "invalid_enum",
"message": "<string>",
"hint": "<string>"
}
]
}
Publishes a template to your registry. The request body is a complete orgo.ai/v1 document, sent as YAML (Content-Type: application/yaml) or JSON (Content-Type: application/json).
Publishing templates requires a Scale plan. Every account can still launch curated templates and any template you’ve published.
Refs are immutable. Once namespace/name@version is published, re-publishing the same ref with different content returns 409. Bump template.version to ship a change, or pass ?force=true to overwrite the version in place while iterating.

Query parameters

auto_build
boolean
Build the golden snapshot immediately after publishing. Equivalent to calling Build template yourself.
force
boolean
Overwrite an existing version in place (delete + republish). Useful for fast iteration on a single version number.

Request body

The raw template document. Validate it first with Validate template to catch errors without writing anything.

Response

ref
string
The published ref, namespace/name@version.
digest
string
Content-addressed SHA-256 digest of the canonical template.
published
string
ISO 8601 publish timestamp.
auto_build
string
Present only when ?auto_build=true. The status of the build that was kicked off, e.g. "building".

Example

curl -X POST "https://www.orgo.ai/api/templates?auto_build=true" \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/yaml" \
  --data-binary @claude-code.yaml
import os, requests

with open("claude-code.yaml") as f:
    body = f.read()

r = requests.post(
    "https://www.orgo.ai/api/templates",
    params={"auto_build": "true"},
    headers={
        "Authorization": f"Bearer {os.environ['ORGO_API_KEY']}",
        "Content-Type": "application/yaml",
    },
    data=body,
)
print(r.json()["ref"])
import { readFileSync } from "node:fs";

const r = await fetch("https://www.orgo.ai/api/templates?auto_build=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ORGO_API_KEY}`,
    "Content-Type": "application/yaml",
  },
  body: readFileSync("claude-code.yaml", "utf8"),
});
const { ref, digest } = await r.json();
console.log(ref, digest);

Response

{
  "ref": "default/claude-code@1.0.0",
  "digest": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
  "published": "2026-06-08T17:00:00Z",
  "auto_build": "building"
}

Errors

StatusMeaning
400Empty body, or unparseable YAML / JSON.
401Missing or invalid API key.
403Publishing requires a Scale plan or higher.
409A different template is already published at this namespace/name@version. Bump the version or use ?force=true.
422The template failed validation. The errors array lists each problem with its field, code, and message.

Authorizations

Authorization
string
header
required

API key authentication. Get your key at orgo.ai/workspaces

Query Parameters

auto_build
boolean

Build the golden snapshot immediately after publishing.

force
boolean

Overwrite an existing version in place (delete + republish). Useful while iterating on one version number.

Body

The orgo.ai/v1 template document as YAML.

Response

Published

ref
string
Example:

"default/claude-code@1.0.0"

digest
string
published
string<date-time>
auto_build
string

Present only with ?auto_build=true. The kicked-off build's status, e.g. "building".