Quickstart

This guide gets you a token and walks through your first few calls: reading your sites, adding a visitor and watching the event feed.

Every example uses https://acme.ext.passway.com. Use your own organization's host: on Passway's cloud, it's https://, your organization's name, then .ext.passway.com.

Create an API client

Programs call the API as an API client: a name, the scopes it may use, and a secret. Someone whose token or dashboard session has the api-clients:write scope creates it, and can give it only scopes they have themselves.

cURL

curl -X POST https://acme.ext.passway.com/v1/api-clients \
  -H "Authorization: Bearer $ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "name": "quickstart",
    "scopes": ["sites:read", "people:read", "people:write", "events:read"]
  }'

The response holds the client and its secret. Passway keeps only a hash of the secret, so copy it now: it isn't shown again. If it leaks, rotate it.

Response

{
  "api_client": {
    "id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
    "name": "quickstart",
    "scopes": ["events:read", "people:read", "people:write", "sites:read"]
  },
  "client_secret": "pwcs_7Hq2kX9vN4mP8sL3wQ5rT1yU6iO0pA2s"
}

Get an access token

Exchange the client's ID and secret for an access token at the organization's token endpoint, with the client credentials grant. Leave out scope to get every scope the client has, or ask for fewer.

cURL

curl -X POST https://acme.ext.passway.com/oauth/token \
  -u "apc_01jd8k3m2v9x4q7r5t6w8y0z1a:$CLIENT_SECRET" \
  -d grant_type=client_credentials \
  -d scope="sites:read people:read"

Response

{
  "access_token": "pwat_…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "people:read sites:read"
}

Tokens last an hour. Ask for a new one when it runs out; the Terraform provider and most OAuth libraries do this for you. Authentication covers the other ways in, including agents and tokens from GitHub Actions.

Read your sites

Send the token as a bearer token. Lists come a page at a time, with next_page_token for the next one.

cURL

export PASSWAY_TOKEN=pwat_…
curl https://acme.ext.passway.com/v1/sites \
  -H "Authorization: Bearer $PASSWAY_TOKEN"

Response

{
  "data": [
    {
      "id": "site_01jd8k3m2v9x4q7r5t6w8y0z1a",
      "name": "HQ",
      "time_zone": "America/New_York"
    }
  ],
  "next_page_token": null
}

Add a visitor

Most people arrive from your identity provider. For someone it doesn't know, such as a visitor, create the person directly. The Idempotency-Key makes the request safe to retry: sending it again returns the first response instead of adding a second visitor.

cURL

curl -X POST https://acme.ext.passway.com/v1/people \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "display_name": "Ada Lovelace",
    "email": "ada@example.com",
    "user_type": "Visitor",
    "valid_to": "2026-12-12T18:00:00Z"
  }'

She can't open anything until an access assignment gives her a profile, and nothing works for her after valid_to.

Watch the event feed

Every tap, sign-in and change is an event. Read them in order, and keep the last ID you processed to pick up where you left off.

cURL

curl -G https://acme.ext.passway.com/v1/events \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -d category=access \
  -d after=evt_01jd8k3m2v9x4q7r5t6w8y0z1a

What's next