Create a pairing code
POST
/v1/pairing
const url = 'https://your-machine.your-tailnet.ts.net/v1/pairing';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"publicUrl":"https://example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-machine.your-tailnet.ts.net/v1/pairing \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "publicUrl": "https://example.com" }'A one-time code (valid 10 minutes) and its QR code, which the OpenLine app scans.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
publicUrl
Address the phone should use. Defaults to the saved public address.
string format: uri
Example generated
{ "publicUrl": "https://example.com"}Responses
Section titled “Responses”Pairing code.
Media typeapplication/json
object
code
string
expiresAt
string format: date-time
publicUrl
string format: uri
pairUri
string
qrSvg
QR code of pairUri as SVG markup.
string
Example
{ "code": "K7QM4TZP", "pairUri": "httpgateway://pair?url=https%3A%2F%2Fgw.example.com&code=K7QM4TZP"}