Schedules

Weekly time windows that access policies refer to.

The schedule model

Weekly time windows. Access is allowed while any rule matches.

Properties

  • Name
    id
    Type
    string
    Description

    Schedule 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 for the rules. null means each door's site time zone. Can be null.

  • Name
    rules
    Type
    array of objects
    Description

    The windows.

  • Name
    rules[].days
    Type
    array of strings
    Description

    Days the window applies to. One of mon, tue, wed, thu, fri, sat, sun.

  • Name
    rules[].from
    Type
    string
    Description

    Start of the window, inclusive.

  • Name
    rules[].to
    Type
    string
    Description

    End of the window, exclusive. 24:00 runs to midnight.

  • Name
    labels
    Type
    object
    Description

    Labels.

  • Name
    managed_by
    Type
    string
    Description

    The tool that manages this resource, such as terraform. Can be null.

  • Name
    created_at
    Type
    timestamp
    Description

    When the schedule was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    When the schedule last changed.


GET/v1/schedules

List schedules

Needs the schedules: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/schedules
curl https://acme.ext.passway.com/v1/schedules \
  -H "Authorization: Bearer $PASSWAY_TOKEN"

Response

{
  "data": [
    {
      "id": "sch_01jd8k3m2v9x4q7r5t6w8y0z1a",
      "etag": "3f9a",
      "name": "weekdays",
      "description": "…",
      "time_zone": "America/New_York",
      "rules": [
        {}
      ],
      "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/schedules

Create a schedule

Needs the schedules: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
    rules
    Type
    array of objects
    Description

    The windows, 1 to 32.

Optional attributes

  • Name
    description
    Type
    string
    Description

    Free text.

  • Name
    time_zone
    Type
    string
    Description

    Time zone for the rules. Leave out to use each door's site time zone.

  • Name
    rules[].days
    Type
    array of strings
    Description

    Days the window applies to. One of mon, tue, wed, thu, fri, sat, sun.

  • Name
    rules[].from
    Type
    string
    Description

    Start of the window, inclusive.

  • Name
    rules[].to
    Type
    string
    Description

    End of the window, exclusive. 24:00 runs to midnight.

  • Name
    labels
    Type
    object
    Description

    Labels.

  • Name
    managed_by
    Type
    string
    Description

    The tool that manages this resource. Terraform sets terraform.

Request

POST
/v1/schedules
curl -X POST https://acme.ext.passway.com/v1/schedules \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weekdays",
    "time_zone": "America/New_York",
    "rules": [
      {
        "days": [
          "mon"
        ],
        "from": "07:30",
        "to": "07:30"
      }
    ],
    "labels": {
      "passway.example/cost-center": "4410",
      "team": "facilities"
    },
    "managed_by": "terraform"
  }'

Response

{
  "id": "sch_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "weekdays",
  "description": "…",
  "time_zone": "America/New_York",
  "rules": [
    {
      "days": [
        "mon"
      ],
      "from": "07:30",
      "to": "07:30"
    }
  ],
  "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/schedules/{schedule_id}

Get a schedule

Needs the schedules:read scope.

Path parameters

  • Name
    schedule_id
    Type
    string
    Description

    Schedule ID: sch_ followed by 1 to 64 lowercase letters and digits.

Request

GET
/v1/schedules/{schedule_id}
curl https://acme.ext.passway.com/v1/schedules/sch_01jd8k3m2v9x4q7r5t6w8y0z1a \
  -H "Authorization: Bearer $PASSWAY_TOKEN"

Response

{
  "id": "sch_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "weekdays",
  "description": "…",
  "time_zone": "America/New_York",
  "rules": [
    {
      "days": [
        "mon"
      ],
      "from": "07:30",
      "to": "07:30"
    }
  ],
  "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/schedules/{schedule_id}

Update a schedule

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 schedules:write scope.

Path parameters

  • Name
    schedule_id
    Type
    string
    Description

    Schedule ID: sch_ 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, or null to use each door's site time zone. Can be null.

  • Name
    rules
    Type
    array of objects
    Description

    New rules, replacing the current ones.

  • Name
    rules[].days
    Type
    array of strings
    Description

    Days the window applies to. One of mon, tue, wed, thu, fri, sat, sun.

  • Name
    rules[].from
    Type
    string
    Description

    Start of the window, inclusive.

  • Name
    rules[].to
    Type
    string
    Description

    End of the window, exclusive. 24:00 runs to midnight.

  • 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/schedules/{schedule_id}
curl -X PATCH https://acme.ext.passway.com/v1/schedules/sch_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": "sch_01jd8k3m2v9x4q7r5t6w8y0z1a",
  "etag": "3f9a",
  "name": "weekdays",
  "description": "…",
  "time_zone": "America/New_York",
  "rules": [
    {
      "days": [
        "mon"
      ],
      "from": "07:30",
      "to": "07:30"
    }
  ],
  "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/schedules/{schedule_id}

Delete a schedule

A schedule that access policies use returns 409 with /problems/has-dependents.

Needs the schedules:write scope.

Path parameters

  • Name
    schedule_id
    Type
    string
    Description

    Schedule ID: sch_ 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/schedules/{schedule_id}
curl -X DELETE https://acme.ext.passway.com/v1/schedules/sch_01jd8k3m2v9x4q7r5t6w8y0z1a \
  -H "Authorization: Bearer $PASSWAY_TOKEN" \
  -H 'If-Match: "3f9a"'

Response

204 Deleted