Skip to main content

API keys

API keys authenticate your server to the Inttegro API. Create a separate key for each deployed integration so you can rotate or revoke one credential without interrupting the rest of your application.

Operations
POST/keys/generate

Generate a secret key

Creates a new secret key for your Inttegro account. Existing keys remain active.

The complete bearer token is returned only in this response. Lookup, list, update, revoke, and usage responses never return it. Save the token before your provisioning process finishes; Commerce cannot retrieve it for you later.

Request body

The request body is optional. Omit it or send an empty JSON object for an unlabeled key; include label to make the key easy to identify during rotation. No other request properties are accepted.

  • Name
    label
    Type
    string
    Description

    Optional human-readable name for the key. Surrounding whitespace is removed. If the normalized value is empty, label is omitted from the response.

Request

POST/keys/generate
curl https://api.inttegro.com/keys/generate \
--request POST \
--header "Authorization: Bearer $INTTEGRO_API_KEY" \
--header "Content-Type: application/json" \
--data '{"label":"Production checkout"}'

Response

A successful request returns HTTP 200 with exactly one top-level property, key.

  • Name
    id
    Type
    string
    Required
    required
    Description

    Stable identifier for managing the key. This is not the bearer credential.

  • Name
    issued_at
    Type
    timestamp
    Required
    required
    Description

    Time the key was created, in ISO 8601 format.

  • Name
    label
    Type
    string
    Description

    Normalized label. Omitted when no non-empty label was supplied.

  • Name
    token
    Type
    string
    Required
    required
    Description

    Complete bearer credential. Returned once and never returned by another key endpoint.

  • Name
    token_type
    Type
    string
    Required
    required
    Description

    Always bearer.

200 response

SDK versionv8.2.0
KeyResponse {
key: {},
}

If label is omitted, empty, or contains only whitespace, the successful response omits label:

200 response for an unlabeled key

SDK versionv8.2.0
KeyResponse {
key: {},
}

Status codes

StatusMeaning
200A new active key was created. Save key.token immediately.
401The bearer key is missing, invalid, expired, or revoked.
422The JSON body is invalid, contains unsupported attributes, or key generation failed.

Non-200 responses use the standard Commerce API error format.

Public key metadata

Key-management responses other than generation never contain token. They contain only the following public metadata fields:

  • Name
    active
    Type
    boolean
    Required
    required
    Description

    Whether the key can currently authenticate requests.

  • Name
    expires_at
    Type
    timestamp
    Description

    When the key expires. Omitted for a key without a fixed expiry.

  • Name
    id
    Type
    string
    Required
    required
    Description

    Stable key identifier.

  • Name
    issued_at
    Type
    timestamp
    Required
    required
    Description

    When the key was created.

  • Name
    label
    Type
    string
    Description

    Human-readable label. Omitted when the key is unlabeled.

  • Name
    last_used_at
    Type
    timestamp
    Description

    Most recent recorded use. Omitted when no usage timestamp is available.

  • Name
    revoked_at
    Type
    timestamp
    Description

    When the key was revoked. Omitted while the key has not been revoked.

  • Name
    status
    Type
    enum
    Required
    required
    Description

    Current lifecycle state: active, expired, or revoked.

  • Name
    token_type
    Type
    string
    Required
    required
    Description

    Always bearer.

  • Name
    updated_at
    Type
    timestamp
    Description

    When the label last changed. Omitted until the key is updated.

  • Name
    usage_count
    Type
    integer
    Description

    Number of recorded uses for the key. Omitted when the count is zero.

POST/keys/page

List keys

Lists your keys, newest first. The response includes revoked and expired keys so you can audit previous rotations. It never includes bearer tokens.

Request body

  • Name
    page
    Type
    integer
    Description

    Page number. Defaults to 1; 0 is normalized to 1. Do not send with number.

  • Name
    number
    Type
    integer
    Description

    Alias for page. Do not send both fields.

  • Name
    size
    Type
    integer
    Description

    Number of keys per page. Defaults to 50; values above 100 are capped at 100.

Response behavior

HTTP 200 returns page with exactly count, has_more, keys, number, size, and total. Each item in keys is public key metadata and omits token. Invalid pagination returns 422; missing or invalid authentication returns 401.

POST/keys/lookup

Look up a key

Returns one of your keys. The response never includes the bearer token.

Request body

  • Name
    secret_key_id
    Type
    string
    Required
    required
    Description

    Identifier returned when the key was generated. Send one key identifier.

Response behavior

HTTP 200 returns { "key": ... } containing public key metadata. An unknown key ID returns 404; an invalid request returns 422; missing or invalid authentication returns 401.

POST/keys/update

Update a key label

Changes the label for one of your keys. It does not rotate the token or change whether the key is active.

Request body

  • Name
    label
    Type
    string
    Required
    required
    Description

    New label. Surrounding whitespace is removed. Send an empty string to remove the label.

  • Name
    secret_key_id
    Type
    string
    Required
    required
    Description

    Identifier of the key to update.

Response behavior

HTTP 200 returns { "key": ... } containing the updated public key metadata without token. A missing key returns 404; an invalid request or failed update returns 422; an operation already in progress returns 409; temporary service unavailability returns 503; and missing or invalid authentication returns 401.

POST/keys/destroy

Revoke a key

Permanently prevents a key from authenticating new requests. Revocation does not delete its metadata or usage history.

Request body

  • Name
    secret_key_id
    Type
    string
    Required
    required
    Description

    Identifier of the key to revoke.

Response behavior

HTTP 200 returns { "key": ... } with active: false, status: "revoked", and revoked_at; it never includes token. A missing key returns 404; an invalid request or failed revocation returns 422; an operation already in progress returns 409; temporary service unavailability returns 503; and missing or invalid authentication returns 401.

POST/keys/usage

Review key usage

Returns recorded authentication activity for one of your keys. Use it to confirm a replacement is active before revoking the previous credential.

Request body

  • Name
    page
    Type
    integer
    Description

    Page number. Defaults to 1; 0 is normalized to 1. Do not send with number.

  • Name
    number
    Type
    integer
    Description

    Alias for page. Do not send both fields.

  • Name
    secret_key_id
    Type
    string
    Required
    required
    Description

    Identifier of the key whose activity you want to review.

  • Name
    size
    Type
    integer
    Description

    Number of activity records per page. Defaults to 50; values above 100 are capped at 100.

Response behavior

HTTP 200 returns key with public key metadata and usage with exactly count, has_more, number, rows, size, and total. Each row contains exactly secret_key_id, occurred_at, and auth_result; the key never includes token. A missing key returns 404; an invalid request or failed lookup returns 422; missing or invalid authentication returns 401.