Guide

Authentication

The Pholio API uses company API keys. A key belongs to one company and can only reach that company's deliveries.

Sending the key

Send the key as a bearer token in the Authorization header of every request:

Authorization: Bearer phw_your_api_key

Also send Accept: application/json, so error responses come back as JSON:

curl "https://www.pholio.no/api/v1/deliveries/123" \
  --header "Authorization: Bearer $PHOLIO_API_KEY" \
  --header "Accept: application/json"

Requesting and revoking keys

A company administrator requests keys on the API tab of the company page in Pholio, under API-nøkler. Each request needs a name, scopes and a description of what the key is for. Pholio approves the request before the key is created. See Getting started.

  • A key starts with phw_. After approval, a company administrator collects it once with Hent API-nøkkel. After that Pholio stores only a hash of it, so a lost key cannot be recovered. Request a new key instead.
  • Delete a key on the same tab to revoke it. Requests with a deleted key are rejected straight away.
  • Keep keys on your server. Never put them in browser code, mobile apps or version control.

Scopes

Each key has one or more scopes that decide which endpoints it can call. Give a key only the scopes it needs.

ScopeAllows
delivery:read Read a delivery: GET /api/v1/deliveries/{delivery}
delivery:upload Import images into a delivery: POST /api/v1/deliveries/{delivery}/images/import

Authentication errors

StatusWhen
401 The key is missing, wrong or deleted. The body is {"message": "Unauthenticated."}
403 Image import with a key that lacks delivery:upload.
404 The delivery does not exist, belongs to another company, or API and webhooks are no longer enabled for your company. Reading a delivery with a key that lacks delivery:read also returns 404.

The API reference lists the responses for each endpoint.