> ## Documentation Index
> Fetch the complete documentation index at: https://openapi-docs.yidianting.cc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication & Authorization

> Authenticate with Partner API Keys, bind multiple facilities to one application key, and enforce least-privilege scopes.

## Partner API Key Model

Authorization in the AKE Parking International API is **partner-centric**:

1. You are issued a **Partner API Key** for your application (`ak_live_...`, `ak_test_...`, or `ak_local_...`).
2. One API Key can be bound to **one or multiple parking facilities (`facilityId`)** in the partner administration portal.
3. Every endpoint call validates both:
   * **Key validity & scope**: Does this key hold the required permission scope?
   * **Facility binding**: Is the requested `facilityId` bound to this key?

> [!NOTE]
>
> To discover all facilities currently bound to your API Key at runtime, call [`POST /v1/facilities/list`](https://openapi-docs.yidianting.cc/docs/api-reference/facilities-&-occupancy/list-authorized-facilities). Requests referencing an unbound `facilityId` return HTTP `403` (`FACILITY_ACCESS_DENIED`).

## Sending Your Credentials

Pass your API Key in the `Authorization` header using Bearer authentication on every HTTP request:

```http theme={null}
Authorization: Bearer ak_live_7f9c2a8b14e04d3c9920
Content-Type: application/json
```

Keep API keys strictly on your backend servers. Never embed `ak_live_` or `ak_local_` keys inside mobile apps, browser bundles, or public repositories.

## Permission Scopes

| Scope | Grants Access To | Privilege Tier |
| - | - | - |
| `facilities:read` | List facilities, inspect lane topologies, tariffs, and real-time occupancy counts | Standard |
| `facilities:write` | Adjust real-time occupancy counts | Operations / High-Privilege |
| `sessions:read` | Query active vehicles, single sessions, and historical parking logs | Standard |
| `sessions:write` | Correct misrecognized license plates and record manual entries | Standard / Operations (`manualEntry` is High-Privilege) |
| `fees:read` | Quote real-time fees and estimate parking fares | Standard |
| `payments:read` | Query settled payment transaction logs | Standard |
| `payments:write` | Notify payment completion and sync refunds | Standard |
| `validations:read` | List merchants, validation templates, vehicle validations, and grant history | Standard |
| `validations:write` | Grant validations, claim by code, and revoke unredeemed vouchers | Standard |
| `subscriptions:read` | List subscription plans and query parking subscriptions | Standard |
| `subscriptions:write` | Create, renew, update, freeze, unfreeze, and cancel parking subscriptions | Standard |
| `visitors:read` | Query timed visitor passes | Standard |
| `visitors:write` | Create and cancel timed visitor passes | Standard |
| `allowlists:read` | Query VIP and complimentary allowlist rules | Standard |
| `allowlists:write` | Upsert and remove VIP and complimentary allowlist rules | Standard |
| `blocklists:read` | Query security blocklist entries | Standard / Security |
| `blocklists:write` | Upsert and remove security blocklist entries (`DENY_ENTRY`, `ALERT_ONLY`) | Security / High-Privilege |
| `devices:read` | Inspect lane cameras, barriers, signage, and device online status | Standard |
| `gates:control` | Trigger audited barrier openings, change lane modes, push LED/voice prompts, and capture camera snapshots | Operations / High-Privilege |

> [!WARNING]
>
> **High-Privilege Operations:** `facilities:write`, `gates:control`, `blocklists:write`, and `POST /v1/sessions/manualEntry` are disabled by default for standard payment or merchant partners and are enabled only for certified facility operators and system integrators.

## Optional Request Signing (HMAC-SHA256)

For financial institutions or enterprise deployments requiring additional request-level replay protection over HTTPS, you can enable strict HMAC request signing on your Partner Key. When enabled, attach two additional headers to each request:

* `X-Ake-Timestamp`: Current Unix timestamp in seconds (requests older than 300 seconds are rejected).
* `X-Ake-Signature`: Lowercase hex `HMAC-SHA256` computed over `<timestamp>.<raw_json_body>` using your partner signing secret.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.