Get the crews hub
curl --request GET \
--url https://api.example.com/api/crew-templates/hub \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/crew-templates/hub"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/crew-templates/hub', 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/hub",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/crew-templates/hub"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/crew-templates/hub")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/crew-templates/hub")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"tiles": {
"running_now": 0,
"running_crews": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
],
"needs_attention": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
],
"next_scheduled": {
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
},
"next_scheduled_at": "<string>",
"active_schedules": 0,
"updates_available": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
]
},
"crews": [
{
"id": "<string>",
"name": "<string>",
"owner": "<string>",
"updated_at": "<string>",
"description": "",
"tags": [
"<string>"
],
"is_shared": false,
"current_version": 1,
"version_saved_at": "<string>",
"updates_available": 0,
"blocked": false,
"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": {}
}
],
"schedule": {
"id": "<string>",
"cron": "<string>",
"timezone": "<string>",
"next_run_at": "<string>",
"active_count": 1
},
"last_run": {
"id": "<string>",
"status": "queued",
"owner_id": "<string>",
"created_at": "<string>",
"trigger": "<string>",
"started_at": "<string>",
"ended_at": "<string>",
"current_task": 123,
"error": "<string>",
"crew_version": 123
},
"active_runs": [
{
"id": "<string>",
"status": "queued",
"owner_id": "<string>",
"created_at": "<string>",
"trigger": "<string>",
"started_at": "<string>",
"ended_at": "<string>",
"current_task": 123,
"error": "<string>",
"crew_version": 123
}
],
"health": {
"ok": 0,
"failed": 0,
"running": 0,
"total": 0
},
"failure_rate": 0,
"permissions": {
"can_run": true,
"can_edit": false,
"can_schedule": true
}
}
]
}Crew templates
Get the crews hub
Every crew you can see with how it is doing: its last run, runs in progress, the outcome of its last 30 runs, its soonest schedule, and whether a pinned registry version has an update. Also the four activity tiles (running now, needs attention, next scheduled, updates available) and, per crew, what you may do with it.
Runs and schedules counted are your own, or everyone’s with
nx1_crew_admin.
Declared before /{template_id} so hub is not read as a template id.
GET
/
api
/
crew-templates
/
hub
Get the crews hub
curl --request GET \
--url https://api.example.com/api/crew-templates/hub \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/crew-templates/hub"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/crew-templates/hub', 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/hub",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/crew-templates/hub"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/crew-templates/hub")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/crew-templates/hub")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"tiles": {
"running_now": 0,
"running_crews": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
],
"needs_attention": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
],
"next_scheduled": {
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
},
"next_scheduled_at": "<string>",
"active_schedules": 0,
"updates_available": [
{
"id": "<string>",
"name": "<string>",
"count": 1,
"detail": "<string>"
}
]
},
"crews": [
{
"id": "<string>",
"name": "<string>",
"owner": "<string>",
"updated_at": "<string>",
"description": "",
"tags": [
"<string>"
],
"is_shared": false,
"current_version": 1,
"version_saved_at": "<string>",
"updates_available": 0,
"blocked": false,
"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": {}
}
],
"schedule": {
"id": "<string>",
"cron": "<string>",
"timezone": "<string>",
"next_run_at": "<string>",
"active_count": 1
},
"last_run": {
"id": "<string>",
"status": "queued",
"owner_id": "<string>",
"created_at": "<string>",
"trigger": "<string>",
"started_at": "<string>",
"ended_at": "<string>",
"current_task": 123,
"error": "<string>",
"crew_version": 123
},
"active_runs": [
{
"id": "<string>",
"status": "queued",
"owner_id": "<string>",
"created_at": "<string>",
"trigger": "<string>",
"started_at": "<string>",
"ended_at": "<string>",
"current_task": 123,
"error": "<string>",
"crew_version": 123
}
],
"health": {
"ok": 0,
"failed": 0,
"running": 0,
"total": 0
},
"failure_rate": 0,
"permissions": {
"can_run": true,
"can_edit": false,
"can_schedule": true
}
}
]
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
Was this page helpful?

