---
title: "Create Matchmaking Queue"
method: POST
path: "/api/matchmaking/queues"
tags: ["Matchmaking"]
---

# Create Matchmaking Queue

`POST /api/matchmaking/queues`

## Request

- Base URL: `https://api.agentstack.tech` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agentstack.tech/api/matchmaking/queues`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Create new matchmaking queue

Body example:
{
    "name": "PvP Matchmaking",
    "type": "competitive",
    "criteria": {
        "required": ["user.data.profile.level"],
        "optional": ["user.data.stats.rating"]
    },
    "tolerance": {
        "level_range": 5,
        "rating_range": 100,
        "max_wait_seconds": 30
    },
    "room_config": {
        "auto_create": true,
        "capacity": 2,
        "type": "pvp_match",
        "existing_room_id": "room_abc"
    },
    "tiers": {
        "bronze": {"level_min": 1, "level_max": 10},
        "silver": {"level_min": 11, "level_max": 25}
    }
}

If room_config.auto_create is false, set room_config.existing_room_id to a stream_relay room
id that already exists in the same project as the queue.

## Headers

- `Idempotency-Key` string

## Request body

- QueueConfigRequest: Queue configuration request
  - `id` string, nullable
  - `name` string, required
  - `type` string
  - `criteria` object
  - `matching_strategy` string
  - `tolerance` object
  - `room_config` object
  - `tiers` object, nullable
  - `min_match_score` number

## Response `200`

Successful Response

- unknown

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/agentstack/apis/agentstack-core-api.md) · [All operations](https://skmtc.dev/agentstack/apis/agentstack-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentstack/apis/agentstack-core-api/revisions/79f4a4dd8813?raw)
