---
title: "Claim a relay (atomic first-write-wins)"
method: POST
path: "/api/relay/{id}/claim"
tags: ["Relay"]
---

# Claim a relay (atomic first-write-wins)

`POST /api/relay/{id}/claim`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/relay/{id}/claim`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

## Path parameters

- `id` integer, required

## Request body

- object
  - `session_id` integer, required

## Response `200`

Claim result.

- object

## Other responses

- `400`: Request body/query failed Zod validation.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or not visible to the caller).
- `409`: Already claimed by another session (RelayConflictError).

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
