# Fuse

OpenAPI document for this API: https://docs.neobits.ai/openapi/fuse.json

Fuse is a unified data aggregation API that provides fully structured, calculated, and cross-referenced person data through a single integration point. Built for banks, lenders, and regulated environments, Fuse delivers actionable insights that power better decision-making across your organization.

Instead of connecting to 10+ separate APIs to gather customer information, Fuse consolidates all your data needs into one streamlined integration—significantly reducing development time and ongoing maintenance overhead.

## Key Benefits

**Unified Customer Profile** — Fuse incorporates advanced logic for inferring, calculating, and matching data from diverse sources to construct a comprehensive customer profile. Data is automatically cross-referenced and validated to ensure accuracy and completeness.

**Single Integration Point** — Access personal data from multiple registries through one API. This reduces the complexity of managing multiple vendor relationships, credentials, and integration contracts.

**Cost Efficiency** — Repeated and duplicate customer applications often lead to higher API expenses with minimal benefit. Fuse enables you to efficiently search and reuse data from previous inquiries at no additional cost, optimizing your data spend.

## Core Concepts

Fuse is built around two primary resources: **Inquiries** and **Persons**.

**Inquiry** — An Inquiry represents a data collection process for a specific person. When you need to gather information about a customer, you create an Inquiry. The Inquiry tracks what data has been requested, what consent has been obtained, and serves as the container for all fetched person data.

**Person** — A Person represents the individual whose data is being collected. Data that needs the person's consent is only returned through an Inquiry the person has completed: pass its `inquiryId` when you get the person. Data that needs no consent can be fetched with the national identity number alone, without an Inquiry.

## Consent Flow

Some data sources require explicit consent from the end user before their data can be accessed. When fetching consent-protected information, the following flow applies:

1.  **Create an Inquiry** — Initialize an Inquiry for the person using their national identity number.
2.  **Redirect for Consent** — If the requested data requires consent, direct the end user to the Inquiry's `url`. Its `isCompleted` stays `false` until the user has completed it, and each `prerequisites[].isCompleted` shows whether the user has completed that step.
3.  **User Completes Consent** — The end user authenticates and grants permission for their data to be accessed. In test, consent skips Altinn and needs no login. See [consent in test](https://docs.neobits.ai/api-reference/tag/fuse/testing.md#consent-in-test).
4.  **Fetch Person Data** — Once the Inquiry's `isCompleted` is `true`, get the person with its `inquiryId`. Before that, the request returns `409` with code `409-002`. Fuse aggregates information from all connected registries and returns a unified response.

## Data Reuse

Previously fetched data remains available within an Inquiry, allowing you to query additional information without re-fetching from source systems. You can also search for existing Inquiries to reuse data from previous requests, reducing costs and improving response times.

## Getting Started

To use this API in production, you must register Neobits as a provider in Altinn. Access must be provided for the Norwegian Population Registry and Samtykkebasert Lånesøknad. In test, you can start without it, because consent skips Altinn. See [consent in test](https://docs.neobits.ai/api-reference/tag/fuse/testing.md#consent-in-test).

In both test and production, authenticate with your API credentials and begin making requests to the Fuse endpoints documented below.

## Authentication and Scopes

Fuse is served from your tenant's host, and each path starts with the API's major version: `https://{tenant}.fuse.server.test.neobits.ai` for test and `https://{tenant}.fuse.server.prod.neobits.ai` for production.

Fuse endpoints take an OAuth 2.0 bearer token. Request one from your tenant's Core host with the client credentials flow, sending your client's `username` and `password` with HTTP Basic, exactly as you received them (see [Core](https://docs.neobits.ai/api-reference/tag/core-authz.md#getting-started)). Set `resource` to your Fuse host and `scope` to every scope you need:

```bash
curl --request POST 'https://your-tenant.core.server.test.neobits.ai/v1/oauth2/token' \
  --user "$CLIENT_USERNAME:$CLIENT_PASSWORD" \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'resource=https://your-tenant.fuse.server.test.neobits.ai' \
  --data-urlencode 'scope=inquiry:write inquiry:read person:read'
```

Send the `access_token` from the response in the `Authorization: Bearer` header. Your client needs at least one Fuse scope to request a token for your Fuse host; see [access tokens](https://docs.neobits.ai/api-reference/tag/core-authz.md#access-tokens) for lifetime and audience rules.

Fuse also serves only clients with a subscription. Set `subscription_id` when you [create the client](https://docs.neobits.ai/api-reference/operation/createClient/method/post.md). Core issues a Fuse token to a client without a subscription, but every Fuse endpoint answers that token with `403` and code `403-000`, saying the client has no subscription. The fields Fuse returns depend on your subscription's products, which you can list with [GET /v1/products](https://docs.neobits.ai/api-reference/operation/getProducts/method/get.md).

Each endpoint requires a scope, which must be assigned to your client directly or through its role, and requested in the token. A missing scope returns `403` with code `403-001`.

-   Create an inquiry: `inquiry:write`
-   Get an inquiry: `inquiry:read`
-   Get a person: `person:read`
-   Read terms: `terms:read`
-   Create or update terms: `terms:write`
-   Delete terms: `terms:delete`

## Retries and Idempotency

Creating an inquiry supports an `Idempotency-Key` header. Send a unique key of up to 128 characters, such as a UUID, with each `POST /v2/inquiries` and send the same key when you retry that request. Keep the following in mind before retrying a request:

-   A repeated key returns `201 Created` with the inquiry the first request created, in its current state. Its notifications are not sent again. Keys are scoped to your client and do not expire.
-   Repeating a key with another `ssn` or `externalId` returns `409 Conflict` with code `409-002`. Send a new key instead of retrying.
-   A non-2xx response does not store the key, so a retry with the same key creates the inquiry and sends its notifications. If sending notifications fails, the inquiry the failed request created is kept but no longer holds the key.
-   Repeating a key while the first request is still sending its notifications, or while it fails, returns `409 Conflict` with code `409-000`. Retry it with the same key.
-   Without the header, every `POST /v2/inquiries` creates a new inquiry with a new ID and sends the requested notifications again. The `externalId` is stored as given; it is not required to be unique and does not deduplicate requests.
-   `GET` requests are safe to retry.

## Endpoints

- [Create an inquiry](https://docs.neobits.ai/api-reference/operation/inquiries-post/method/post.md): `POST /v2/inquiries`
- [Get an inquiry](https://docs.neobits.ai/api-reference/operation/inquiry/method/get.md): `GET /v2/inquiries/{inquiryId}`
- [Get a person](https://docs.neobits.ai/api-reference/operation/person/method/get.md): `GET /v2/persons/{ssn}`
- [Create terms](https://docs.neobits.ai/api-reference/operation/terms-post/method/post.md): `POST /v2/terms`
- [List terms](https://docs.neobits.ai/api-reference/operation/terms-list/method/get.md): `GET /v2/terms`
- [Get terms](https://docs.neobits.ai/api-reference/operation/term-get/method/get.md): `GET /v2/terms/{id}`
- [Update scheduled terms](https://docs.neobits.ai/api-reference/operation/term-patch/method/patch.md): `PATCH /v2/terms/{id}`
- [Delete terms](https://docs.neobits.ai/api-reference/operation/term-delete/method/delete.md): `DELETE /v2/terms/{id}`