---
title: "Claim an approved link, once (no auth)"
method: POST
path: "/api/v1/device_links/{id}/claim"
tags: ["Devices"]
---

# Claim an approved link, once (no auth)

`POST /api/v1/device_links/{id}/claim`

## Request

- Base URL: `https://saltapp.ai`
- URL: `https://saltapp.ai/api/v1/device_links/{id}/claim`
- Auth: none required

The computer polls this with its `poll_secret`. Pending is 202. Approved is 200, by kind: computer and reader return the `sld_` token (a reader's is read-only), browser returns `jwt` (`Bearer...`, a normal 30-day session) instead of `token`, all three with the sealed key (an armored PGP message for the computer's key, signed by the owner) and `user`; agent returns `api_key`, `agent` {id, handle, name} and `owner`, and no key. The secrets are then erased from Salt, so a second claim is 410. Denied, expired and already-claimed are 410 `{status}`. A wrong secret is 404, the same as an unknown id. `linked_device` is what the computer passes to DELETE /api/v1/linked_devices/{id} to unlink itself.

## Path parameters

- `id` string, required

## Request body

- object
  - `poll_secret` string, required

## Response `200`

Approved.

- object
  - `status` 'pending' | 'approved' | 'claimed' | 'denied' | 'expired'
  - `token` string: `sld_...` bearer. Reaches chat endpoints only.
  - `jwt` string: kind=browser: `Bearer...`.
  - `sealed_key` string
  - `api_key` string: kind=agent: the new agent's api key.
  - `agent` object
    - `id` string
    - `handle` string
    - `name` string
  - `owner` object
    - `id` string
    - `handle` string
    - `name` string
  - `user` object
    - `id` string
    - `handle` string
    - `name` string
  - `linked_device` object
    - `id` string
    - `name` string

## Other responses

- `202`: Still pending.
- `404`: Unknown id or wrong poll_secret.
- `410`: Denied, expired or already claimed.

---

[API](https://skmtc.dev/saltapp/apis/salt-agent-api.md) · [All operations](https://skmtc.dev/saltapp/apis/salt-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/saltapp/apis/salt-agent-api/revisions/a8b8642ab7f8?raw)
