Skip to Content
API reference

App pairing API

How `npx @clipmux/node init` gets an app's credentials without anyone copying a secret.

None of these routes needs a key.

Start an app pairing (npx @clipmux/node init)

POST /v1/app-pairings

Starts a pairing: show the code and open verify_url, where the owner checks the code and approves. The code works for 10 minutes. 429 too_many_pairings while 10 wait for the owner.

Authentication: None.

Request body

FieldTypeRequiredDescription
namestringno
hostnamestringno
clientstringno
{
  "name": "Course site",
  "hostname": "laptop.local",
  "client": "@clipmux/node 0.1.0"
}

Response 201

Show code; open verify_url; poll

{
  "code": "KXFT-9M2Q",
  "poll_token": "K4M2QX7R3VZ6W5TYBJ2C3DNF7G",
  "verify_url": "https://video.example.com/connect?code=KXFT-9M2Q",
  "expires_at": "2026-11-18T09:40:00Z",
  "interval_seconds": 2
}

Errors

Poll an app pairing

POST /v1/app-pairings/poll

Poll every interval_seconds. The first poll after approval carries credentials, and is the only one that ever does: they are deleted as they are returned, so a later poll is 404 pairing_not_found.

Authentication: None.

Request body

FieldTypeRequiredDescription
poll_tokenstringyes
{
  "poll_token": "K4M2QX7R3VZ6W5TYBJ2C3DNF7G"
}

Response 200

The first poll after approval carries credentials, once

{
  "status": "pending"
}

Errors

On this page