# Charge Key Authorizations (Key Owner)

One row per charge-key authorization attempt (an RFID/vehicle-ID tap or a roaming request) for keys
you own — everywhere those keys were used, including on other operators' hardware while roaming.
Charge-point details are only included when the charge point is public; otherwise those columns are
empty, since you don't own the hardware.

If you also own the charge point a key was used on, see
[Charge Key Authorizations (Charge Point Owner)](/docs/charge_key_authorizations_charge_point_owner) for
that side of the data.

**SQL:** `charge_key_authorizations_key_owner`

## Schema

| Column Name                     | Data Type     | Description                                                                                          |
|:---------------------------------|:--------------|:-------------------------------------------------------------------------------------------------------|
| **Primary ID**                   |               |                                                                                                          |
| authorization_id                 | INTEGER       | Primary key of the authorization attempt                                                               |
| **Other IDs**                     |               |                                                                                                          |
| duplicate_of_auth_id              | INTEGER       | The canonical authorization this row duplicates; empty when this row is the real event                 |
| charge_key_id                     | INTEGER       | The charge key (RFID/vehicle-ID) presented, if resolvable                                              |
| charge_key_operator_id            | INTEGER       | Operator that owned the charge key at the time of the attempt                                          |
| charge_key_parent_operator_id     | INTEGER       | Parent operator of charge_key_operator_id, if any                                                       |
| charge_key_team_id                | INTEGER       | Team that owned the charge key at the time of the attempt                                              |
| charge_key_user_id                | INTEGER       | User that owned the charge key at the time of the attempt                                              |
| charge_point_id                   | INTEGER       | Always empty in this table — you only see charge point identifiers when you own the charge point too, via `charge_key_authorizations_charge_point_owner` |
| charge_point_integration_id       | INTEGER       | Always empty in this table                                                                              |
| charge_point_operator_id          | INTEGER       | Always empty in this table                                                                              |
| charge_point_parent_operator_id   | INTEGER       | Always empty in this table                                                                              |
| charge_point_team_id              | INTEGER       | Always empty in this table                                                                              |
| ocpi_operator_id                  | INTEGER       | OCPI counterparty operator id, if the attempt was a roaming request                                     |
| hubject_operator_id               | INTEGER       | Hubject counterparty operator id, if the attempt was routed through Hubject                             |
| charge_id                         | INTEGER       | The resulting charge, if the authorization led to one                                                  |
| request_id                        | VARCHAR       | Identifier of the originating request                                                                  |
| **Timestamps**                    |               |                                                                                                          |
| occurred_at                       | TIMESTAMP_NTZ | When the authorization attempt occurred                                                                |
| created_at                        | TIMESTAMP_NTZ | When the record was created                                                                             |
| updated_at                        | TIMESTAMP_NTZ | When the record was last updated                                                                        |
| **Filters**                       |               |                                                                                                          |
| is_duplicate                      | BOOLEAN       | True when this row is a fan-out duplicate (duplicate_of_auth_id is not empty)                           |
| **Attributes**                    |               |                                                                                                          |
| charge_key_name                   | VARCHAR       | Display name of the charge key                                                                          |
| charge_point_name                 | VARCHAR       | Display name of the charge point; empty unless the charge point is public                               |
| charge_point_operator_name        | VARCHAR       | Name of the operator that owned the charge point; empty unless the charge point is public                |
| charge_point_address1             | VARCHAR       | Charge point street address; empty unless the charge point is public                                   |
| charge_point_city                 | VARCHAR       | Charge point city; empty unless the charge point is public                                              |
| charge_point_zip                  | VARCHAR       | Charge point postal code; empty unless the charge point is public                                       |
| charge_point_visibility           | VARCHAR       | Charge point visibility setting (e.g. public/private); empty unless the charge point is public          |
| result                            | VARCHAR       | Outcome of the authorization attempt (e.g. allowed, denied, error)                                     |
| reason                            | VARCHAR       | Detailed reason code for the result. May include your driver's financial-state detail (e.g. an insufficient-credit decline) |
| raw_reason_code                   | VARCHAR       | Raw upstream reason code, pre-normalization                                                             |
| reason_vocabulary                 | VARCHAR       | Vocabulary/version the reason code was drawn from                                                       |
| attempts                          | INTEGER       | Number of attempts recorded for this authorization event                                                |
| token_identifier                  | VARCHAR       | Full credential token presented to the hardware — this is your own key, so it's not masked              |
| token_identifier_last4            | VARCHAR       | Last 4 characters of the token identifier; empty if the token is too short or absent                    |
| channel                           | VARCHAR       | Channel the authorization request came through                                                         |
| source                            | VARCHAR       | Source system of the authorization event                                                                |
| direction                         | VARCHAR       | Inbound (own EVSE) or outbound (roaming out) direction of the request                                   |
| partner_country_code              | VARCHAR       | Country code of the roaming partner, if applicable                                                      |
| partner_party_id                  | VARCHAR       | OCPI party id of the roaming partner, if applicable                                                     |
| location_id                       | VARCHAR       | OCPI location id of the charge point; empty unless the charge point is public                            |
| evse_uid                          | VARCHAR       | EVSE identifier the attempt targeted; empty unless the charge point is public                            |
| connector_id                      | VARCHAR       | Connector identifier the attempt targeted; empty unless the charge point is public                       |
| session_reference                 | VARCHAR       | External session reference, if any                                                                       |
| authorizer                        | VARCHAR       | System/actor that authorized the attempt                                                                 |
| message                           | VARCHAR       | Free-text diagnostic message; may include your driver's financial-state detail (e.g. an insufficient-credit decline) |

## Data inclusion criteria
- You (or a team under your parent operator) own the charge key that was presented

## Data flow
| Upstream tables | Downstream tables |
|:-----------------|:-------------------|
| `charge_keys`     | ---                 |
| `charge_points`   |                     |
