Import a crew from YAML
curl --request POST \
--url https://api.example.com/api/crew-templates/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"yaml": "<string>"
}
'import requests
url = "https://api.example.com/api/crew-templates/import"
payload = { "yaml": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({yaml: '<string>'})
};
fetch('https://api.example.com/api/crew-templates/import', 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.example.com/api/crew-templates/import",
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([
'yaml' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.example.com/api/crew-templates/import"
payload := strings.NewReader("{\n \"yaml\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/crew-templates/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"yaml\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/crew-templates/import")
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/json'
request.body = "{\n \"yaml\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"crew_config": {
"agents": [
{
"id": "<string>",
"ref": {
"artifact_id": "<string>",
"version": "<string>"
},
"role": "",
"goal": "",
"backstory": ""
}
],
"tasks": [
{
"description": "<string>",
"agent_index": 0,
"expected_output": "",
"context": [
123
],
"name": "",
"tools": [
"<string>"
],
"approval": {},
"max_execution_time": 43200,
"max_tool_calls": 5000,
"output_format": "text",
"human_checkpoint": false
}
],
"id": "<string>",
"verbose": false,
"process": "sequential",
"layout": {},
"context_packs": [
{
"artifact_id": "<string>",
"version": "<string>",
"token_budget": 101
}
],
"repository": {
"repos": [
{
"artifact_id": "<string>",
"version": "<string>"
}
],
"branch_prefix": "nx1/",
"max_files": 5,
"max_lines": 200,
"may_open_pr": true,
"may_comment": false
},
"defaults": {
"max_execution_time": 43200,
"max_tool_calls": 5000,
"max_iterations": 500,
"approval_tools": [
"<string>"
],
"notify_on_failure": true
}
},
"tags": [
"<string>"
],
"is_shared": true,
"created_by": "<string>",
"updated_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"variables": [
{
"name": "<string>",
"label": "<string>",
"description": "",
"type": "string",
"required": true,
"default": "<unknown>",
"choices": [
"<string>"
],
"min_length": 123,
"max_length": 123,
"min_value": 123,
"max_value": 123,
"sensitive": false,
"group": "<string>",
"show_if": {}
}
],
"pins": [
{
"artifact_id": "<string>",
"kind": "<string>",
"name": "<string>",
"scope": "<string>",
"pinned_version": "<string>",
"agent_index": 123,
"status": "<string>",
"latest_approved_version": "<string>",
"update_available": false,
"blocked_reason": "<string>"
}
],
"lint_warnings": [
"<string>"
],
"current_version": 1,
"version_saved_at": "<string>",
"affected_schedules": [
"<string>"
]
}{
"error": "<string>",
"code": 500
}Crew templates
Import a crew from YAML
Create a crew from a YAML file exported from this or another deployment. The new crew is private and yours. Its agents are registry references, so each one must exist in this registry and be one you may use; otherwise the import is refused and nothing is created.
POST
/
api
/
crew-templates
/
import
Import a crew from YAML
curl --request POST \
--url https://api.example.com/api/crew-templates/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"yaml": "<string>"
}
'import requests
url = "https://api.example.com/api/crew-templates/import"
payload = { "yaml": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({yaml: '<string>'})
};
fetch('https://api.example.com/api/crew-templates/import', 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.example.com/api/crew-templates/import",
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([
'yaml' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.example.com/api/crew-templates/import"
payload := strings.NewReader("{\n \"yaml\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/crew-templates/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"yaml\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/crew-templates/import")
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/json'
request.body = "{\n \"yaml\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"crew_config": {
"agents": [
{
"id": "<string>",
"ref": {
"artifact_id": "<string>",
"version": "<string>"
},
"role": "",
"goal": "",
"backstory": ""
}
],
"tasks": [
{
"description": "<string>",
"agent_index": 0,
"expected_output": "",
"context": [
123
],
"name": "",
"tools": [
"<string>"
],
"approval": {},
"max_execution_time": 43200,
"max_tool_calls": 5000,
"output_format": "text",
"human_checkpoint": false
}
],
"id": "<string>",
"verbose": false,
"process": "sequential",
"layout": {},
"context_packs": [
{
"artifact_id": "<string>",
"version": "<string>",
"token_budget": 101
}
],
"repository": {
"repos": [
{
"artifact_id": "<string>",
"version": "<string>"
}
],
"branch_prefix": "nx1/",
"max_files": 5,
"max_lines": 200,
"may_open_pr": true,
"may_comment": false
},
"defaults": {
"max_execution_time": 43200,
"max_tool_calls": 5000,
"max_iterations": 500,
"approval_tools": [
"<string>"
],
"notify_on_failure": true
}
},
"tags": [
"<string>"
],
"is_shared": true,
"created_by": "<string>",
"updated_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"variables": [
{
"name": "<string>",
"label": "<string>",
"description": "",
"type": "string",
"required": true,
"default": "<unknown>",
"choices": [
"<string>"
],
"min_length": 123,
"max_length": 123,
"min_value": 123,
"max_value": 123,
"sensitive": false,
"group": "<string>",
"show_if": {}
}
],
"pins": [
{
"artifact_id": "<string>",
"kind": "<string>",
"name": "<string>",
"scope": "<string>",
"pinned_version": "<string>",
"agent_index": 123,
"status": "<string>",
"latest_approved_version": "<string>",
"update_available": false,
"blocked_reason": "<string>"
}
],
"lint_warnings": [
"<string>"
],
"current_version": 1,
"version_saved_at": "<string>",
"affected_schedules": [
"<string>"
]
}{
"error": "<string>",
"code": 500
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
Body
application/json
Response
Successful Response
Response model for a crew template returned from the API.
Was this page helpful?

