# Update a Dejavoo terminal

Relabels, enables or disables a terminal, re-enters its Auth Key, or updates its Register / ISV ids and FEED request record. Re-entering the Auth Key and enabling a disabled terminal re-check the credential with SPIn first. Terminals are disabled, never deleted.

Endpoint: PATCH /dejavoo/terminals/{id}
Version: 1.0

## Path parameters:

  - `id` (string, required)

## Header parameters:

  - `cc-api-key` (string, required)
    Chaching SECRET API key (sk_...)

## Request fields (application/json):

  - `label` (string)
    A new label, 1 to 64 characters.

  - `enabled` (boolean)
    Enable or disable the terminal. Enabling a disabled terminal re-checks its stored Auth Key with SPIn.

  - `spin_auth_key` (string)
    A new 10-character SPIn Auth Key. Checked with SPIn before it is saved. Write-only.

  - `register_id` (string)
    The Register ID, or null to clear it.

  - `isv_id` (string)
    The ISV identifier, 1 to 16 characters, or null to clear it.

  - `feed_enable_requested` (boolean)
    true records that Dejavoo was asked to enable FEED on this TPN (now); false clears the record.

## Response 200:

  - `200` (unknown)
    The updated terminal

## Response 200 fields (application/json):

  - `id` (string, required)
    The terminal id.

  - `object` (string, required)
    Object type.
    Enum: "dejavoo_terminal"

  - `tpn` (string, required)
    The terminal's 12-digit TPN.

  - `label` (string, required)
    The terminal label.

  - `enabled` (boolean, required)
    Whether the terminal is enabled.

  - `register_id` (string, required)
    The Register ID, if recorded.

  - `isv_id` (string, required)
    The ISV identifier, if recorded.

  - `spin_auth_key_set` (boolean, required)
    Always true: an Auth Key is stored. The key itself is never returned.
    Example: true

  - `credential_rotated_at` (number, required)
    Unix seconds of the last Auth Key re-entry, or null.

  - `last_probe_at` (number, required)
    Unix seconds of the last successful SPIn check, or null.

  - `last_probe_status` (string, required)
    The SPIn terminal status at the last successful check.
    Enum: "Online", "Offline"

  - `build` (string, required)
    The terminal build reported by SPIn, if any.

  - `serial` (string, required)
    The terminal serial number reported by SPIn, if any.

  - `feed_enable_requested_at` (number, required)
    Unix seconds when Dejavoo was recorded as asked to enable FEED on this TPN, or null.

  - `created` (number, required)
    Unix seconds when the terminal was registered.

## Response 400:

  - `400` (unknown)
    Missing apiKey header; invalid apiKey format; invalid request body or id; DEJAVOO_TERMINAL_UPDATE_EMPTY (no updatable key sent).

## Response 401:

  - `401` (unknown)
    Invalid API key

## Response 403:

  - `403` (unknown)
    SECRET_API_KEY_REQUIRED: a publishable (pk_) key was presented.

## Response 404:

  - `404` (unknown)
    DEJAVOO_TERMINAL_NOT_FOUND: no such terminal on this account.

## Response 409:

  - `409` (unknown)
    SPIN_AUTH_KEY_UNREADABLE (the stored Auth Key cannot be read); or an Authorization header was sent.

## Response 422:

  - `422` (unknown)
    SPIN_CREDENTIALS_REJECTED: SPIn did not accept the TPN and Auth Key.

## Response 503:

  - `503` (unknown)
    SPIN_UNREACHABLE: SPIn could not be reached; nothing was changed.

