# Get Appointment change history

Returns the audit trail of an Appointment: creation, edits, deletion and restoration,
with the Business User who made each change and the values before (`from`) and after (`to`) it.
Only the fields that changed are filled in `from` and `to`; unchanged fields are `null`
(or an empty `services` array).
Client phone numbers are partially masked when the Business User has no access to client
phone numbers. The Business User needs access to the Appointment.

Endpoint: GET /locations/{location_id}/appointments/{record_id}/changes
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (integer, required)
    Location ID

  - `record_id` (integer, required)
    Appointment ID

## Header parameters:

  - `Accept` (string, required)

  - `Content-Type` (string, required)

  - `Authorization` (string, required)
    Bearer {partner_token}, User {user_token}

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `success` (boolean)

  - `data` (array)

  - `data.date` (string)
    Date and time of the change (ISO 8601)

  - `data.event_type_id` (integer)
    Change type: 1 - created, 2 - edited, 3 - deleted, 4 - restored
    Enum: "1", "2", "3", "4"

  - `data.user` (object)
    Business User who made the change

  - `data.user.id` (integer)

  - `data.user.name` (string)

  - `data.user.phone` (string)

  - `data.user.email` (string)

  - `data.user.is_approved` (boolean)

  - `data.user.avatar` (string)

  - `data.from` (object)
    Appointment values on one side of a change. Fields that did not change are `null`.

  - `data.from.date` (string | null)
    Appointment date and time (ISO 8601)

  - `data.from.length` (integer | null)
    Appointment duration in seconds

  - `data.from.attendance_status` (integer | null)
    Appointment status: -1 - no-show, 0 - pending, 1 - arrived, 2 - confirmed

  - `data.from.master` (object | null)
    Team Member. `master` is the literal legacy field name.

  - `data.from.master.id` (integer)

  - `data.from.master.name` (string)

  - `data.from.master.avatar` (string)

  - `data.from.services` (array)
    Services of the Appointment when they changed, otherwise an empty array

  - `data.from.services.id` (integer)

  - `data.from.services.category_id` (integer)

  - `data.from.services.is_category` (boolean)

  - `data.from.services.title` (string)

  - `data.from.services.online_sale_title` (string)

  - `data.from.client` (object | null)
    Client of the Appointment. The phone is partially masked without access to client phone numbers.

  - `data.from.client.name` (string)

  - `data.from.client.phone` (string)

  - `meta` (object)

  - `meta.count` (integer)
    Number of entries

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Appointment not found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

