---
title: "Create Or Update Queue (saveQueue)"
method: POST
path: "/api/queues"
tags: ["queue-controller"]
---

# Create Or Update Queue (saveQueue)

`POST /api/queues`

Create or update the Queue. When creating queue, platform generates Queue Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Specify existing Queue id to update the queue. Referencing non-existing Queue Id will cause 'Not Found' error.

Queue name is unique in the scope of sysadmin. Remove 'id', 'tenantId' from the request body example (below) to create new Queue entity. 

Available for users with 'SYS_ADMIN' authority.

## Query parameters

- `serviceType` 'TB-RULE-ENGINE' | 'TB-CORE' | 'TB-TRANSPORT' | 'JS-EXECUTOR', required

## Request body

- Queue — A JSON value representing the queue.
  - `id` QueueId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'QUEUE', required — string
  - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `name` string
  - `topic` string
  - `pollInterval` integer
  - `partitions` integer
  - `consumerPerPartition` boolean
  - `packProcessingTimeout` integer
  - `submitStrategy` SubmitStrategy
    - `type` 'BURST' | 'BATCH' | 'SEQUENTIAL_BY_ORIGINATOR' | 'SEQUENTIAL_BY_TENANT' | 'SEQUENTIAL'
    - `batchSize` integer
  - `processingStrategy` ProcessingStrategy
    - `type` 'SKIP_ALL_FAILURES' | 'SKIP_ALL_FAILURES_AND_TIMED_OUT' | 'RETRY_ALL' | 'RETRY_FAILED' | 'RETRY_TIMED_OUT' | 'RETRY_FAILED_AND_TIMED_OUT'
    - `retries` integer
    - `failurePercentage` number, double
    - `pauseBetweenRetries` integer
    - `maxPauseBetweenRetries` integer
  - `additionalInfo` unknown

## Response `200`

OK

- Queue — A JSON value representing the queue.
  - `id` QueueId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'QUEUE', required — string
  - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `name` string
  - `topic` string
  - `pollInterval` integer
  - `partitions` integer
  - `consumerPerPartition` boolean
  - `packProcessingTimeout` integer
  - `submitStrategy` SubmitStrategy
    - `type` 'BURST' | 'BATCH' | 'SEQUENTIAL_BY_ORIGINATOR' | 'SEQUENTIAL_BY_TENANT' | 'SEQUENTIAL'
    - `batchSize` integer
  - `processingStrategy` ProcessingStrategy
    - `type` 'SKIP_ALL_FAILURES' | 'SKIP_ALL_FAILURES_AND_TIMED_OUT' | 'RETRY_ALL' | 'RETRY_FAILED' | 'RETRY_TIMED_OUT' | 'RETRY_FAILED_AND_TIMED_OUT'
    - `retries` integer
    - `failurePercentage` number, double
    - `pauseBetweenRetries` integer
    - `maxPauseBetweenRetries` integer
  - `additionalInfo` unknown

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
