Skip to content

Authentication

Every request carries your key in the Authorization header.

Fenêtre de terminal
curl https://localoge.com/api/v1/channel/ping \
-H "Authorization: Bearer lok_live_a1b2c3d4e5f6a7b8c9d0e1f2.sk_9f8e7d6c5b4a39281706f5e4"

The X-Api-Key header is accepted as well, without the Bearer prefix.

lok_live_a1b2c3d4e5f6a7b8c9d0e1f2 . sk_9f8e7d6c5b4a39281706f5e4d3c2b1a0
└────────── public identifier ───┘ └──────────── secret ─────────────┘

The public identifier locates your account. The secret proves it is really you.

Two environments, two prefixes, two base URLs

Section titled “Two environments, two prefixes, two base URLs”
Prefix Environment Base URL
lok_test_ Sandbox: a separate copy of Localoge, no real payments, no outgoing emails. https://sandbox.localoge.com/api/v1/channel
lok_live_ Production. https://localoge.com/api/v1/channel

Each key works only on its own instance. A key from the other environment gets 401 UNAUTHORIZED, with a message naming the right URL:

test keys (lok_test_) only work on https://sandbox.localoge.com/api/v1/channel

(or the reverse for a lok_live_ key sent to the sandbox). See Sandbox.

Every key carries a list of scopes, and they are enforced: an out-of-scope request gets 403 FORBIDDEN, and the message names the missing scope.

Scope What it grants
properties:read / properties:write Your properties: create, update, photos, extras, pause and activate, the linked host’s existing listings (GET /host/listings, POST /host/listings/{id}/claim), connected owners (GET /owners)
availability:read / availability:write The availability calendar
rates:read / rates:write Rates and restrictions
reservations:read / reservations:write Read reservations; create, modify, cancel the ones you send
host_actions:write Answer a Localoge booking request for the host: approve, reject. Never granted by default, on request to Localoge
messages:read / messages:write The conversation with the guest
reviews:read A property’s reviews
webhooks:read / webhooks:write Your webhook URL, events, deliveries, redelivery and test events
payments:read / payments:write Payout beneficiaries, payment links, deposits. Never granted by default, on request to Localoge

The lifecycle endpoints (POST …/pause, POST …/activate, DELETE /properties/{id}) fall under properties:write. GET /events and GET /webhooks/deliveries fall under webhooks:read; POST /webhooks/deliveries/{id}/retry and POST /webhooks/test under webhooks:write. GET /ping, POST /oauth/token, GET /conformance and the /sandbox/* endpoints are open to any valid key, whatever its scopes.

Every new key (developer portal, rotation, test key, Localoge console) is created with an explicit list. If you pick none, it gets what a property management software needs:

properties:write, availability:write, rates:write, reservations:write, messages:write, reviews:read, webhooks:write.

For a read-only key (dashboard, reconciliation): properties:read, availability:read, reservations:read, messages:read, reviews:read, webhooks:read.

  • Cancelling a Localoge reservation is reserved to a management software approved by an administrator: POST /reservations/{id}/host-cancel requires the host_cancel:write scope (never a default) AND the partner account to be enabled, otherwise 403 HOST_CANCEL_NOT_AVAILABLE. It fully refunds the guest, locks the nights and penalises the host; the host is e-mailed with the name of your software. POST /reservations/{id}/cancel only cancels reservations you sent us (origin: partner) and never refunds anyone.
  • No payment information. No card, brand, last digits or IBAN, no payment provider identifier, no payment link. You receive amounts (in cents) and statuses (payment_status, payout status), nothing about the payment method.
  • No guest e-mail address. Their name, and their phone only when their identity is verified and the stay is live (request, confirmed, in progress).

In your developer portal, creating a key shows the list of scopes: tick the ones the use case needs. A read-only key for an internal dashboard, a calendar-only key for a sync service: each gets its own scope, and a leak only exposes that scope.

GET /ping returns the scopes of the key in use. An old key with no recorded scopes is no longer “unrestricted”: it gets the default scopes (properties, availability, rates, reservations, messages, reviews read, webhooks), never host_actions or payments, and an unclassified endpoint is refused to it like to any restricted key. GET /ping shows the effective list. Ask us to set a named list on it.

In the developer portal, the « Rotation » (“Rotate”) button on a key creates a new one, shown only once. The old key keeps working for 7 days, then expires on its own: enough time to roll the new one out everywhere without downtime.

During those 7 days, GET /ping tells you which key each server is still using (key_id). Once none of them uses the old key, revoke it without waiting for it to expire.

When creating a key from the developer space you can give it a lifetime (expires_in_days, 1 to 730 days). After that delay the key answers 401 UNAUTHORIZED: rotate it before the deadline. Without expires_in_days the key does not expire (it can still be revoked at any time).

If you think a key has leaked, revoke it from your developer portal (« Révoquer » (“Revoke”) button), or write to us: revocation is immediate and permanent. A revoked key returns 401 UNAUTHORIZED from the very next request.