> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layarva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Queue API Quickstart

> List services, issue a ticket idempotently, read ticket status, and read live Queue state.

## What you'll accomplish

You will make authenticated server-to-server requests to the four implemented Queue endpoints.

## Base URL

```text theme={null}
https://app.layarva.com/api/public/v1/queue
```

## Prerequisites

1. Create a credential under **Queue Unit → External API**.
2. Grant only the required operation and service scopes.
3. Store the returned secret in a server-side secret manager.

## List allowed services

```bash theme={null}
curl -s "https://app.layarva.com/api/public/v1/queue/services" \
  -H "Authorization: Bearer $LAYARVA_QUEUE_API_KEY" \
  -H "Accept: application/json"
```

Cache the returned service and Location IDs. The ticket endpoint expects those exact scoped IDs.

## Issue one ticket

```bash theme={null}
curl -s -X POST "https://app.layarva.com/api/public/v1/queue/tickets" \
  -H "Authorization: Bearer $LAYARVA_QUEUE_API_KEY" \
  -H "X-Request-Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  -H "X-Request-Nonce: $(uuidgen)" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_example",
    "serviceId": "qlcategory_example",
    "externalReference": "APPT-2026-000481"
  }'
```

Keep the Idempotency Key for the logical customer request. Retrying with the same key and same payload returns the same ticket; using that key for a different payload returns a conflict.

## Read ticket and live state

```bash theme={null}
curl -s "https://app.layarva.com/api/public/v1/queue/tickets/qticket_example" \
  -H "Authorization: Bearer $LAYARVA_QUEUE_API_KEY"

curl -s "https://app.layarva.com/api/public/v1/queue/state" \
  -H "Authorization: Bearer $LAYARVA_QUEUE_API_KEY"
```

## Edge-managed Queue Units

The Platform refuses ticket issuance with `QUEUE_UNIT_EDGE_MANAGED` while an Edge holds authority. The Cloud cannot mint a ticket that the branch Edge cannot learn about during its current authority lease.

## Related guides

* [Authenticate Queue API Requests](/developers/authentication)
* [Handle API Errors](/developers/error-codes)
* [Queue API Rate Limits](/developers/rate-limits)
* [Verify Queue Webhooks](/developers/webhooks)
