Using the REST API
Passlock includes a REST API, along with the @passlock/server library to manage your tenancy data. The REST API allows you to:
- Verify a passkey registration or authentication operation
- List passkeys in your vault
- Fetch a passkey from your vault
- Delete a passkey from your vault
- Update a passkey in your vault
Tenancy ID
Section titled “Tenancy ID”REST API calls operate on a specific tenancy. You will need your Tenancy ID, along with the relevant API Key. API endpoints are typically prefixed with the Tenancy ID, e.g.
GET https://api.passlock.dev/{tenancyId}/passkeys/ HTTP/1.1import { listPasskeys } from "@passlock/server";
const tenancyId = "myTenancyId";const apiKey = "myApiKey";
await listPasskeys({ tenancyId, apiKey });Authentication
Section titled “Authentication”All REST API calls require authentication. Provide your tenancy-specific API Key via a Bearer authorization header:
GET https://api.passlock.dev/{tenancyId}/passkeys/ HTTP/1.1Authorization: Bearer {apiKey}import { listPasskeys } from "@passlock/server";
await listPasskeys({ tenancyId: "myTenancyId", apiKey: "myApiKey" });REST calls return JSON:
GET https://api.passlock.dev/{tenancyId}/passkeys/ HTTP/1.1Authorization: Bearer {apiKey}Accept: application/jsonHTTP/1.1 200 OKContent-Type: application/jsonNot applicable, the server library handles JSON internally.