Authentication

Create API keys, keep test and live data apart, and rotate keys safely.

Every request carries an API key in the Authorization header:

Authorization: Bearer <API key>

You create keys in the AirCredit account settings. Use them only on your own servers. Keep them out of source control, browser code and logs. Test and live keys use the same base URL, https://api.aircredit.de/partner.

Create a key

Open Partner API in the AirCredit account settings and create a key, either for your personal workspace or for an organization. AirCredit shows the key only once. Copy it before you close the dialog.

Integrations

Every key belongs to an integration. An integration represents one system that calls the API, such as your broker platform or a back-office tool. Your first key creates an integration automatically. Its name is in your language, for example "Default". Create one more integration for each additional system.

The integration owns everything its keys create: files, analyses, webhooks and the idempotency records that make retries safe. Keys of another integration get 404 not_found for all of it, even with a known ID. Files and analyses you create through the API are separate from your submissions in the AirCredit app.

Test and live keys

A key is either a test key, which begins with sk_test_, or a live key, which begins with sk_live_. You choose the mode when you create the key, and it never changes.

Test and live keys of the same integration see separate data. A test key cannot read live files or analyses. A live key cannot read test ones. Every file, analysis and webhook event states its mode in mode.

A test key is free and processes nothing (Test mode). A live key processes documents and charges your prepaid balance (Billing).

Check access

To test a key, fetch the catalog with GET /v1/catalog. It is the simplest request that requires a valid key. This example fetches it and prints the fields and checks of one template:

// Looks up which fields and checks a builtin template holds.
import { Client } from "@aircredit/sdk/partner/v1";

const client = Client.fromEnv();
const catalog = await client.getCatalog();

// Each template maps your result keys to builtin fields and checks.
const template = catalog.templates.default_personal_property_purchase;
if (template) {
  console.log(template.title);
  console.log("fields:", Object.keys(template.fields));
  console.log("checks:", Object.keys(template.checks));
}

If the request fails, the status code and error code tell you why:

ResponseMeaning
401 invalid_api_keyThe key is missing, invalid, expired or revoked.
403 api_client_disabledAirCredit recognized the key, but its integration is disabled.
403 permission_deniedAirCredit recognized the key, but it may not perform this operation.

When you report a failed request to AirCredit, include the x-request-id response header. The request_id in the error body holds the same value.

Rotate a key

To replace a key without interrupting your systems:

  1. Under Partner API, create a new key of the same mode for the same integration.
  2. Switch your systems to the new key and confirm that requests succeed.
  3. Revoke the old key.

A revoked key stops working immediately. The other keys of the integration keep working. Files, analyses, idempotency records and webhooks are not affected, because they belong to the integration, not to a key.

Delete an integration

Deleting an integration under Partner API revokes all its keys immediately. It also deletes the integration's files, analyses, idempotency records and webhooks, in both test and live mode. Queued analyses that have not started are canceled and refunded. Charges, refunds and usage remain in your billing history.

On this page