Sites

A building or campus (IFC site). Areas, doors and access points belong to one site, and schedules run in its time zone.

The site model

A building or campus. Areas, doors and access points belong to one site, and schedules run in the site's time zone unless they set their own.

Properties

  • Name
    id
    Type
    string
    Description

    Site ID.

  • Name
    etag
    Type
    string
    Description

    Current version.

  • Name
    name
    Type
    string
    Description

    Display name, unique within the organization.

  • Name
    description
    Type
    string
    Description

    Free text.

  • Name
    time_zone
    Type
    string
    Description

    Time zone the site's schedules use.

  • Name
    address
    Type
    object
    Description

    Street address, if set. Can be null.

  • Name
    address.lines
    Type
    array of strings
    Description

    Street lines, 1 to 4, each at most 128 characters.

  • Name
    address.locality
    Type
    string
    Description

    City or town (addressLocality).

  • Name
    address.region
    Type
    string
    Description

    State, province or region (addressRegion).

  • Name
    address.postal_code
    Type
    string
    Description

    Postal code.

  • Name
    address.country
    Type
    string
    Description

    ISO 3166-1 alpha-2 country code.

  • Name
    labels
    Type
    object
    Description

    Labels.

  • Name
    managed_by
    Type
    string
    Description

    The tool that manages this resource, such as terraform. The console warns before editing a resource another tool manages. Can be null.

  • Name
    created_at
    Type
    timestamp
    Description

    When the site was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    When the site last changed.


GET/v1/sites

List sites

Needs the sites:read scope.

Query parameters

  • Name
    page_size
    Type
    integer
    Description

    Results per page, 1 to 200. 0 or absent means 50; more than 200 means 200 (AIP-158).

  • Name
    page_token
    Type
    string
    Description

    next_page_token from the previous page.

  • Name
    updated_since
    Type
    timestamp
    Description

    Only resources changed at or after this time.

Request

GET
/v1/sites
curl https://acme.ext.passway.com/v1/sites \
  -H "Authorization: Bearer $PASSWAY_TOKEN"

Response

{
  "data": [
    {
      "id": "site_01jd8k3m2v9x4q7r5t6w8y0z1a",
      "etag": "3f9a",
      "name": "HQ",
      "description": "…",
      "time_zone": "America/New_York",
      "address": null,
      "labels": {
        "passway.example/cost-center": "4410",
        "team": "facilities"
      },
      "managed_by": "terraform",
      "created_at": "2026-11-30T14:02:11Z",
      "updated_at": "2026-11-30T14:02:11Z"
    }
  ],
  "next_page_token": null
}

POST/v1/sites

Create a site

Needs the sites:write scope.

Headers

  • Name
    Idempotency-Key
    Type
    string
    Description

    A unique key, such as a UUID. Repeating a successful request with the same key within 24 hours returns the original response; reusing it for a different request returns 422; repeating it while the first is still running returns 409 with Retry-After.

Required attributes

  • Name
    name
    Type
    string
    Description

    Display name, unique within the organization.

  • Name
    time_zone
    Type
    string
    Description

    Time zone the site's schedules use.

Optional attributes

  • Name
    description
    Type
    string
    Description

    Free text.

  • Name
    address
    Type
    object
    Description

    Street address.

  • Name
    address.lines
    Type
    array of strings
    Description

    Street lines, 1 to 4, each at most 128 characters.

  • Name
    address.locality
    Type
    string
    Description

    City or town (addressLocality).

  • Name
    address.region
    Type
    string
    Description

    State, province or region (addressRegion).

  • Name
    address.postal_code
    Type
    string
    Description

    Postal code.

  • Name
    address.country
    Type
    string
    Description

    ISO 3166-1 alpha-2 country code.

  • Name
    labels
    Type
    object
    Description

    Labels.

  • Name
    managed_by
    Type
    string
    Description

    The tool that manages this resource. Terraform sets terraform.

Request

POST
/v1/sites
curl -X POST https://acme.ext.passway.com/v1/sites \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "HQ",
    "time_zone": "America/New_York",
    "labels": {
      "passway.example/cost-center": "4410",
      "team": "facilities"
    },
    "managed_by": "terraform"
  }'

Response

{
  "id": "site_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "HQ",
  "description": "…",
  "time_zone": "America/New_York",
  "address": null,
  "labels": {
    "passway.example/cost-center": "4410",
    "team": "facilities"
  },
  "managed_by": "terraform",
  "created_at": "2026-11-30T14:02:11Z",
  "updated_at": "2026-11-30T14:02:11Z"
}

GET/v1/sites/{site_id}

Get a site

Needs the sites:read scope.

Path parameters

  • Name
    site_id
    Type
    string
    Description

    Site ID: site_ followed by 1 to 64 lowercase letters and digits.

Request

GET
/v1/sites/{site_id}
curl https://acme.ext.passway.com/v1/sites/site_01jd8k3m2v9x4q7r5t6w8y0z1a \
  -H "Authorization: Bearer $PASSWAY_TOKEN"

Response

{
  "id": "site_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "HQ",
  "description": "…",
  "time_zone": "America/New_York",
  "address": null,
  "labels": {
    "passway.example/cost-center": "4410",
    "team": "facilities"
  },
  "managed_by": "terraform",
  "created_at": "2026-11-30T14:02:11Z",
  "updated_at": "2026-11-30T14:02:11Z"
}

PATCH/v1/sites/{site_id}

Update a site

A JSON merge patch (RFC 7396): fields in the body replace the current ones, null removes a field where the schema allows null, and objects such as labels are merged. Requires If-Match with the current etag.

Needs the sites:write scope.

Path parameters

  • Name
    site_id
    Type
    string
    Description

    Site ID: site_ followed by 1 to 64 lowercase letters and digits.

Headers

  • Name
    If-Match
    Type
    string
    Description

    The resource's current etag, in double quotes. Required.

Optional attributes

  • Name
    name
    Type
    string
    Description

    New name.

  • Name
    description
    Type
    string
    Description

    New description.

  • Name
    time_zone
    Type
    string
    Description

    New time zone.

  • Name
    address
    Type
    object
    Description

    Changes to the address, merged into the current one, or null to remove it. Can be null.

  • Name
    address.lines
    Type
    array of strings
    Description

    New street lines, replacing the current ones: 1 to 4, each at most 128 characters.

  • Name
    address.locality
    Type
    string
    Description

    New city or town. Can be null.

  • Name
    address.region
    Type
    string
    Description

    New state, province or region. Can be null.

  • Name
    address.postal_code
    Type
    string
    Description

    New postal code. Can be null.

  • Name
    address.country
    Type
    string
    Description

    New country code.

  • Name
    labels
    Type
    object
    Description

    Labels to set or remove, or null to remove every label. Can be null.

  • Name
    managed_by
    Type
    string
    Description

    New managing tool, or null to clear it. Can be null.

Request

PATCH
/v1/sites/{site_id}
curl -X PATCH https://acme.ext.passway.com/v1/sites/site_01jd8k3m2v9x4q7r5t6w8y0z1a \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H 'If-Match: "3f9a"' \
  -H "Content-Type: application/merge-patch+json" \
  -d '{
    "time_zone": "America/New_York",
    "labels": {
      "old-label": null,
      "team": "security"
    }
  }'

Response

{
  "id": "site_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "HQ",
  "description": "…",
  "time_zone": "America/New_York",
  "address": null,
  "labels": {
    "passway.example/cost-center": "4410",
    "team": "facilities"
  },
  "managed_by": "terraform",
  "created_at": "2026-11-30T14:02:11Z",
  "updated_at": "2026-11-30T14:02:11Z"
}

DELETE/v1/sites/{site_id}

Delete a site

A site that still has areas, doors, access points or reader groups returns 409 with /problems/has-dependents, listing them.

Needs the sites:write scope.

Path parameters

  • Name
    site_id
    Type
    string
    Description

    Site ID: site_ followed by 1 to 64 lowercase letters and digits.

Headers

  • Name
    If-Match
    Type
    string
    Description

    The resource's current etag, in double quotes. Required.

Request

DELETE
/v1/sites/{site_id}
curl -X DELETE https://acme.ext.passway.com/v1/sites/site_01jd8k3m2v9x4q7r5t6w8y0z1a \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H 'If-Match: "3f9a"'

Response

204 Deleted