Link a pilot
Redeem a linking code generated by a pilot in the Skyden app. Returns an opaque pilot_id you’ll use for all subsequent requests.
POST /v1/linkLinking codes expire after 10 minutes and can only be used once.
Request
Section titled “Request”curl -X POST \ "https://api.skyden.app/functions/v1/api/v1/link" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"linking_token": "SKDN-XXXX-XXXX-XXXX-XXXX"}'const res = await fetch( "https://api.skyden.app/functions/v1/api/v1/link", { method: "POST", headers: { Authorization: `Bearer ${process.env.SKYDEN_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ linking_token: "SKDN-XXXX-XXXX-XXXX-XXXX" }), },);const { data } = await res.json();console.log(data.pilot_id);import os, requests
res = requests.post( "https://api.skyden.app/functions/v1/api/v1/link", headers={"Authorization": f"Bearer {os.environ['SKYDEN_API_KEY']}"}, json={"linking_token": "SKDN-XXXX-XXXX-XXXX-XXXX"},)pilot_id = res.json()["data"]["pilot_id"]Response
Section titled “Response”200 OK
{ "data": { "pilot_id": "52b00948-12cd-4d06-ac29-027641d59ef0" }, "meta": { "api_version": "v1", "request_id": "req_d69af077" }}Errors specific to this endpoint
Section titled “Errors specific to this endpoint”| Code | Status | Meaning |
|---|---|---|
INVALID_TOKEN | 400 | Token is invalid, expired, or already used |
INVALID_REQUEST | 400 | Request body is missing linking_token, is not valid JSON, or is larger than 1 KB |
See Errors for the full list of common error codes.