Skip to main content
POST
/
api
/
v1
/
environments
/
{environment_id}
/
worker-queues
Create Worker Queue
curl --request POST \
  --url https://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "display_name": "<string>",
  "description": "<string>",
  "max_workers": 2,
  "heartbeat_interval": 60,
  "tags": [
    "<string>"
  ],
  "settings": {}
}
'
import requests

url = "https://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues"

payload = {
    "name": "<string>",
    "display_name": "<string>",
    "description": "<string>",
    "max_workers": 2,
    "heartbeat_interval": 60,
    "tags": ["<string>"],
    "settings": {}
}
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({
    name: '<string>',
    display_name: '<string>',
    description: '<string>',
    max_workers: 2,
    heartbeat_interval: 60,
    tags: ['<string>'],
    settings: {}
  })
};

fetch('https://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues', 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://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues",
  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([
    'name' => '<string>',
    'display_name' => '<string>',
    'description' => '<string>',
    'max_workers' => 2,
    'heartbeat_interval' => 60,
    'tags' => [
        '<string>'
    ],
    'settings' => [
        
    ]
  ]),
  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://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"max_workers\": 2,\n  \"heartbeat_interval\": 60,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"settings\": {}\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://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"max_workers\": 2,\n  \"heartbeat_interval\": 60,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"settings\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://control-plane.kubiya.ai/api/v1/environments/{environment_id}/worker-queues")

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  \"name\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"max_workers\": 2,\n  \"heartbeat_interval\": 60,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"settings\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "organization_id": "<string>",
  "environment_id": "<string>",
  "name": "<string>",
  "display_name": "<string>",
  "description": "<string>",
  "status": "<string>",
  "max_workers": 123,
  "heartbeat_interval": 123,
  "tags": [
    "<string>"
  ],
  "settings": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "task_queue_name": "<string>",
  "active_workers": 0
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Enter your Kubiya API token (format: Bearer )

Path Parameters

environment_id
string
required

Body

application/json
name
string
required

Worker queue name (lowercase, no spaces)

Required string length: 2 - 50
display_name
string | null

User-friendly display name

description
string | null

Queue description

max_workers
integer | null

Max workers allowed (NULL = unlimited)

Required range: x >= 1
heartbeat_interval
integer
default:60

Seconds between heartbeats (lightweight)

Required range: 10 <= x <= 300
tags
string[]
settings
Settings · object

Response

Successful Response

id
string
required
organization_id
string
required
environment_id
string
required
name
string
required
display_name
string | null
required
description
string | null
required
status
string
required
max_workers
integer | null
required
heartbeat_interval
integer
required
tags
string[]
required
settings
Settings · object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
created_by
string | null
required
task_queue_name
string
required
active_workers
integer
default:0