# Get Started with Neobits

Neobits offers innovative financial technology solutions that simplify data gathering for banks and financial institutions. Our platform leverages cutting-edge technology to reduce integration complexity and costs.

Our technology stack includes secure API gateways, advanced data processing pipelines, and real-time analytics capabilities. We prioritize security, performance, and ease of use in all our offerings.

### Account Creation

❗

#### Account Creation

Accounts must be created with Neobits customer support.

To get started, please send an email to: [hello@neobits.no](mailto:hello@neobits.no)

### Our APIs

⚡

#### Core API

Handles authentication (OAuth 2.0 client credentials or basic auth) and administration of clients.

-   Supports OAuth 2.0 client credentials
-   Supports basic authentication
-   Comprehensive client administration
-   Secure token management

[Explore Core API Documentation →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

⚡

#### Fuse API

Our innovative solution that connects disparate data sources into a unified, easy-to-consume format.

Learn more about Fuse's capabilities on our [website](https://neobits.ai/).

[Explore Fuse API Documentation →](https://docs.neobits.ai/api-reference/tag/fuse.md)

⚠️

#### Error Handling

Our APIs use consistent error codes and messages to help you handle errors gracefully.

[View Error Reference →](https://docs.neobits.ai/api-reference/errors.md)

### Rate Limits

Requests are rate limited per client IP address, currently at 10,000 requests per minute. A request over the limit gets 429 Too Many Requests with a Retry-After header: the number of seconds to wait before you retry. Retrying sooner only extends the wait.

Core answers in its OAuth 2.0 error format, with {"error":"too\_many\_requests","error\_code":"429-000"}. Fuse and Logic use the standard error format, with {"errors":\[{"name":"TooManyRequests","code":"429-000"}\]}. Because these requests never reach the API, the response has no timestamp, moreInfo or X-Request-ID.

Reuse access tokens until they expire instead of requesting a new token for every call. For a 429 without Retry-After, retry with exponential backoff and jitter.

### Retries and Idempotency

GET requests are safe to retry. Fuse inquiry creation and Logic executions and evaluations accept an Idempotency-Key header; any other retried POST is processed as a new request, so check whether the first attempt succeeded before you send it again.

The [Fuse](https://docs.neobits.ai/api-reference/tag/fuse.md#retries-and-idempotency) and [Logic](https://docs.neobits.ai/api-reference/tag/logic.md#handling-failures) introductions describe how their write operations behave when repeated.

### Versioning

Every API includes its major version in the path, for example /core/v1/oauth2/token, /logic/v1/deployments and /fuse/v2/inquiries. The exception is the discovery document and key set under /core/.well-known, which stay at the token issuer /core.

Changes, including deprecations, are listed in the release notes for [Core](https://docs.neobits.ai/api-reference/tag/core-authz/releases) and [Fuse](https://docs.neobits.ai/api-reference/tag/fuse/releases).

### Machine-Readable Docs

For code generators, API clients and AI coding agents:

-   The [OpenAPI 3.1 document](https://docs.neobits.ai/openapi.json) for every API, and one per API: [Core](https://docs.neobits.ai/openapi/core-authz.json), [Fuse](https://docs.neobits.ai/openapi/fuse.json) and [Logic](https://docs.neobits.ai/openapi/logic.json).
-   [llms.txt](https://docs.neobits.ai/llms.txt), an index of these docs in markdown, and [llms-full.txt](https://docs.neobits.ai/llms-full.txt) with every page in one file.
-   Every page as markdown: append .md to its URL, for example [/api-reference/get-started.md](https://docs.neobits.ai/api-reference/get-started.md).

### Next Steps

After creating your account, you can:

1.  Explore our API documentation
2.  Request access credentials
3.  Test the APIs in our sandbox environment
4.  Integrate with your systems

---

## Error Handling

All API errors include an HTTP status code, a unique error code, and a descriptive message. This guide documents all possible errors that can occur when interacting with our APIs.

⚠️

**Note:** The Core API uses OAuth 2.0 compliant error responses, which have a different structure than the standard format. See the response format sections below for details.

## Standard Error Response

All APIs except Core use the following error response structure:

```json
{
    "timestamp": "2024-01-15T10:30:00.000Z",
    "moreInfo": "https://docs.neobits.ai/",
    "errors": [
        {
            "name": "BadRequestError",
            "code": "400-001",
            "message": "Field 'ssn' is required"
        }
    ]
}
```

-   **timestamp** - ISO 8601 formatted date and time when the error occurred
-   **moreInfo** - URL to the documentation for more information
-   **errors** - Array of error objects containing:

-   **name** - The error type identifier
-   **code** - A unique error code in the format `HTTP_STATUS-SEQUENCE`
-   **message** - A human-readable description of the error

  

## OAuth 2.0 Error Response (Core API)

The Core API follows the OAuth 2.0 specification for error responses:

```json
{
    "error": "invalid_request",
    "error_code": "400-001",
    "error_uri": "https://docs.neobits.ai/",
    "error_description": "Field 'client_id' is required",
    "error_timestamp": "2024-01-15T10:30:00.000Z"
}
```

-   **error** - OAuth 2.0 error code (e.g., invalid\_request, unauthorized, access\_denied)
-   **error\_code** - A unique error code in the format `HTTP_STATUS-SEQUENCE`
-   **error\_uri** - URL to the documentation for more information
-   **error\_description** - A human-readable description of the error
-   **error\_timestamp** - ISO 8601 formatted date and time when the error occurred

  

## Error Types by HTTP Status Code

400

BadRequest

The request was invalid or malformed. This typically occurs due to validation errors, missing required fields, or invalid field values.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 400-000 | BadRequest | Generic bad request error | Fuse, Core |
| 400-001 | FieldRequired | A required field is missing from the request | Fuse, Core |
| 400-002 | FieldUnknown | An unknown or unexpected field was provided | Fuse, Core |
| 400-003 | FieldValueInvalid | The field value is invalid or not allowed | Fuse, Core |
| 400-004 | FieldTypeInvalid | The field type does not match the expected type | Fuse, Core |
| 400-005 | FieldValueEmpty | The field value is empty when a value is required | Fuse, Core |
| 400-006 | ResourceAlreadyExists | The resource being created already exists | Fuse |
| 400-007 | FeatureNotEnabled | The requested feature is not enabled for your account | Fuse |
| 400-008 | Unknown | An unknown bad request error occurred | Fuse, Core |
| 400-100 | PasswordWeak | The password does not meet security requirements | Core |
| 400-101 | PasswordTooShort | The password is too short | Core |
| 400-102 | InvalidEmail | The email address format is invalid | Fuse, Core |
| 400-103 | InvalidUri | The URI format is invalid | Fuse, Core |
| 400-104 | InvalidUuid | The UUID format is invalid | Fuse, Core |
| 400-105 | InvalidLength | The field length does not meet requirements | Fuse, Core |
| 400-106 | InvalidPattern | The field does not match the required pattern | Fuse, Core |
| 400-107 | InvalidFormat | The field format is invalid | Fuse, Core |
| 400-108 | InvalidCodeChallenge | The PKCE code challenge is invalid | Core |
| 400-109 | InvalidCodeChallengeMethod | The PKCE code challenge method is invalid | Core |
| 400-110 | InvalidAuthorizationCode | The authorization code is invalid | Core |
| 400-111 | AuthorizationCodeExpired | The authorization code has expired | Core |
| 400-112 | AuthorizationCodeAlreadyUsed | The authorization code has already been used | Core |

  

401

Unauthorized

Authentication is required but was not provided or is invalid. Verify your credentials and try again.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 401-000 | Unauthorized | Generic unauthorized error - client is not authenticated | Fuse, Core |
| 401-001 | InvalidCredentials | The provided credentials are invalid | Fuse, Core |
| 401-002 | InvalidToken | The authentication token is invalid or expired | Fuse, Core |
| 401-003 | AccountLocked | The account has been locked due to security reasons | Core |
| 401-004 | AccountDisabled | The account has been disabled | Core |
| 401-005 | EmailNotVerified | The email address has not been verified | Core |
| 401-006 | ClientDisabled | The API client has been disabled | Fuse, Core |
| 401-007 | InvalidAuthorizationFlow | The authorization flow is invalid or not supported | Core |

  

403

Forbidden

The authenticated user does not have permission to access the requested resource.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 403-000 | Forbidden | Generic forbidden error - access denied | Fuse, Core |
| 403-001 | InsufficientPermissions | The user lacks the required permissions for this action | Fuse, Core |

  

404

NotFound

The requested resource could not be found. Verify the resource identifier and try again.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 404-000 | NotFound | Generic not found error | Fuse, Core |
| 404-001 | Resource | The requested resource does not exist | Fuse, Core |
| 404-002 | Upstream | The resource was not found in an upstream service | Fuse |

  

409

Conflict

The request conflicts with the current state of the resource.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 409-000 | Conflict | Generic conflict error | Fuse, Core |
| 409-001 | ResourceAlreadyExists | A resource with the same identifier already exists | Fuse, Core |
| 409-002 | StateMismatch | The resource state does not allow this operation | Fuse |

  

422

UnprocessableContent

The request was well-formed but the content could not be processed.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 422-000 | UnprocessableContent | Generic unprocessable content error | Fuse |
| 422-001 | UpstreamResponseUnsupported | The response from an upstream service is not supported | Fuse |

  

429

TooManyRequests

The rate limit has been exceeded. Wait the number of seconds in the Retry-After header before making additional requests.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 429-000 | TooManyRequests | Rate limit exceeded - please try again later | Fuse, Core |

  

500

InternalServerError

An unexpected error occurred on the server. If the problem persists, please contact support.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 500-000 | InternalServer | An unexpected internal error occurred | Fuse, Core |
| 500-001 | Configuration | A server configuration error occurred | Fuse, Core |

  

502

BadGateway

An upstream service returned an error response. This is typically a temporary issue.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 502-000 | BadGateway | Error while interacting with a third party service | Fuse |
| 502-001 | ConnectionAborted | The connection to an upstream service was aborted | Fuse |

  

503

ServiceUnavailable

The service is temporarily unavailable. Retry after a short delay.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 503-000 | ServiceUnavailable | The service is temporarily unavailable. Retry after a short delay. | Fuse |

  

504

GatewayTimeout

The request timed out while waiting for an upstream service.

| Code | Code Name | Description | APIs |
| --- | --- | --- | --- |
| 504-000 | GatewayTimeout | Gateway timeout while waiting for an upstream service | Fuse |

  

  

## Best Practices for Error Handling

1.  **Check the error code** - Use the error code to programmatically handle specific error scenarios. The code is stable and will not change without prior notice.
2.  **Log errors for debugging** - Include the full error response in your logs, especially the timestamp and error code fields.
3.  **Implement retry logic** - For 5xx errors, implement exponential backoff retry logic. For 429 errors, wait the number of seconds in the `Retry-After` header before retrying, and fall back to exponential backoff when it is missing.
4.  **Display user-friendly messages** - Use the error message field to display human-readable error messages to end users.
5.  **Contact support if needed** - If you encounter persistent 500 errors, contact our support team with the error details and timestamp.

---

# Core (Authz)

OpenAPI document for this API: https://docs.neobits.ai/openapi/core-authz.json

## OAuth 2.0 Authorization Server

The Authentication API is a full-featured OAuth 2.0 server implementation that specializes in secure machine-to-machine (M2M) authentication using the client credentials back channel flow. This flow is optimized for server-side applications that need to securely communicate with APIs without user interaction.

### Key Capabilities

As a complete OAuth 2.0 authorization server, the API provides:

-   →
    
    Token Endpoint /core/v1/oauth2/token
    
    Issues access tokens to clients using the client credentials grant type, supporting secure back channel communication
    
-   →
    
    Token Introspection /core/v1/oauth2/introspect
    
    Validates tokens and returns metadata about their scope and validity
    
-   →
    
    Client Management
    
    Comprehensive endpoints for creating, retrieving, updating, and deleting OAuth client applications with configurable scopes and credentials
    
-   →
    
    Basic Authentication
    
    Alternative authentication method for simpler integration scenarios
    
-   →
    
    Standard Discovery
    
    OpenID Connect discovery endpoints for automated configuration
    

### Getting Started

To use the Authentication API, you'll need valid client credentials (client ID and client secret). To get your credentials, please send an email to [hello@neobits.no](mailto:hello@neobits.no) with details about your integration needs.

For OAuth 2.0 authentication, your server application should:

1.  Request an access token via the back channel using the /core/v1/oauth2/token endpoint with your client credentials
2.  Use that token in the Authorization header for subsequent API requests

### Access Tokens

-   Access tokens are RS256-signed JWTs. The expires\_in field of the token response gives the lifetime in seconds.
-   Each client has a max\_session\_duration. It defaults to 28800 seconds (8 hours), which is also the maximum.
-   Send session\_duration with the token request to get a shorter-lived token. The issued lifetime is the lower of the two values.
-   The client credentials grant issues no refresh token. Request a new token before the current one expires. Expired tokens are rejected with 401.
-   The resource parameter becomes the token's audience (for example [https://api.prod.neobits.ai/logic](https://api.prod.neobits.ai/logic)). A token is only accepted by the API it was issued for, and the resource must be registered for your client.
-   Test and production are separate environments with their own issuers and signing keys. Tokens from one are not accepted by the other.

### Scopes

Scopes are assigned to your client when it is created. A token carries only the scopes you request in the scope parameter (or the scopes of the requested role), so request every scope the endpoints you call need. Requesting a scope that is not assigned to your client fails with invalid\_scope, and calling an endpoint without its scope returns 403.

Core client management scopes:

-   List clients: clients:read
-   Get a client: client:read
-   Create a client: client:write
-   Delete a client: client:delete

See the [Fuse](https://docs.neobits.ai/api-reference/tag/fuse.md) and [Logic](https://docs.neobits.ai/api-reference/tag/logic.md) introductions for their scopes.

### Signing Keys

Neobits APIs validate the tokens they receive. If your own services also verify Neobits tokens, use the published keys:

1.  Read jwks\_uri and issuer from /core/.well-known/openid-configuration.
2.  Fetch the key set from /core/.well-known/jwks.json and cache it.
3.  Select the key whose kid matches the kid in the token header, and verify the RS256 signature.
4.  Check that iss equals the issuer, aud contains your resource, and exp is in the future.

If a token has a kid that is not in your cached key set, fetch the key set again before rejecting the token. Never hard-code a key.

The key set currently contains one key. If that key is replaced, tokens signed with the previous key stop being accepted and Neobits APIs respond with 401. Request a new token when that happens. You can also check a token with the /core/v1/oauth2/introspect endpoint instead of verifying it yourself.

## Endpoints

- [OpenID Connect Configuration](https://docs.neobits.ai/api-reference/operation/getOpenIdConfiguration/method/get.md): `GET /core/.well-known/openid-configuration`
- [JSON Web Key Set](https://docs.neobits.ai/api-reference/operation/getJwks/method/get.md): `GET /core/.well-known/jwks.json`
- [Get an OAuth 2.0 token](https://docs.neobits.ai/api-reference/operation/createToken/method/post.md): `POST /core/v1/oauth2/token`
- [Introspect an OAuth 2.0 token](https://docs.neobits.ai/api-reference/operation/introspectOauthToken/method/post.md): `POST /core/v1/oauth2/introspect`
- [Introspect a Basic token](https://docs.neobits.ai/api-reference/operation/introspectBasicToken/method/post.md): `POST /core/v1/basic/introspect`
- [List Clients](https://docs.neobits.ai/api-reference/operation/getClients/method/get.md): `GET /core/v1/clients`
- [Create Client](https://docs.neobits.ai/api-reference/operation/createClient/method/post.md): `POST /core/v1/clients`
- [Get Client](https://docs.neobits.ai/api-reference/operation/getClient/method/get.md): `GET /core/v1/clients/{client_id}`
- [Delete Client](https://docs.neobits.ai/api-reference/operation/deleteClient/method/delete.md): `DELETE /core/v1/clients/{client_id}`

---

# 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. Person data is always accessed within the context of an Inquiry, ensuring proper consent and audit trails.

  

## 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 complete the consent process. The Inquiry status will indicate when consent is pending.

3.  User Completes Consent — The end user authenticates and grants permission for their data to be accessed.

4.  Fetch Person Data — Once the Inquiry is completed, you can fetch the person data. 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

In order to consume this API, you must register Neobits as a provider in Altinn. Access must be provided for the Norwegian Population Registry and Samtykkebasert Lånesøknad.

Once your Altinn access is configured, you can authenticate using your API credentials and begin making requests to the Fuse endpoints documented below.

  

## Authentication and Scopes

Fuse endpoints use Basic authentication with your client's username and password. Each endpoint requires a scope, which must be assigned to your client directly or through its role. A missing scope returns `403`.

-   Create an inquiry: `inquiry:write`
-   Get an inquiry: `inquiry:read`
-   Complete an inquiry: `inquiry:update`
-   Get a person: `person:read`

  

## 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 /fuse/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 /fuse/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.
    
-   An inquiry can be completed once. Completing it again returns `409 Conflict`, and a completion is recorded for usage only once per inquiry.

## Endpoints

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

---

# Logic

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

Logic runs your decision models against JSON input. Use its API to evaluate a version, manage environments and deployments, and execute a deployed decision from your application.

## Core concepts

-   **Decision:** a model that transforms input facts into a result. Author it in the Logic app.
-   **Version:** a saved snapshot, shown as v1, v2, and so on. API requests use the numeric version. Version 0 is the editable working copy; use a saved version for reproducible runs.
-   **Environment:** a workspace resource such as Test or Production. These names are yours to choose and are separate from the Neobits test and production API hosts.
-   **Deployment:** connects a decision version to an environment. Creating one through REST also creates immediate 100% traffic routing.
-   **Evaluation:** runs the requested version without deployment routing and returns its result and available trace.
-   **Execution:** runs the version selected by an environment's deployment routing and records the outcome.

## Authentication and workspace access

Obtain an access token through [Core authentication](https://docs.neobits.ai/api-reference/operation/createToken/method/post.md). Configure your API client for Logic and grant the scopes needed for its operations. Send `Authorization: Bearer <access_token>` and `X-Workspace-Id` on every request. The token must be valid for the target API and tenant, and its principal must have access to the workspace. End-user tokens are authorized through workspace policies.

| Operation | Service-token scope |
| --- | --- |
| List environments / get environment | `environments:read` / `environment:read` |
| Create / update / delete environment | `environment:write` / `environment:update` / `environment:delete` |
| List deployments / get deployment | `deployments:read` / `deployment:read` |
| Create / update / delete deployment | `deployment:write` / `deployment:update` / `deployment:delete` |
| Execute / evaluate | `execution:write` / `evaluation:write` |

Tokens live for at most the client's `max_session_duration` (8 hours by default); see [access tokens](https://docs.neobits.ai/api-reference/tag/core-authz.md#access-tokens) for lifetime and scope rules.

The test API base URL is `https://api.test.neobits.ai`; production uses `https://api.prod.neobits.ai`. Logic paths start with `/logic`. JSON field names are camelCase.

A missing or malformed workspace header returns 400. Authentication failures return 401; insufficient access returns 403. Environment and deployment reads are limited to the active workspace.

## Evaluate, deploy, and execute

Start with a standalone decision and a saved version in the Logic app. Copy its decision ID from the decision details and use the numeric saved version from its version history. Use your active workspace ID for `WORKSPACE_ID`. The following example assumes a decision that accepts an `age` fact and returns an `eligible` result; use the input required by your own decision.

```bash
API_URL='https://api.test.neobits.ai'
ACCESS_TOKEN='<your-access-token>'
WORKSPACE_ID='<your-workspace-uuid>'
DECISION_ID='<your-decision-uuid>'
VERSION=1
```

### 1\. Create an environment

Only the name is required. Omitting the color selects a random supported theme color. Copy the returned `id` into `ENVIRONMENT_ID`.

```bash
curl --request POST "$API_URL/logic/v1/environments" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data '{"name":"Test","description":"Integration testing","color":"#2563eb"}'
```

Example 201 response:

```json
{
  "id": "019991b1-0000-7000-8000-000000000002",
  "workspaceId": "019991b1-0000-7000-8000-000000000001",
  "name": "Test",
  "description": "Integration testing",
  "color": "#2563eb",
  "createdAt": "2026-09-30T10:00:00.000Z",
  "updatedAt": "2026-09-30T10:00:00.000Z"
}
```

```bash
ENVIRONMENT_ID='<id-from-the-create-environment-response>'
```

### 2\. Evaluate the saved version

Evaluation requires no deployment. The REST endpoint has no environment parameter, so it does not resolve environment configuration variables. Evaluations run the decision's logic and can call external integrations; they are not side-effect-free dry runs.

```bash
curl --request POST "$API_URL/logic/v1/decisions/$DECISION_ID/evaluations" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data "{\"version\":$VERSION,\"fact\":{\"age\":25}}"
```

The 201 response includes `id`, `status`, `result`, `performance`, and `trace`. A successful result might be `{"eligible":true}`. Trace entries depend on the model's nodes; configuration secrets are redacted.

### 3\. Deploy the version

Creating a deployment immediately directs 100% of traffic for this decision/environment pair to the selected version. Supply the caller attribution in `deployedBy`; it is not inferred from the token. Copy the returned `id` into `DEPLOYMENT_ID`.

```bash
curl --request POST "$API_URL/logic/v1/deployments" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data "{\"decisionId\":\"$DECISION_ID\",\"version\":$VERSION,\"environmentId\":\"$ENVIRONMENT_ID\",\"name\":\"Eligibility v1\",\"message\":\"Initial deployment\",\"deployedBy\":\"Integration service\"}"
```

Both the environment and decision snapshot must exist in the active workspace. Deploy sub-decisions through their parent. A deployment version of `null` or `0` selects the working copy; the response normalizes `null` to `0`. The REST API does not accept rollout percentages or scheduling settings.

```bash
DEPLOYMENT_ID='<id-from-the-create-deployment-response>'
```

### 4\. Execute the deployed decision

Execution resolves configuration variables for the environment and follows its deployment routing.

```bash
curl --request POST "$API_URL/logic/v1/$ENVIRONMENT_ID/decisions/$DECISION_ID/executions" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data '{"fact":{"age":25}}'
```

Example 201 response:

```json
{
  "id": "019991b1-0000-7000-8000-000000000005",
  "decisionId": "019991b1-0000-7000-8000-000000000003",
  "status": "COMPLETED",
  "result": {"eligible": true},
  "performance": "1.2ms",
  "createdAt": "2026-09-30T10:00:00.000Z",
  "updatedAt": "2026-09-30T10:00:00.000Z"
}
```

## List and paginate resources

Environment and deployment lists accept `size` (default 50, maximum 5,000) and either `before` or `after`. Results are ordered by ascending ID. The cursors are exclusive; use `page.after` for the next page and `page.before` for the preceding page. Responses use `{ data, page }`, with `page.size` equal to the returned count and `page.total` equal to the workspace total.

```bash
curl "$API_URL/logic/v1/deployments?size=50" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID"

AFTER='<page.after-from-the-previous-response>'
curl "$API_URL/logic/v1/deployments?size=50&after=$AFTER" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID"
```

A non-null cursor does not guarantee another page exists. An empty page contains `data: []`, `size: 0`, and null cursors, while `total` still reports the workspace total. These lists do not accept decision/environment filters or custom sorting. Use `GET /logic/v1/environments/{id}` or `GET /logic/v1/deployments/{id}` to retrieve an individual resource.

## Update and delete resources

PATCH requests require at least one supported field. Omitted fields stay unchanged. Use `null` or an empty string to clear an environment description or a deployment message. Unknown fields are rejected.

```bash
curl --request PATCH "$API_URL/logic/v1/environments/$ENVIRONMENT_ID" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data '{"description":"Shared integration environment"}'

curl --request PATCH "$API_URL/logic/v1/deployments/$DEPLOYMENT_ID" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header 'Content-Type: application/json' \
  --data '{"message":"Verified by integration tests"}'
```

Deployment PATCH also accepts `decisionId`, `version`, `environmentId`, `name`, and `deployedBy`. It validates the resulting references, but updates only the deployment record; existing routing is not recreated or changed. Create a new deployment when you want to activate another version with immediate full-traffic routing.

Deleting an environment also deletes its deployments and routings. Deleting a deployment removes its routings and can change the version that receives future traffic. Both deletions return **409 Conflict** when linked execution history prevents removal. The deployment executed in this walkthrough therefore cannot be deleted through these calls while that history remains.

For a disposable resource without execution history:

```bash
curl --request DELETE "$API_URL/logic/v1/deployments/$DEPLOYMENT_ID" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID"

curl --request DELETE "$API_URL/logic/v1/environments/$ENVIRONMENT_ID" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID"
```

Successful deletion returns 204 with no body. Repeating the deletion for an absent resource in the active workspace also returns 204.

## Handle HTTP and decision failures

Check both the HTTP status and the result's `status`. A 201 response can contain `status: "FAILED"` and a `result.error` message when a node fails. An execution may include a diagnostic trace for that failure; successful executions normally omit it. Evaluations return their available trace in the `trace` field.

For example, a failed evaluation can return:

```json
{
  "id": "019991b1-0000-7000-8000-000000000006",
  "status": "FAILED",
  "result": {"error": "The external integration failed."},
  "performance": "4.2ms",
  "trace": null
}
```

A retried execution or evaluation runs the decision again, including any external integration calls, unless you send an `Idempotency-Key` header. Choose a unique key of up to 128 characters per request, for example a UUID, and send the same key on every retry:

```bash
curl --request POST "$API_URL/logic/$ENVIRONMENT_ID/decisions/$DECISION_ID/executions" \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --header "Idempotency-Key: $REQUEST_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"fact":{"amount":5}}'
```

-   A repeated key in the same workspace returns the stored 201 response, including a `FAILED` result, without running the decision again.
-   Reusing a key for a different decision, environment, version, or `fact` returns **409 Conflict**.
-   A non-2xx response does not store the key, so a retry with the same key runs the decision.
-   If a retry arrives while the first request is still running, both can run the decision. Only the first stored result is kept, and both return it.

A hard engine failure can instead produce a non-2xx response. Do not assume every failed evaluation was persisted. Missing deployments, routing, or decision versions can return 404. For HTTP errors, use the shared [error response format](https://docs.neobits.ai/api-reference/errors.md) and the status codes listed on each operation.

## Endpoints

- [List environments](https://docs.neobits.ai/api-reference/operation/logic-environments-list/method/get.md): `GET /logic/v1/environments`
- [Create an environment](https://docs.neobits.ai/api-reference/operation/logic-environments-create/method/post.md): `POST /logic/v1/environments`
- [Get an environment](https://docs.neobits.ai/api-reference/operation/logic-environments-get/method/get.md): `GET /logic/v1/environments/{id}`
- [Update an environment](https://docs.neobits.ai/api-reference/operation/logic-environments-update/method/patch.md): `PATCH /logic/v1/environments/{id}`
- [Delete an environment](https://docs.neobits.ai/api-reference/operation/logic-environments-delete/method/delete.md): `DELETE /logic/v1/environments/{id}`
- [List deployments](https://docs.neobits.ai/api-reference/operation/logic-deployments-list/method/get.md): `GET /logic/v1/deployments`
- [Create a deployment](https://docs.neobits.ai/api-reference/operation/logic-deployments-create/method/post.md): `POST /logic/v1/deployments`
- [Get a deployment](https://docs.neobits.ai/api-reference/operation/logic-deployments-get/method/get.md): `GET /logic/v1/deployments/{id}`
- [Update a deployment](https://docs.neobits.ai/api-reference/operation/logic-deployments-update/method/patch.md): `PATCH /logic/v1/deployments/{id}`
- [Delete a deployment](https://docs.neobits.ai/api-reference/operation/logic-deployments-delete/method/delete.md): `DELETE /logic/v1/deployments/{id}`
- [Execute a decision](https://docs.neobits.ai/api-reference/operation/logic-executions-create/method/post.md): `POST /logic/v1/{environmentId}/decisions/{decisionId}/executions`
- [Evaluate a decision](https://docs.neobits.ai/api-reference/operation/logic-evaluations-create/method/post.md): `POST /logic/v1/decisions/{decisionId}/evaluations`

---

# Fuse testing

Test users for the Fuse API. Each one returns a different combination of property, debt, income and family data.

#### Altinn Authentication

When consenting in Altinn for any test user, use the following credentials:

| Login method | SSN | Password | Pin |
| --- | --- | --- | --- |
| MinID | 01029413157 | password01 | 12345 |

## Test cases

| SSN | Status | Name | Properties | Mortgage | Auto loan | Student loan | Income | Family members |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 01029413157 | 200 | STOR HØK | 3 | yes | yes | yes | yes | 3 |
| 01087304465 | 200 | HØY HØK | 1 | yes | yes | yes | yes | 2 |
| 03028711300 | 200 | HARD HØK | 1 | yes | yes | yes | yes | 2 |
| 03822649318 | 200 | NY HØK | 1 | yes | yes | no | yes | 4 |
| 04107302218 | 422 |  | 0 | no | no | no | no | 0 |
| 04857099538 | 200 | GAMMEL HØK | 1 | yes | no | no | yes | 4 |
| 04903748570 | 200 | UNG HØK | 1 | yes | no | no | yes | 4 |
| 04915493500 | 200 | LITE HØK | 1 | yes | no | no | yes | 4 |
| 06073910828 | 200 | GAMMEL HØK | 1 | yes | yes | no | yes | 0 |
| 07098626225 | 200 | VELDIG HØK | 1 | yes | yes | no | yes | 0 |
| 08892549312 | 404 |  | 0 | no | no | no | no | 0 |
| 09840747538 | 200 | MYE HØK | 1 | yes | no | no | yes | 4 |
| 10103022989 | 200 | GRØNN HØK | 1 | yes | yes | no | yes | 1 |
| 10105000060 | 200 | MØRK HØK | 1 | yes | yes | no | yes | 3 |
| 10105014045 | 502 |  | 0 | no | no | no | no | 0 |
| 10106011430 | 200 | KLAR HØK | 1 | yes | yes | no | yes | 0 |
| 10864597128 | 200 | GROV HØK | 1 | yes | no | no | yes | 4 |
| 11116005176 | 200 | GUL HØK | 2 | yes | yes | yes | yes | 2 |
| 11865596482 | 200 | FIN HØK | 1 | yes | no | no | yes | 4 |
| 12836299211 | 200 | TYKK HØK | 1 | yes | no | no | yes | 4 |
| 13066821298 | 200 | LYS HØK | 1 | yes | yes | no | yes | 1 |
| 14098226649 | 404 |  | 0 | no | no | no | no | 0 |
| 14919899833 | 200 | TYNN HØK | 1 | yes | yes | no | yes | 4 |
| 21067028764 | 200 | VELDIG HØK | 1 | yes | yes | no | yes | 0 |
| 21876698312 | 200 | BREI HØK | 1 | yes | yes | no | yes | 4 |
| 22914799965 | 200 | SMAL HØK | 1 | yes | yes | no | yes | 4 |
| 23826898534 | 200 | BRUN HØK | 1 | yes | yes | no | yes | 4 |
| 24125328160 | 200 | STERK HØK | 0 | no | yes | no | yes | 1 |
| 26037821062 | 200 | NY HØK | 1 | yes | yes | no | yes | 1 |
| 26811599009 | 200 | LANG HØK | 1 | yes | no | no | yes | 4 |
| 26918598684 | 200 | HVID HØK | 1 | yes | no | no | yes | 4 |
| 29034620421 | 200 | RASK HØK | 1 | no | yes | no | yes | 0 |
| 30075423140 | 200 | VARM HØK | 1 | yes | yes | no | yes | 3 |
| 30812648116 | 200 | RØD HØK | 1 | yes | yes | no | no | 4 |
| 31056549873 | 200 | KALD HØK | 1 | no | yes | no | yes | 0 |

---

# List environments

`GET /logic/v1/environments`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments`
- `https://api.prod.neobits.ai/logic/v1/environments`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Returns resources in the active workspace in ascending ID order. Use `size` and either `before` or `after` for pagination. `page.size` is the returned count; `page.total` is the workspace total. Cursors are exclusive and are null for an empty page. There are no additional filters or sort parameters.

Required service-token scope: `environments:read`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `size` | query | no | integer; minimum 1; maximum 5000; default `50`; example `50` | Maximum resources to return (1–5,000). Defaults to 50. |
| `before` | query | no | string (uuid) | Exclusive resource ID cursor. Use page.before from a previous response. Cannot be combined with after. |
| `after` | query | no | string (uuid) | Exclusive resource ID cursor. Use page.after from a previous response. Cannot be combined with before. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "size",
    "in": "query",
    "required": false,
    "description": "Maximum resources to return (1–5,000). Defaults to 50.",
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "default": 50
    },
    "example": 50
  },
  {
    "name": "before",
    "in": "query",
    "required": false,
    "description": "Exclusive resource ID cursor. Use page.before from a previous response. Cannot be combined with after.",
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  },
  {
    "name": "after",
    "in": "query",
    "required": false,
    "description": "Exclusive resource ID cursor. Use page.after from a previous response. Cannot be combined with before.",
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
]
```

## Responses

### 200 Environment page.

Content type: `application/json`

```json
{
  "title": "LogicEnvironmentPage",
  "type": "object",
  "required": [
    "data",
    "page"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "title": "LogicEnvironment",
        "type": "object",
        "required": [
          "id",
          "workspaceId",
          "name",
          "description",
          "color",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Environment identifier.",
            "example": "019991b1-0000-7000-8000-000000000002"
          },
          "workspaceId": {
            "type": "string",
            "format": "uuid",
            "description": "Workspace containing this resource.",
            "example": "019991b1-0000-7000-8000-000000000001"
          },
          "name": {
            "type": "string",
            "description": "Nonempty name without leading or trailing whitespace.",
            "example": "Test",
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description. Use null or an empty string to clear it.",
            "example": "Integration testing"
          },
          "color": {
            "type": "string",
            "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
            "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
            "example": "#2563eb"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time.",
            "example": "2026-09-30T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Last update time.",
            "example": "2026-09-30T10:00:00.000Z"
          }
        },
        "example": {
          "id": "019991b1-0000-7000-8000-000000000002",
          "workspaceId": "019991b1-0000-7000-8000-000000000001",
          "name": "Test",
          "description": "Integration testing",
          "color": "#2563eb",
          "createdAt": "2026-09-30T10:00:00.000Z",
          "updatedAt": "2026-09-30T10:00:00.000Z"
        }
      }
    },
    "page": {
      "title": "LogicPage",
      "type": "object",
      "required": [
        "size",
        "total",
        "before",
        "after"
      ],
      "properties": {
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of resources returned in this response.",
          "example": 1
        },
        "total": {
          "type": "integer",
          "minimum": 0,
          "description": "Total resources in the active workspace, independent of the cursor.",
          "example": 1
        },
        "before": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "First returned ID. Use as before to request the preceding page. Null for an empty page.",
          "example": "019991b1-0000-7000-8000-000000000002"
        },
        "after": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Last returned ID. Use as after to request the following page. Null for an empty page. A non-null cursor does not guarantee another page exists.",
          "example": "019991b1-0000-7000-8000-000000000002"
        }
      }
    }
  },
  "example": {
    "data": [
      {
        "id": "019991b1-0000-7000-8000-000000000002",
        "workspaceId": "019991b1-0000-7000-8000-000000000001",
        "name": "Test",
        "description": "Integration testing",
        "color": "#2563eb",
        "createdAt": "2026-09-30T10:00:00.000Z",
        "updatedAt": "2026-09-30T10:00:00.000Z"
      }
    ],
    "page": {
      "size": 1,
      "total": 1,
      "before": "019991b1-0000-7000-8000-000000000002",
      "after": "019991b1-0000-7000-8000-000000000002"
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Create an environment

`POST /logic/v1/environments`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments`
- `https://api.prod.neobits.ai/logic/v1/environments`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Creates an environment in the active workspace. Only `name` is required. Omitting `color` selects a random supported theme color. Unknown fields are rejected.

Required service-token scope: `environment:write`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "CreateLogicEnvironment",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    }
  },
  "example": {
    "name": "Test",
    "description": "Integration testing",
    "color": "#2563eb"
  }
}
```

## Responses

### 201 Environment created.

Content type: `application/json`

```json
{
  "title": "LogicEnvironment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "description",
    "color",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Environment identifier.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000002",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "name": "Test",
    "description": "Integration testing",
    "color": "#2563eb",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Get an environment

`GET /logic/v1/environments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments/{id}`
- `https://api.prod.neobits.ai/logic/v1/environments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Retrieves one environment in the active workspace. Returns 404 when it is not found in that workspace.

Required service-token scope: `environment:read`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000002` | Environment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Environment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000002"
  }
]
```

## Responses

### 200 Environment details.

Content type: `application/json`

```json
{
  "title": "LogicEnvironment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "description",
    "color",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Environment identifier.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000002",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "name": "Test",
    "description": "Integration testing",
    "color": "#2563eb",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Update an environment

`PATCH /logic/v1/environments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments/{id}`
- `https://api.prod.neobits.ai/logic/v1/environments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Partially updates an environment in the active workspace. Supply at least one of `name`, `description`, or `color`; omitted fields remain unchanged. Clear the description with null or an empty string. Unknown fields are rejected.

Required service-token scope: `environment:update`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000002` | Environment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Environment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000002"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "UpdateLogicEnvironment",
  "type": "object",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    }
  },
  "example": {
    "description": "Shared integration environment"
  }
}
```

## Responses

### 200 Environment updated.

Content type: `application/json`

```json
{
  "title": "LogicEnvironment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "description",
    "color",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Environment identifier.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000002",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "name": "Test",
    "description": "Integration testing",
    "color": "#2563eb",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Delete an environment

`DELETE /logic/v1/environments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments/{id}`
- `https://api.prod.neobits.ai/logic/v1/environments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Deletes the environment and cascades to its deployments and routings. Returns 409 if linked execution history prevents deletion; nothing is deleted in that case. Deletion is idempotent: an absent ID in the active workspace also returns 204 with no response body.

Required service-token scope: `environment:delete`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000002` | Environment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Environment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000002"
  }
]
```

## Responses

### 204 Deleted or already absent. No response body.

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 409 Conflict

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ConflictResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Conflict"
            ],
            "example": "Conflict"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "409-000",
              "409-001",
              "409-002"
            ],
            "example": "409-000"
          },
          "message": {
            "type": "string",
            "example": "A resource with this identifier already exists"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# List deployments

`GET /logic/v1/deployments`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/deployments`
- `https://api.prod.neobits.ai/logic/v1/deployments`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Returns resources in the active workspace in ascending ID order. Use `size` and either `before` or `after` for pagination. `page.size` is the returned count; `page.total` is the workspace total. Cursors are exclusive and are null for an empty page. There are no additional filters or sort parameters.

Required service-token scope: `deployments:read`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `size` | query | no | integer; minimum 1; maximum 5000; default `50`; example `50` | Maximum resources to return (1–5,000). Defaults to 50. |
| `before` | query | no | string (uuid) | Exclusive resource ID cursor. Use page.before from a previous response. Cannot be combined with after. |
| `after` | query | no | string (uuid) | Exclusive resource ID cursor. Use page.after from a previous response. Cannot be combined with before. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "size",
    "in": "query",
    "required": false,
    "description": "Maximum resources to return (1–5,000). Defaults to 50.",
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "default": 50
    },
    "example": 50
  },
  {
    "name": "before",
    "in": "query",
    "required": false,
    "description": "Exclusive resource ID cursor. Use page.before from a previous response. Cannot be combined with after.",
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  },
  {
    "name": "after",
    "in": "query",
    "required": false,
    "description": "Exclusive resource ID cursor. Use page.after from a previous response. Cannot be combined with before.",
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
]
```

## Responses

### 200 Deployment page.

Content type: `application/json`

```json
{
  "title": "LogicDeploymentPage",
  "type": "object",
  "required": [
    "data",
    "page"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "title": "LogicDeployment",
        "type": "object",
        "required": [
          "id",
          "workspaceId",
          "decisionId",
          "version",
          "environmentId",
          "name",
          "message",
          "deployedBy",
          "milestone",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Deployment identifier.",
            "example": "019991b1-0000-7000-8000-000000000004"
          },
          "workspaceId": {
            "type": "string",
            "format": "uuid",
            "description": "Workspace containing this resource.",
            "example": "019991b1-0000-7000-8000-000000000001"
          },
          "decisionId": {
            "type": "string",
            "format": "uuid",
            "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
            "example": "019991b1-0000-7000-8000-000000000003"
          },
          "version": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 2147483647,
            "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
            "example": 1
          },
          "environmentId": {
            "type": "string",
            "format": "uuid",
            "description": "Environment in the active workspace.",
            "example": "019991b1-0000-7000-8000-000000000002"
          },
          "name": {
            "type": "string",
            "description": "Nonempty deployment name without leading or trailing whitespace.",
            "example": "Eligibility v1",
            "minLength": 1
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release notes. Use null or an empty string to clear them.",
            "example": "Initial deployment"
          },
          "deployedBy": {
            "type": "string",
            "description": "Caller-supplied attribution; required and not inferred from the access token.",
            "example": "Integration service",
            "minLength": 1
          },
          "milestone": {
            "type": "integer",
            "const": 0,
            "description": "Snapshot milestone; always 0 for a deployment.",
            "example": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time.",
            "example": "2026-09-30T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Last update time.",
            "example": "2026-09-30T10:00:00.000Z"
          }
        },
        "example": {
          "id": "019991b1-0000-7000-8000-000000000004",
          "workspaceId": "019991b1-0000-7000-8000-000000000001",
          "decisionId": "019991b1-0000-7000-8000-000000000003",
          "version": 1,
          "milestone": 0,
          "environmentId": "019991b1-0000-7000-8000-000000000002",
          "name": "Eligibility v1",
          "message": "Initial deployment",
          "deployedBy": "Integration service",
          "createdAt": "2026-09-30T10:00:00.000Z",
          "updatedAt": "2026-09-30T10:00:00.000Z"
        }
      }
    },
    "page": {
      "title": "LogicPage",
      "type": "object",
      "required": [
        "size",
        "total",
        "before",
        "after"
      ],
      "properties": {
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of resources returned in this response.",
          "example": 1
        },
        "total": {
          "type": "integer",
          "minimum": 0,
          "description": "Total resources in the active workspace, independent of the cursor.",
          "example": 1
        },
        "before": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "First returned ID. Use as before to request the preceding page. Null for an empty page.",
          "example": "019991b1-0000-7000-8000-000000000002"
        },
        "after": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Last returned ID. Use as after to request the following page. Null for an empty page. A non-null cursor does not guarantee another page exists.",
          "example": "019991b1-0000-7000-8000-000000000002"
        }
      }
    }
  },
  "example": {
    "data": [
      {
        "id": "019991b1-0000-7000-8000-000000000004",
        "workspaceId": "019991b1-0000-7000-8000-000000000001",
        "decisionId": "019991b1-0000-7000-8000-000000000003",
        "version": 1,
        "milestone": 0,
        "environmentId": "019991b1-0000-7000-8000-000000000002",
        "name": "Eligibility v1",
        "message": "Initial deployment",
        "deployedBy": "Integration service",
        "createdAt": "2026-09-30T10:00:00.000Z",
        "updatedAt": "2026-09-30T10:00:00.000Z"
      }
    ],
    "page": {
      "size": 1,
      "total": 1,
      "before": "019991b1-0000-7000-8000-000000000004",
      "after": "019991b1-0000-7000-8000-000000000004"
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Create a deployment

`POST /logic/v1/deployments`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/deployments`
- `https://api.prod.neobits.ai/logic/v1/deployments`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Creates a deployment and its routing atomically. It immediately routes 100% of traffic to this version for the decision/environment pair. The environment and decision snapshot must exist in the active workspace; sub-decisions cannot be deployed directly. Supply `deployedBy` explicitly. `version: null` is normalized to 0 (the working copy). Routing percentage and scheduling fields are not accepted.

Required service-token scope: `deployment:write`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "CreateLogicDeployment",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "decisionId",
    "version",
    "environmentId",
    "name",
    "deployedBy"
  ],
  "properties": {
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "version": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
      "example": 1
    },
    "environmentId": {
      "type": "string",
      "format": "uuid",
      "description": "Environment in the active workspace.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "name": {
      "type": "string",
      "description": "Nonempty deployment name without leading or trailing whitespace.",
      "example": "Eligibility v1",
      "minLength": 1
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Release notes. Use null or an empty string to clear them.",
      "example": "Initial deployment"
    },
    "deployedBy": {
      "type": "string",
      "description": "Caller-supplied attribution; required and not inferred from the access token.",
      "example": "Integration service",
      "minLength": 1
    }
  },
  "example": {
    "decisionId": "019991b1-0000-7000-8000-000000000003",
    "version": 1,
    "environmentId": "019991b1-0000-7000-8000-000000000002",
    "name": "Eligibility v1",
    "message": "Initial deployment",
    "deployedBy": "Integration service"
  }
}
```

## Responses

### 201 Deployment created.

Content type: `application/json`

```json
{
  "title": "LogicDeployment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "decisionId",
    "version",
    "environmentId",
    "name",
    "message",
    "deployedBy",
    "milestone",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Deployment identifier.",
      "example": "019991b1-0000-7000-8000-000000000004"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "version": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
      "example": 1
    },
    "environmentId": {
      "type": "string",
      "format": "uuid",
      "description": "Environment in the active workspace.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "name": {
      "type": "string",
      "description": "Nonempty deployment name without leading or trailing whitespace.",
      "example": "Eligibility v1",
      "minLength": 1
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Release notes. Use null or an empty string to clear them.",
      "example": "Initial deployment"
    },
    "deployedBy": {
      "type": "string",
      "description": "Caller-supplied attribution; required and not inferred from the access token.",
      "example": "Integration service",
      "minLength": 1
    },
    "milestone": {
      "type": "integer",
      "const": 0,
      "description": "Snapshot milestone; always 0 for a deployment.",
      "example": 0
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000004",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "decisionId": "019991b1-0000-7000-8000-000000000003",
    "version": 1,
    "milestone": 0,
    "environmentId": "019991b1-0000-7000-8000-000000000002",
    "name": "Eligibility v1",
    "message": "Initial deployment",
    "deployedBy": "Integration service",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Get a deployment

`GET /logic/v1/deployments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/deployments/{id}`
- `https://api.prod.neobits.ai/logic/v1/deployments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Retrieves one deployment in the active workspace. Returns 404 when it is not found in that workspace.

Required service-token scope: `deployment:read`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000004` | Deployment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Deployment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000004"
  }
]
```

## Responses

### 200 Deployment details.

Content type: `application/json`

```json
{
  "title": "LogicDeployment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "decisionId",
    "version",
    "environmentId",
    "name",
    "message",
    "deployedBy",
    "milestone",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Deployment identifier.",
      "example": "019991b1-0000-7000-8000-000000000004"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "version": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
      "example": 1
    },
    "environmentId": {
      "type": "string",
      "format": "uuid",
      "description": "Environment in the active workspace.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "name": {
      "type": "string",
      "description": "Nonempty deployment name without leading or trailing whitespace.",
      "example": "Eligibility v1",
      "minLength": 1
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Release notes. Use null or an empty string to clear them.",
      "example": "Initial deployment"
    },
    "deployedBy": {
      "type": "string",
      "description": "Caller-supplied attribution; required and not inferred from the access token.",
      "example": "Integration service",
      "minLength": 1
    },
    "milestone": {
      "type": "integer",
      "const": 0,
      "description": "Snapshot milestone; always 0 for a deployment.",
      "example": 0
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000004",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "decisionId": "019991b1-0000-7000-8000-000000000003",
    "version": 1,
    "milestone": 0,
    "environmentId": "019991b1-0000-7000-8000-000000000002",
    "name": "Eligibility v1",
    "message": "Initial deployment",
    "deployedBy": "Integration service",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Update a deployment

`PATCH /logic/v1/deployments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/deployments/{id}`
- `https://api.prod.neobits.ai/logic/v1/deployments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Partially updates a deployment in the active workspace. Supply at least one of `decisionId`, `version`, `environmentId`, `name`, `message`, or `deployedBy`. Omitted fields remain unchanged; null clears `message` or selects the working copy for `version`. Resulting environment and decision references are validated. This updates the deployment record only; it does not recreate or change its routing. Create a new deployment to activate another version with immediate full-traffic routing.

Required service-token scope: `deployment:update`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000004` | Deployment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Deployment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000004"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "UpdateLogicDeployment",
  "type": "object",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "version": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
      "example": 1
    },
    "environmentId": {
      "type": "string",
      "format": "uuid",
      "description": "Environment in the active workspace.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "name": {
      "type": "string",
      "description": "Nonempty deployment name without leading or trailing whitespace.",
      "example": "Eligibility v1",
      "minLength": 1
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Release notes. Use null or an empty string to clear them.",
      "example": "Initial deployment"
    },
    "deployedBy": {
      "type": "string",
      "description": "Caller-supplied attribution; required and not inferred from the access token.",
      "example": "Integration service",
      "minLength": 1
    }
  },
  "example": {
    "message": "Verified by integration tests"
  }
}
```

## Responses

### 200 Deployment updated.

Content type: `application/json`

```json
{
  "title": "LogicDeployment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "decisionId",
    "version",
    "environmentId",
    "name",
    "message",
    "deployedBy",
    "milestone",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Deployment identifier.",
      "example": "019991b1-0000-7000-8000-000000000004"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Standalone decision to deploy. Sub-decisions are deployed with their parent.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "version": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Saved version number, or 0/null for the working copy. Null is normalized to 0 in the response. Use a saved version for a reproducible deployment.",
      "example": 1
    },
    "environmentId": {
      "type": "string",
      "format": "uuid",
      "description": "Environment in the active workspace.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "name": {
      "type": "string",
      "description": "Nonempty deployment name without leading or trailing whitespace.",
      "example": "Eligibility v1",
      "minLength": 1
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Release notes. Use null or an empty string to clear them.",
      "example": "Initial deployment"
    },
    "deployedBy": {
      "type": "string",
      "description": "Caller-supplied attribution; required and not inferred from the access token.",
      "example": "Integration service",
      "minLength": 1
    },
    "milestone": {
      "type": "integer",
      "const": 0,
      "description": "Snapshot milestone; always 0 for a deployment.",
      "example": 0
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000004",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "decisionId": "019991b1-0000-7000-8000-000000000003",
    "version": 1,
    "milestone": 0,
    "environmentId": "019991b1-0000-7000-8000-000000000002",
    "name": "Eligibility v1",
    "message": "Initial deployment",
    "deployedBy": "Integration service",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Delete a deployment

`DELETE /logic/v1/deployments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/deployments/{id}`
- `https://api.prod.neobits.ai/logic/v1/deployments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Deletes the deployment and its routings. Returns 409 if linked execution history prevents deletion. Removing a deployment can change which remaining deployment handles future executions, or leave the decision without a deployment in that environment. Deletion is idempotent: an absent ID in the active workspace also returns 204 with no response body.

Required service-token scope: `deployment:delete`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000004` | Deployment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Deployment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000004"
  }
]
```

## Responses

### 204 Deleted or already absent. No response body.

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 409 Conflict

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ConflictResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Conflict"
            ],
            "example": "Conflict"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "409-000",
              "409-001",
              "409-002"
            ],
            "example": "409-000"
          },
          "message": {
            "type": "string",
            "example": "A resource with this identifier already exists"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Execute a decision

`POST /logic/v1/{environmentId}/decisions/{decisionId}/executions`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/{environmentId}/decisions/{decisionId}/executions`
- `https://api.prod.neobits.ai/logic/v1/{environmentId}/decisions/{decisionId}/executions`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Runs the decision using the deployment routing configured for the selected environment. Environment configuration variables are resolved for the run. A deployment and routing must exist; sub-decisions cannot be executed directly. The call is synchronous and persists an execution. Check `status` even on HTTP 201: a node failure can return `FAILED` with `result.error` and a trace. Hard engine failures can instead return a non-2xx error. Successful runs normally omit `trace`. Send an `Idempotency-Key` header to retry safely: a repeated key returns the stored execution without running the decision again.

Required service-token scope: `execution:write`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `Idempotency-Key` | header | no | string; example `7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21` | Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key. |
| `environmentId` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000002` | Environment containing the deployment. |
| `decisionId` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000003` | Standalone decision to execute. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "example": "7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21"
  },
  {
    "name": "environmentId",
    "in": "path",
    "required": true,
    "description": "Environment containing the deployment.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000002"
  },
  {
    "name": "decisionId",
    "in": "path",
    "required": true,
    "description": "Standalone decision to execute.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000003"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "CreateLogicExecution",
  "type": "object",
  "required": [
    "fact"
  ],
  "properties": {
    "fact": {
      "type": "object",
      "additionalProperties": true,
      "description": "Input facts expected by your decision. The example assumes a decision accepting age and returning eligible; replace it with your own input.",
      "example": {
        "age": 25
      }
    }
  },
  "example": {
    "fact": {
      "age": 25
    }
  }
}
```

## Responses

### 201 Execution recorded; inspect status for COMPLETED or FAILED.

Content type: `application/json`

```json
{
  "title": "LogicExecution",
  "type": "object",
  "required": [
    "id",
    "decisionId",
    "status",
    "result",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Persisted execution identifier.",
      "example": "019991b1-0000-7000-8000-000000000005"
    },
    "decisionId": {
      "type": "string",
      "format": "uuid",
      "description": "Executed decision.",
      "example": "019991b1-0000-7000-8000-000000000003"
    },
    "status": {
      "type": "string",
      "enum": [
        "COMPLETED",
        "FAILED"
      ],
      "description": "Check this field even when the HTTP status is 201.",
      "example": "COMPLETED"
    },
    "result": {
      "description": "Decision-specific output. When status is FAILED, contains an error property describing the failure.",
      "example": {
        "eligible": true
      },
      "type": "object",
      "additionalProperties": true
    },
    "performance": {
      "type": "string",
      "description": "Engine-reported duration.",
      "example": "1.2ms"
    },
    "trace": {
      "type": "object",
      "additionalProperties": true,
      "description": "Diagnostic trace for a failed execution, when available. Omitted for successful executions.",
      "example": {}
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000005",
    "decisionId": "019991b1-0000-7000-8000-000000000003",
    "status": "COMPLETED",
    "result": {
      "eligible": true
    },
    "performance": "1.2ms",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 409 Conflict

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ConflictResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Conflict"
            ],
            "example": "Conflict"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "409-000",
              "409-001",
              "409-002"
            ],
            "example": "409-000"
          },
          "message": {
            "type": "string",
            "example": "A resource with this identifier already exists"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Evaluate a decision

`POST /logic/v1/decisions/{decisionId}/evaluations`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/decisions/{decisionId}/evaluations`
- `https://api.prod.neobits.ai/logic/v1/decisions/{decisionId}/evaluations`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Evaluates the supplied decision version synchronously without deployment routing. Versions 1 and above select saved versions; 0 selects the working copy. The REST request has no environment parameter and does not resolve environment configuration variables. Evaluation runs the decision logic and can call external integrations; it is not a side-effect-free dry run. Check `status` even on HTTP 201: node failures can return `FAILED` with `result.error`. Hard engine failures can instead return a non-2xx error. The response includes the available redacted per-node trace. Send an `Idempotency-Key` header to retry safely: a repeated key returns the stored evaluation without running the decision again.

Required service-token scope: `evaluation:write`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `Idempotency-Key` | header | no | string; example `7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21` | Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key. |
| `decisionId` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000003` | Decision whose version will be evaluated. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "example": "7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21"
  },
  {
    "name": "decisionId",
    "in": "path",
    "required": true,
    "description": "Decision whose version will be evaluated.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000003"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "CreateLogicEvaluation",
  "type": "object",
  "required": [
    "version",
    "fact"
  ],
  "properties": {
    "version": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "description": "Decision version: 1 and above select saved versions; 0 selects the editable working copy.",
      "example": 1
    },
    "fact": {
      "type": "object",
      "additionalProperties": true,
      "description": "Input facts expected by your decision. The example assumes a decision accepting age and returning eligible; replace it with your own input.",
      "example": {
        "age": 25
      }
    }
  },
  "example": {
    "version": 1,
    "fact": {
      "age": 25
    }
  }
}
```

## Responses

### 201 Evaluation recorded; inspect status for COMPLETED or FAILED.

Content type: `application/json`

```json
{
  "title": "LogicEvaluation",
  "type": "object",
  "required": [
    "id",
    "status",
    "result",
    "performance",
    "trace"
  ],
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Persisted evaluation identifier; nullable in the shared evaluation contract.",
      "example": "019991b1-0000-7000-8000-000000000006"
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "COMPLETED",
        "FAILED"
      ],
      "description": "The synchronous REST call returns COMPLETED or FAILED. PENDING is part of the shared evaluation model.",
      "example": "COMPLETED"
    },
    "result": {
      "description": "Decision-specific output. When status is FAILED, contains an error property describing the failure.",
      "example": {
        "eligible": true
      }
    },
    "performance": {
      "type": [
        "string",
        "null"
      ],
      "description": "Engine-reported duration, or null when unavailable.",
      "example": "1.2ms"
    },
    "trace": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Engine trace keyed by node ID. Contains per-node diagnostic data; sensitive configuration values are redacted. Null when unavailable.",
      "example": null
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000006",
    "status": "COMPLETED",
    "result": {
      "eligible": true
    },
    "performance": "1.2ms",
    "trace": {}
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 409 Conflict

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ConflictResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Conflict"
            ],
            "example": "Conflict"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "409-000",
              "409-001",
              "409-002"
            ],
            "example": "409-000"
          },
          "message": {
            "type": "string",
            "example": "A resource with this identifier already exists"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# OpenID Connect Configuration

`GET /core/.well-known/openid-configuration`

Endpoints:

- `https://api.test.neobits.ai/core/.well-known/openid-configuration`
- `https://api.prod.neobits.ai/core/.well-known/openid-configuration`

Authentication: none.

Retrieves the OpenID Connect configuration metadata

## Responses

### 200 OpenID Connect configuration

Response headers and links:

```json
{
  "headers": {
    "Cache-Control": {
      "description": "The document may be cached for one hour.",
      "schema": {
        "type": "string",
        "example": "public, max-age=3600"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "title": "OpenIdConfiguration",
  "properties": {
    "issuer": {
      "type": "string",
      "description": "The issuer identifier. Matches the `iss` claim of tokens issued by this host.",
      "example": "https://api.prod.neobits.ai/core"
    },
    "jwks_uri": {
      "type": "string",
      "description": "URL of the JSON Web Key Set",
      "example": "https://api.prod.neobits.ai/core/.well-known/jwks.json"
    },
    "token_endpoint": {
      "type": "string",
      "description": "URL of the OAuth 2.0 token endpoint",
      "example": "https://api.prod.neobits.ai/core/v1/oauth2/token"
    },
    "token_endpoint_auth_methods_supported": {
      "type": "array",
      "description": "Authentication methods supported by the token endpoint",
      "items": {
        "type": "string"
      },
      "example": [
        "client_secret_basic"
      ]
    },
    "introspection_endpoint": {
      "type": "string",
      "description": "URL of the OAuth 2.0 token introspection endpoint",
      "example": "https://api.prod.neobits.ai/core/v1/oauth2/introspect"
    },
    "introspection_endpoint_auth_methods_supported": {
      "type": "array",
      "description": "Authentication methods supported by the introspection endpoint",
      "items": {
        "type": "string"
      },
      "example": [
        "client_secret_basic"
      ]
    },
    "response_types_supported": {
      "type": "array",
      "description": "Response types supported. Empty, because this host has no authorization endpoint.",
      "items": {
        "type": "string"
      },
      "example": []
    },
    "grant_types_supported": {
      "type": "array",
      "description": "Grant types supported by the Core (Authz) server",
      "items": {
        "type": "string"
      },
      "example": [
        "client_credentials"
      ]
    },
    "scopes_supported": {
      "type": "array",
      "description": "Scopes supported by the Core (Authz) server",
      "items": {
        "type": "string"
      },
      "example": [
        "client:read",
        "client:write",
        "client:update",
        "client:delete",
        "clients:read",
        "inquiry:read",
        "inquiry:write",
        "inquiry:update",
        "inquiry:delete",
        "inquiries:read",
        "person:read"
      ]
    }
  }
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# JSON Web Key Set

`GET /core/.well-known/jwks.json`

Endpoints:

- `https://api.test.neobits.ai/core/.well-known/jwks.json`
- `https://api.prod.neobits.ai/core/.well-known/jwks.json`

Authentication: none.

Retrieves the JSON Web Key Set containing the public keys used to verify access tokens. Select the key whose `kid` matches the `kid` in the token header.

## Responses

### 200 JSON Web Key Set

Content type: `application/json`

```json
{
  "type": "object",
  "title": "JwksResponse",
  "properties": {
    "keys": {
      "type": "array",
      "description": "Array of JWK objects",
      "items": {
        "type": "object",
        "title": "JsonWebKey",
        "properties": {
          "kty": {
            "type": "string",
            "description": "Key type",
            "example": "RSA"
          },
          "kid": {
            "type": "string",
            "description": "Key ID. Tokens carry the same value in the `kid` header.",
            "example": "uayMam8yjZZR8G1B_6ilQW9IswtefxWWAizvh-WhbGg"
          },
          "n": {
            "type": "string",
            "description": "RSA modulus"
          },
          "e": {
            "type": "string",
            "description": "RSA exponent",
            "example": "AQAB"
          }
        }
      }
    }
  }
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Get an OAuth 2.0 token

`POST /core/v1/oauth2/token`

Endpoints:

- `https://api.test.neobits.ai/core/v1/oauth2/token`
- `https://api.prod.neobits.ai/core/v1/oauth2/token`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

Issues access tokens using the client credentials grant type

## Request body

Required: yes

Content type: `application/x-www-form-urlencoded`

```json
{
  "type": "object",
  "title": "TokenRequest",
  "required": [
    "grant_type",
    "resource"
  ],
  "properties": {
    "grant_type": {
      "type": "string",
      "description": "OAuth 2.0 grant type",
      "enum": [
        "client_credentials"
      ]
    },
    "resource": {
      "type": "string",
      "description": "Resource identifier to access (e.g., 'https://api.test.neobits.ai/fuse')"
    },
    "scope": {
      "type": "string",
      "description": "Space-separated list of scopes for the token (cannot be combined with role). Each scope must be assigned to the client; otherwise the request fails with `invalid_scope`. The token carries only the scopes requested here, so request every scope the target endpoints need.",
      "example": "environments:read execution:write"
    },
    "role": {
      "type": "string",
      "description": "Role for the token (cannot be combined with scope). The role cannot be more privileged than the client's own role."
    },
    "session_duration": {
      "type": "integer",
      "minimum": 0,
      "maximum": 28800,
      "description": "Requested token lifetime in seconds. The issued lifetime is the lower of this value and the client's `max_session_duration`. When omitted, the token lives for the client's `max_session_duration`.",
      "example": 3600
    }
  }
}
```

## Responses

### 200 Access token response

Content type: `application/json`

```json
{
  "oneOf": [
    {
      "type": "object",
      "title": "ScopeBasedToken",
      "properties": {
        "access_token": {
          "type": "string",
          "description": "The issued JWT access token"
        },
        "token_type": {
          "type": "string",
          "description": "Type of token",
          "enum": [
            "Bearer"
          ]
        },
        "expires_in": {
          "type": "integer",
          "description": "Token lifetime in seconds. At most the client's `max_session_duration` (28800 seconds by default).",
          "example": 3600
        },
        "scope": {
          "type": "string",
          "description": "Space-separated list of scopes associated with the token"
        }
      }
    },
    {
      "type": "object",
      "title": "RoleBasedToken",
      "properties": {
        "access_token": {
          "type": "string",
          "description": "The issued JWT access token"
        },
        "token_type": {
          "type": "string",
          "description": "Type of token",
          "enum": [
            "Bearer"
          ]
        },
        "expires_in": {
          "type": "integer",
          "description": "Token lifetime in seconds. At most the client's `max_session_duration` (28800 seconds by default).",
          "example": 3600
        },
        "role": {
          "type": "string",
          "description": "Role associated with the token"
        }
      }
    }
  ]
}
```

Media examples and encoding:

```json
{
  "examples": {
    "scopeBasedResponse": {
      "summary": "Response with scope",
      "value": {
        "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
        "token_type": "Bearer",
        "expires_in": 3600,
        "scope": "read write"
      }
    },
    "roleBasedResponse": {
      "summary": "Response with role",
      "value": {
        "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
        "token_type": "Bearer",
        "expires_in": 3600,
        "role": "admin"
      }
    }
  }
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Introspect an OAuth 2.0 token

`POST /core/v1/oauth2/introspect`

Endpoints:

- `https://api.test.neobits.ai/core/v1/oauth2/introspect`
- `https://api.prod.neobits.ai/core/v1/oauth2/introspect`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

Determines the state and validity of an OAuth 2.0 token

## Request body

Required: yes

Content type: `application/x-www-form-urlencoded`

```json
{
  "type": "object",
  "title": "OAuthTokenIntrospectRequest",
  "required": [
    "token"
  ],
  "properties": {
    "token": {
      "type": "string",
      "description": "The token to introspect"
    },
    "token_type_hint": {
      "type": "string",
      "description": "Optional hint about the token type. Accepted and ignored (RFC 7662 §2.1)"
    }
  }
}
```

## Responses

### 200 Token introspection response

Content type: `application/json`

```json
{
  "oneOf": [
    {
      "type": "object",
      "title": "ScopeBasedClient",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Whether the client is active"
        },
        "scope": {
          "type": "string",
          "description": "Scopes associated with the client"
        },
        "sub": {
          "type": "string",
          "description": "Subject of the token"
        },
        "exp": {
          "type": "integer",
          "description": "Timestamp when the token expires"
        },
        "account_id": {
          "type": "string",
          "format": "uuid",
          "description": "Account ID associated with the client"
        }
      }
    },
    {
      "type": "object",
      "title": "RoleBasedClient",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Whether the client is active"
        },
        "role": {
          "type": "string",
          "description": "Role associated with the client"
        },
        "sub": {
          "type": "string",
          "description": "Subject of the token"
        },
        "exp": {
          "type": "integer",
          "description": "Timestamp when the token expires"
        },
        "account_id": {
          "type": "string",
          "format": "uuid",
          "description": "Account ID associated with the client"
        }
      }
    },
    {
      "type": "object",
      "title": "InactiveToken",
      "description": "Unknown, invalid, expired or disabled credentials (RFC 7662 §2.2)",
      "required": [
        "active"
      ],
      "properties": {
        "active": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      }
    }
  ]
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Introspect a Basic token

`POST /core/v1/basic/introspect`

Endpoints:

- `https://api.test.neobits.ai/core/v1/basic/introspect`
- `https://api.prod.neobits.ai/core/v1/basic/introspect`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

Determines the state and validity of a Basic token

## Request body

Required: yes

Content type: `application/x-www-form-urlencoded`

```json
{
  "type": "object",
  "title": "BasicTokenIntrospectRequest",
  "required": [
    "token"
  ],
  "properties": {
    "token": {
      "type": "string",
      "description": "The Basic token to introspect"
    },
    "token_type_hint": {
      "type": "string",
      "description": "Optional hint about the token type. Accepted and ignored (RFC 7662 §2.1)"
    }
  }
}
```

## Responses

### 200 Token introspection response

Content type: `application/json`

```json
{
  "oneOf": [
    {
      "type": "object",
      "title": "ScopeBasedClient",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Whether the client is active"
        },
        "scope": {
          "type": "string",
          "description": "Scopes associated with the client"
        },
        "sub": {
          "type": "string",
          "description": "Subject of the token"
        },
        "account_id": {
          "type": "string",
          "format": "uuid",
          "description": "Account ID associated with the client"
        }
      }
    },
    {
      "type": "object",
      "title": "RoleBasedClient",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Whether the client is active"
        },
        "role": {
          "type": "string",
          "description": "Role associated with the client"
        },
        "sub": {
          "type": "string",
          "description": "Subject of the token"
        },
        "account_id": {
          "type": "string",
          "format": "uuid",
          "description": "Account ID associated with the client"
        }
      }
    },
    {
      "type": "object",
      "title": "InactiveToken",
      "description": "Unknown, invalid, expired or disabled credentials (RFC 7662 §2.2)",
      "required": [
        "active"
      ],
      "properties": {
        "active": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      }
    }
  ]
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# List Clients

`GET /core/v1/clients`

Endpoints:

- `https://api.test.neobits.ai/core/v1/clients`
- `https://api.prod.neobits.ai/core/v1/clients`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Retrieves all clients

## Responses

### 200 List of clients

Content type: `application/json`

```json
{
  "type": "object",
  "title": "ClientsList",
  "properties": {
    "page": {
      "type": "object",
      "title": "PaginationInfo",
      "properties": {
        "size": {
          "type": "integer",
          "description": "Number of clients returned"
        },
        "total": {
          "type": "integer",
          "description": "Total number of clients"
        }
      }
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Client",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Client ID"
          },
          "username": {
            "type": "string",
            "description": "Client username"
          },
          "password": {
            "type": "string",
            "description": "Client password"
          },
          "auth_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "basic",
                "oauth"
              ]
            },
            "description": "Core (Authz) methods supported by the client"
          },
          "grant_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "client_credentials"
              ]
            },
            "description": "Grant types supported by the client"
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "description": "Subscription ID associated with the client"
          },
          "scope": {
            "type": "string",
            "description": "Scopes associated with the client"
          },
          "role": {
            "type": "string",
            "description": "Role associated with the client"
          },
          "max_session_duration": {
            "type": "integer",
            "description": "Maximum lifetime in seconds of access tokens issued to the client",
            "example": 28800
          }
        }
      }
    }
  }
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Create Client

`POST /core/v1/clients`

Endpoints:

- `https://api.test.neobits.ai/core/v1/clients`
- `https://api.prod.neobits.ai/core/v1/clients`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Creates a new client

## Request body

Required: yes

Content type: `application/json`

```json
{
  "type": "object",
  "title": "ClientRequest",
  "required": [
    "auth_methods",
    "grant_types"
  ],
  "properties": {
    "auth_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "basic",
          "oauth"
        ]
      },
      "description": "Core (Authz) methods supported by the client"
    },
    "grant_types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "client_credentials"
        ]
      },
      "description": "Grant types supported by the client"
    },
    "scope": {
      "type": "string",
      "description": "Space-separated list of scopes"
    },
    "role": {
      "type": "string",
      "description": "Role for the client"
    },
    "max_session_duration": {
      "type": "integer",
      "minimum": 0,
      "maximum": 28800,
      "default": 28800,
      "description": "Maximum lifetime in seconds of access tokens issued to the client"
    }
  }
}
```

## Responses

### 201 Client created

Content type: `application/json`

```json
{
  "type": "object",
  "title": "Client",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Client ID"
    },
    "username": {
      "type": "string",
      "description": "Client username"
    },
    "password": {
      "type": "string",
      "description": "Client password"
    },
    "auth_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "basic",
          "oauth"
        ]
      },
      "description": "Core (Authz) methods supported by the client"
    },
    "grant_types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "client_credentials"
        ]
      },
      "description": "Grant types supported by the client"
    },
    "subscription_id": {
      "type": "string",
      "format": "uuid",
      "description": "Subscription ID associated with the client"
    },
    "scope": {
      "type": "string",
      "description": "Scopes associated with the client"
    },
    "role": {
      "type": "string",
      "description": "Role associated with the client"
    },
    "max_session_duration": {
      "type": "integer",
      "description": "Maximum lifetime in seconds of access tokens issued to the client",
      "example": 28800
    }
  }
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Get Client

`GET /core/v1/clients/{client_id}`

Endpoints:

- `https://api.test.neobits.ai/core/v1/clients/{client_id}`
- `https://api.prod.neobits.ai/core/v1/clients/{client_id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Retrieves a specific client by ID

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `client_id` | path | yes | string (uuid) | The client ID |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "client_id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "description": "The client ID"
  }
]
```

## Responses

### 200 Client details

Content type: `application/json`

```json
{
  "type": "object",
  "title": "Client",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Client ID"
    },
    "username": {
      "type": "string",
      "description": "Client username"
    },
    "password": {
      "type": "string",
      "description": "Client password, masked"
    },
    "auth_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "basic",
          "oauth"
        ]
      },
      "description": "Core (Authz) methods supported by the client"
    },
    "grant_types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "client_credentials"
        ]
      },
      "description": "Grant types supported by the client"
    },
    "subscription_id": {
      "type": "string",
      "format": "uuid",
      "description": "Subscription ID associated with the client"
    },
    "scope": {
      "type": "string",
      "description": "Scopes associated with the client"
    },
    "role": {
      "type": "string",
      "description": "Role associated with the client"
    },
    "max_session_duration": {
      "type": "integer",
      "description": "Maximum lifetime in seconds of access tokens issued to the client",
      "example": 28800
    }
  }
}
```

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Delete Client

`DELETE /core/v1/clients/{client_id}`

Endpoints:

- `https://api.test.neobits.ai/core/v1/clients/{client_id}`
- `https://api.prod.neobits.ai/core/v1/clients/{client_id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Deletes a specific client

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `client_id` | path | yes | string (uuid) | The client ID |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "client_id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "description": "The client ID"
  }
]
```

## Responses

### 204 Client deleted successfully

### 400 OAuth 2.0 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2BadRequestResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "invalid_client",
        "invalid_grant",
        "unauthorized_client",
        "unsupported_grant_type",
        "invalid_scope"
      ],
      "example": "invalid_request"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 400
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The request is missing a required parameter."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 401 OAuth 2.0 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2UnauthorizedResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_client"
      ],
      "example": "invalid_client"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 401
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Client authentication failed."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 404 OAuth 2.0 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2NotFoundResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "invalid_request",
        "not_found"
      ],
      "example": "not_found"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 404
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The requested resource was not found."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 429 OAuth 2.0 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and no `error_timestamp` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "too_many_requests"
      ],
      "example": "too_many_requests"
    },
    "error_code": {
      "type": "string",
      "description": "Error code for programmatic handling, in the format HTTP_STATUS-SEQUENCE",
      "example": "429-000"
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai/api-reference/errors"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "Too many requests. Please try again later."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 500 OAuth 2.0 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "server_error"
      ],
      "example": "server_error"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 500
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server encountered an unexpected condition."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 503 OAuth 2.0 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 503
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server is currently unable to handle the request."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

### 504 OAuth 2.0 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "OAuth2TimeoutResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "A single ASCII error code",
      "enum": [
        "temporarily_unavailable"
      ],
      "example": "temporarily_unavailable"
    },
    "error_code": {
      "type": "integer",
      "description": "Numeric error code for programmatic handling",
      "example": 504
    },
    "error_uri": {
      "type": "string",
      "format": "uri",
      "description": "A URI identifying a human-readable web page with information about the error",
      "example": "https://docs.neobits.ai"
    },
    "error_description": {
      "type": "string",
      "description": "Human-readable ASCII text providing additional information",
      "example": "The authorization server did not receive a timely response."
    },
    "error_timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the error occurred",
      "example": "2025-06-25T15:29:49.992Z"
    }
  },
  "required": [
    "error"
  ]
}
```

---

# Create an inquiry

`POST /fuse/v2/inquiries`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/inquiries`
- `https://api.prod.neobits.ai/fuse/v2/inquiries`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

If you plan on fetching data that requires prior consent from the user, then you must create an inquiry via this endpoint, and send the user to the inquiry url first. See the `GET /persons/{ssn}` endpoint documentation to see what data you can fetch with/without prior consent from the user.

  

This endpoint returns a link to Neobits' app where Neobits will take the person through the steps necessary to provide their consent and share their data. After the user consents to share their data, they will be redirected to the URL(s) you decide as part of the request body to this endpoint (see request body schema).

  

## Error handling

Errors are attached to the error redirect URL as query parameters. When the user is redirected, the consumer of the API can read the error details to handle it appropriately.

Example error redirect:

```
https://redirect.example.com/error?name=InternalServerError&code=500-001&message=An+internal+server+error+occurred
```

The redirect URL includes three query parameters:

-   **name** - The error type identifier (e.g., `InternalServerError`, `BadRequestError`)
-   **code** - A unique error code in the format `HTTP_STATUS-SEQUENCE`
-   **message** - A URL-encoded human-readable description of the error

📖

#### Complete Error Reference

For a complete list of all possible error codes and their descriptions, see the error documentation.

[View all error codes →](https://docs.neobits.ai/api-reference/errors.md)

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | no | string; example `7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21` | Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "Client-chosen key, such as a UUID, that makes a retry safe. A repeated key returns the stored 201 response without running the request again. Reusing a key with a different request returns 409. A non-2xx response does not store the key.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "example": "7f9c2ba4-e88f-4f2e-9b1d-1f3c6a0e5d21"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "CreateInquiryRequestBody",
  "type": "object",
  "required": [
    "redirect",
    "ssn"
  ],
  "properties": {
    "ssn": {
      "type": "string",
      "example": "01029413157",
      "description": "The unique identifier for the person"
    },
    "externalId": {
      "type": "string",
      "example": "CAN_BE_ANY_STRING",
      "description": "Optional identifier the consumer of the API can provide."
    },
    "skipConsentMessages": {
      "type": "boolean",
      "example": true,
      "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
    },
    "notifications": {
      "type": "array",
      "description": "The notification array allows the consumer of the API to trigger text message and emails to alert the customer",
      "items": {
        "type": "object",
        "title": "NotificationOptions",
        "required": [
          "type",
          "message",
          "to"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "example": "SMS"
          },
          "message": {
            "type": "string",
            "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
            "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
          },
          "to": {
            "type": "string",
            "example": "12345678",
            "description": "The phone number you want the text message to be sent to"
          }
        }
      }
    },
    "redirect": {
      "type": "object",
      "title": "RedirectOptions",
      "description": "URL's provided here will decide where the user should be sent on flow completion",
      "properties": {
        "onSuccess": {
          "type": "string",
          "description": "URL to send the user to after the data is fetched",
          "format": "url",
          "example": "https://your.frontend.com/success"
        },
        "onError": {
          "type": "string",
          "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
          "format": "url",
          "example": "https://your.frontend.com/error"
        }
      }
    }
  }
}
```

## Responses

### 201 Created

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Location": {
      "description": "The location of the created inquiry in the form of a resource url",
      "schema": {
        "type": "string",
        "format": "url",
        "example": "https://api.test.neobits.ai/fuse/v1/persons/01029413157/inquiries/0679c533-5061-496e-8dc5-df786f04a209"
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "title": "Inquiry",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "0679c533-5061-496e-8dc5-df786f04a209"
    },
    "ssn": {
      "type": "string",
      "example": "01029413157",
      "description": "The unique identifier for the person the inquiry is for."
    },
    "url": {
      "example": "https://informasjonsinnhenting.prod.neobits.ai?applicationState=ey12345",
      "format": "uri",
      "type": "string",
      "description": "Give this URL to the user so they can start the flow."
    },
    "externalId": {
      "type": "string",
      "example": "CAN_BE_ANY_STRING",
      "description": "Optional identifier the consumer of the API can provide."
    },
    "skipConsentMessages": {
      "type": "boolean",
      "example": true,
      "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
    },
    "isCompleted": {
      "type": "boolean",
      "example": false,
      "description": "Indicates if the inquiry is completed or not by the user."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry created date"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry last updated date"
    },
    "notifications": {
      "type": "array",
      "description": "The notification options set for the inquiry.",
      "items": {
        "type": "object",
        "title": "NotificationOptions",
        "required": [
          "type",
          "message",
          "to"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "example": "SMS"
          },
          "message": {
            "type": "string",
            "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
            "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
          },
          "to": {
            "type": "string",
            "example": "12345678",
            "description": "The phone number you want the text message to be sent to"
          }
        }
      }
    },
    "redirect": {
      "type": "object",
      "title": "RedirectOptions",
      "description": "URL's provided here will decide where the user should be sent on flow completion",
      "properties": {
        "onSuccess": {
          "type": "string",
          "description": "URL to send the user to after the data is fetched",
          "format": "url",
          "example": "https://your.frontend.com/success"
        },
        "onError": {
          "type": "string",
          "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
          "format": "url",
          "example": "https://your.frontend.com/error"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "sbl": {
          "type": "object",
          "properties": {
            "authCode": {
              "type": "string",
              "example": "0679c533-5061-496e-8dc5-df786f04a209",
              "description": "Auhtorization code received from Altinn. Used to retrieve the customers data from Skatteetaten."
            }
          }
        }
      }
    },
    "prerequisites": {
      "type": "array",
      "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
      "items": {
        "type": "object",
        "title": "Prerequisite",
        "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "SBL"
            ],
            "example": "SBL"
          },
          "isCompleted": {
            "type": "boolean",
            "description": "Whether the prerequisite has been completed or not. When the prerequisite requires the user to give prior consent, this field will be true if the user has given consent."
          },
          "consentUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The URL neobits will redirect the user to internally, so the user can complete the prerequisite.",
            "format": "uri"
          }
        }
      }
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 409 Conflict

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ConflictResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Conflict"
            ],
            "example": "Conflict"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "409-000",
              "409-001",
              "409-002"
            ],
            "example": "409-000"
          },
          "message": {
            "type": "string",
            "example": "A resource with this identifier already exists"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Get multiple inquiries (TBA)

`GET /fuse/v2/inquiries`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/inquiries`
- `https://api.prod.neobits.ai/fuse/v2/inquiries`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

Get multiple inquiries at a time. Supports cursor-based pagination.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `filter[isCompleted]` | query | no | boolean; example `false` | Filter the inquiries by completion status. |
| `page[after]` | query | no | string; example `df786f04a209` | Fetch inquiries after this cursor |
| `page[before]` | query | no | string; example `5061496e` | Fetch inquiries before this cursor |
| `page[size]` | query | no | integer; minimum 1; maximum 200; example `10` | The maximum number of inquiries to return |
| `order` | query | no | string; one of `asc`, `desc`; example `asc` | The order of the inquiries. Defaults to asc. |
| `sort` | query | no | string; one of `createdAt`, `updatedAt`; example `createdAt` | The field to sort the inquiries by. Defaults to createdAt. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "in": "query",
    "required": false,
    "name": "filter[isCompleted]",
    "example": "false",
    "schema": {
      "type": "boolean"
    },
    "description": "Filter the inquiries by completion status."
  },
  {
    "in": "query",
    "required": false,
    "name": "page[after]",
    "example": "df786f04a209",
    "schema": {
      "type": "string"
    },
    "description": "Fetch inquiries after this cursor"
  },
  {
    "in": "query",
    "required": false,
    "name": "page[before]",
    "example": "5061496e",
    "schema": {
      "type": "string"
    },
    "description": "Fetch inquiries before this cursor"
  },
  {
    "in": "query",
    "required": false,
    "name": "page[size]",
    "example": 10,
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    },
    "description": "The maximum number of inquiries to return"
  },
  {
    "in": "query",
    "required": false,
    "name": "order",
    "example": "asc",
    "schema": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "description": "The order of the inquiries. Defaults to asc."
  },
  {
    "in": "query",
    "required": false,
    "name": "sort",
    "example": "createdAt",
    "schema": {
      "type": "string",
      "enum": [
        "createdAt",
        "updatedAt"
      ]
    },
    "description": "The field to sort the inquiries by. Defaults to createdAt."
  }
]
```

## Responses

### 200 OK

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "title": "InquiriesResponse",
  "properties": {
    "metadata": {
      "type": "object",
      "properties": {
        "page": {
          "type": "object",
          "properties": {
            "size": {
              "example": 50,
              "type": "integer",
              "description": "The maximum number of items to return."
            },
            "total": {
              "example": 20,
              "type": "integer",
              "description": "The number of items in the results set."
            },
            "after": {
              "example": "df786f04",
              "type": "string",
              "description": "The cursor to fetch the next page of inquiries."
            },
            "before": {
              "example": "0679c533",
              "type": "string",
              "description": "The cursor to fetch the previous page of inquiries."
            }
          }
        }
      }
    },
    "data": {
      "type": "array",
      "title": "Inquiries",
      "items": {
        "type": "object",
        "title": "Inquiry",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "0679c533-5061-496e-8dc5-df786f04a209"
          },
          "ssn": {
            "type": "string",
            "example": "01029413157",
            "description": "The unique identifier for the person the inquiry is for."
          },
          "url": {
            "example": "https://informasjonsinnhenting.prod.neobits.ai?applicationState=ey12345",
            "format": "uri",
            "type": "string",
            "description": "Give this URL to the user so they can start the flow."
          },
          "externalId": {
            "type": "string",
            "example": "CAN_BE_ANY_STRING",
            "description": "Optional identifier the consumer of the API can provide."
          },
          "skipConsentMessages": {
            "type": "boolean",
            "example": true,
            "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
          },
          "isCompleted": {
            "type": "boolean",
            "example": false,
            "description": "Indicates if the inquiry is completed or not by the user."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2019-09-07T15:50:00Z",
            "description": "Inquiry created date"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2019-09-07T15:50:00Z",
            "description": "Inquiry last updated date"
          },
          "notifications": {
            "type": "array",
            "description": "The notification options set for the inquiry.",
            "items": {
              "type": "object",
              "title": "NotificationOptions",
              "required": [
                "type",
                "message",
                "to"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "SMS"
                  ],
                  "example": "SMS"
                },
                "message": {
                  "type": "string",
                  "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
                  "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
                },
                "to": {
                  "type": "string",
                  "example": "12345678",
                  "description": "The phone number you want the text message to be sent to"
                }
              }
            }
          },
          "redirect": {
            "type": "object",
            "title": "RedirectOptions",
            "description": "URL's provided here will decide where the user should be sent on flow completion",
            "properties": {
              "onSuccess": {
                "type": "string",
                "description": "URL to send the user to after the data is fetched",
                "format": "url",
                "example": "https://your.frontend.com/success"
              },
              "onError": {
                "type": "string",
                "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
                "format": "url",
                "example": "https://your.frontend.com/error"
              }
            }
          },
          "metadata": {
            "type": "object",
            "properties": {
              "sbl": {
                "type": "object",
                "properties": {
                  "authCode": {
                    "type": "string",
                    "example": "0679c533-5061-496e-8dc5-df786f04a209",
                    "description": "Auhtorization code received from Altinn. Used to retrieve the customers data from Skatteetaten."
                  }
                }
              }
            }
          },
          "prerequisites": {
            "type": "array",
            "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
            "items": {
              "type": "object",
              "title": "Prerequisite",
              "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "SBL"
                  ],
                  "example": "SBL"
                },
                "isCompleted": {
                  "type": "boolean",
                  "description": "Whether the prerequisite has been completed or not. When the prerequisite requires the user to give prior consent, this field will be true if the user has given consent."
                },
                "consentUrl": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The URL neobits will redirect the user to internally, so the user can complete the prerequisite.",
                  "format": "uri"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Delete an inquiry (TBA)

`DELETE /fuse/v2/inquiries/{inquiryId}`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/inquiries/{inquiryId}`
- `https://api.prod.neobits.ai/fuse/v2/inquiries/{inquiryId}`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

Inquiries that are completed cannot be deleted.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `inquiryId` | path | yes | string; example `0679c533-5061-496e-8dc5-df786f04a209` | The unique identifier of the inquiry |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "in": "path",
    "name": "inquiryId",
    "required": true,
    "example": "0679c533-5061-496e-8dc5-df786f04a209",
    "schema": {
      "type": "string"
    },
    "description": "The unique identifier of the inquiry"
  }
]
```

## Responses

### 204 No Content

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Update an inquiry (TBA)

`PATCH /fuse/v2/inquiries/{inquiryId}`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/inquiries/{inquiryId}`
- `https://api.prod.neobits.ai/fuse/v2/inquiries/{inquiryId}`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

Partially update an inquiry.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `inquiryId` | path | yes | string; example `0679c533-5061-496e-8dc5-df786f04a209` | The unique identifier of the inquiry |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "in": "path",
    "name": "inquiryId",
    "required": true,
    "example": "0679c533-5061-496e-8dc5-df786f04a209",
    "schema": {
      "type": "string"
    },
    "description": "The unique identifier of the inquiry"
  }
]
```

## Request body

Required: yes

Content type: `application/json`

```json
{
  "title": "PatchInquiryRequestBody",
  "type": "object",
  "properties": {
    "externalId": {
      "type": "string",
      "example": "CAN_BE_ANY_STRING",
      "description": "Optional identifier the consumer of the API can provide."
    },
    "skipConsentMessages": {
      "type": "boolean",
      "example": true,
      "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
    },
    "notifications": {
      "type": "array",
      "description": "The notification array allows the consumer of the API to trigger text message and emails to alert the customer",
      "items": {
        "type": "object",
        "title": "NotificationOptions",
        "required": [
          "type",
          "message",
          "to"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "example": "SMS"
          },
          "message": {
            "type": "string",
            "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
            "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
          },
          "to": {
            "type": "string",
            "example": "12345678",
            "description": "The phone number you want the text message to be sent to"
          }
        }
      }
    },
    "redirect": {
      "type": "object",
      "title": "RedirectOptions",
      "description": "URL's provided here will decide where the user should be sent on flow completion",
      "properties": {
        "onSuccess": {
          "type": "string",
          "description": "URL to send the user to after the data is fetched",
          "format": "url",
          "example": "https://your.frontend.com/success"
        },
        "onError": {
          "type": "string",
          "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
          "format": "url",
          "example": "https://your.frontend.com/error"
        }
      }
    }
  }
}
```

## Responses

### 200 OK

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "title": "Inquiry",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "0679c533-5061-496e-8dc5-df786f04a209"
    },
    "ssn": {
      "type": "string",
      "example": "01029413157",
      "description": "The unique identifier for the person the inquiry is for."
    },
    "url": {
      "example": "https://informasjonsinnhenting.prod.neobits.ai?applicationState=ey12345",
      "format": "uri",
      "type": "string",
      "description": "Give this URL to the user so they can start the flow."
    },
    "externalId": {
      "type": "string",
      "example": "CAN_BE_ANY_STRING",
      "description": "Optional identifier the consumer of the API can provide."
    },
    "skipConsentMessages": {
      "type": "boolean",
      "example": true,
      "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
    },
    "isCompleted": {
      "type": "boolean",
      "example": false,
      "description": "Indicates if the inquiry is completed or not by the user."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry created date"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry last updated date"
    },
    "notifications": {
      "type": "array",
      "description": "The notification options set for the inquiry.",
      "items": {
        "type": "object",
        "title": "NotificationOptions",
        "required": [
          "type",
          "message",
          "to"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "example": "SMS"
          },
          "message": {
            "type": "string",
            "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
            "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
          },
          "to": {
            "type": "string",
            "example": "12345678",
            "description": "The phone number you want the text message to be sent to"
          }
        }
      }
    },
    "redirect": {
      "type": "object",
      "title": "RedirectOptions",
      "description": "URL's provided here will decide where the user should be sent on flow completion",
      "properties": {
        "onSuccess": {
          "type": "string",
          "description": "URL to send the user to after the data is fetched",
          "format": "url",
          "example": "https://your.frontend.com/success"
        },
        "onError": {
          "type": "string",
          "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
          "format": "url",
          "example": "https://your.frontend.com/error"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "sbl": {
          "type": "object",
          "properties": {
            "authCode": {
              "type": "string",
              "example": "0679c533-5061-496e-8dc5-df786f04a209",
              "description": "Auhtorization code received from Altinn. Used to retrieve the customers data from Skatteetaten."
            }
          }
        }
      }
    },
    "prerequisites": {
      "type": "array",
      "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
      "items": {
        "type": "object",
        "title": "Prerequisite",
        "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "SBL"
            ],
            "example": "SBL"
          },
          "isCompleted": {
            "type": "boolean",
            "description": "Whether the prerequisite has been completed or not. When the prerequisite requires the user to give prior consent, this field will be true if the user has given consent."
          },
          "consentUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The URL neobits will redirect the user to internally, so the user can complete the prerequisite.",
            "format": "uri"
          }
        }
      }
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Get an inquiry

`GET /fuse/v2/inquiries/{inquiryId}`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/inquiries/{inquiryId}`
- `https://api.prod.neobits.ai/fuse/v2/inquiries/{inquiryId}`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

Fetch a single inquiry using its id.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `inquiryId` | path | yes | string; example `0679c533-5061-496e-8dc5-df786f04a209` | The unique identifier of the inquiry |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "in": "path",
    "name": "inquiryId",
    "required": true,
    "example": "0679c533-5061-496e-8dc5-df786f04a209",
    "schema": {
      "type": "string"
    },
    "description": "The unique identifier of the inquiry"
  }
]
```

## Responses

### 200 OK

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "title": "Inquiry",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "0679c533-5061-496e-8dc5-df786f04a209"
    },
    "ssn": {
      "type": "string",
      "example": "01029413157",
      "description": "The unique identifier for the person the inquiry is for."
    },
    "url": {
      "example": "https://informasjonsinnhenting.prod.neobits.ai?applicationState=ey12345",
      "format": "uri",
      "type": "string",
      "description": "Give this URL to the user so they can start the flow."
    },
    "externalId": {
      "type": "string",
      "example": "CAN_BE_ANY_STRING",
      "description": "Optional identifier the consumer of the API can provide."
    },
    "skipConsentMessages": {
      "type": "boolean",
      "example": true,
      "description": "Will skip messages explaining to the user which consents are needed to complete the flow."
    },
    "isCompleted": {
      "type": "boolean",
      "example": false,
      "description": "Indicates if the inquiry is completed or not by the user."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry created date"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-07T15:50:00Z",
      "description": "Inquiry last updated date"
    },
    "notifications": {
      "type": "array",
      "description": "The notification options set for the inquiry.",
      "items": {
        "type": "object",
        "title": "NotificationOptions",
        "required": [
          "type",
          "message",
          "to"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "example": "SMS"
          },
          "message": {
            "type": "string",
            "example": "Hei. For å dele din informasjon med Bank Bankersen ASA, vennligst gå til denne lenken $link",
            "description": "The consumer of the API can decide where to place the link to initate the process by passing in $link (see example)"
          },
          "to": {
            "type": "string",
            "example": "12345678",
            "description": "The phone number you want the text message to be sent to"
          }
        }
      }
    },
    "redirect": {
      "type": "object",
      "title": "RedirectOptions",
      "description": "URL's provided here will decide where the user should be sent on flow completion",
      "properties": {
        "onSuccess": {
          "type": "string",
          "description": "URL to send the user to after the data is fetched",
          "format": "url",
          "example": "https://your.frontend.com/success"
        },
        "onError": {
          "type": "string",
          "description": "URL to send the user to when an error occurs. See the \"Error handling\" section above for more info.",
          "format": "url",
          "example": "https://your.frontend.com/error"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "sbl": {
          "type": "object",
          "properties": {
            "authCode": {
              "type": "string",
              "example": "0679c533-5061-496e-8dc5-df786f04a209",
              "description": "Auhtorization code received from Altinn. Used to retrieve the customers data from Skatteetaten."
            }
          }
        }
      }
    },
    "prerequisites": {
      "type": "array",
      "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
      "items": {
        "type": "object",
        "title": "Prerequisite",
        "description": "Prerequisites are actions that the user must complete before the data can be fetched. They can either be consents that must be given, or flows that must be completed.",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "SBL"
            ],
            "example": "SBL"
          },
          "isCompleted": {
            "type": "boolean",
            "description": "Whether the prerequisite has been completed or not. When the prerequisite requires the user to give prior consent, this field will be true if the user has given consent."
          },
          "consentUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The URL neobits will redirect the user to internally, so the user can complete the prerequisite.",
            "format": "uri"
          }
        }
      }
    }
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```

---

# Get a person

`GET /fuse/v2/persons/{ssn}`

Endpoints:

- `https://api.test.neobits.ai/fuse/v2/persons/{ssn}`
- `https://api.prod.neobits.ai/fuse/v2/persons/{ssn}`

Authentication: one of the following alternatives:

- `basic`

- `basic`: Basic authentication, base64 encoded username:password.

❗

#### Authorization Required

This endpoint requires authentication via the Core API Auth server.

[Learn about authentication →](https://docs.neobits.ai/api-reference/tag/core-authz.md)

  

Use this endpoint to fetch information about a customer. If the data in question requires prior consent from the customer, then you need to create an inquiry first and give the inquiry url to your customer, so that they can consent to share their data.

  

When the inquiry is completed by the customer, you can come back and use the inquiryId to fetch data.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `ssn` | path | yes | string; example `01029413157` | The unique identifier for the person |
| `inquiryId` | query | no | string (uuid); example `0679c533-5061-496e-8dc5-df786f04a209` | If the data you are fetching requires an inquiry to be created and completed by the customer first, then this parameter is required. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "in": "path",
    "name": "ssn",
    "required": true,
    "example": "01029413157",
    "schema": {
      "type": "string"
    },
    "description": "The unique identifier for the person"
  },
  {
    "in": "query",
    "name": "inquiryId",
    "schema": {
      "type": "string",
      "format": "uuid",
      "example": "0679c533-5061-496e-8dc5-df786f04a209"
    },
    "required": false,
    "description": "If the data you are fetching requires an inquiry to be created and completed by the customer first, then this parameter is required."
  }
]
```

## Responses

### 200 OK

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "anyOf": [
    {
      "title": "PersonWithConsent",
      "type": "object",
      "description": "Returns data for a person where the users consent is required and is completed via \"Initate\". Requires the \"code\" query param passed as part of the request.",
      "properties": {
        "ssn": {
          "type": "string",
          "example": "01029413157"
        },
        "firstName": {
          "type": "string",
          "example": "STOR"
        },
        "lastName": {
          "type": "string",
          "example": "MÅNE"
        },
        "maritalStatus": {
          "type": "string",
          "enum": [
            "MARRIED",
            "NOT_GIVEN",
            "UNMARRIED",
            "DIVORCED",
            "SEPARATED",
            "WIDOW_ER",
            "REGISTERED_PARTNER",
            "SEPARATED_PARTNER",
            "DIVORCED_PARTNER",
            "REMAINING_PARTNER"
          ]
        },
        "citizenships": {
          "type": "array",
          "items": {
            "title": "Citizenship",
            "type": "object",
            "properties": {
              "citizenship": {
                "type": "string",
                "example": "NOR"
              },
              "isApplicable": {
                "type": "boolean",
                "example": true,
                "description": "maps to 'erGjeldende' in the original response"
              }
            }
          }
        },
        "gender": {
          "type": "string",
          "example": "MALE",
          "enum": [
            "MALE",
            "FEMALE",
            "UNKNOWN"
          ]
        },
        "birthdate": {
          "type": "string",
          "format": "date",
          "example": "1982-02-21"
        },
        "countryOfBirth": {
          "type": "string",
          "example": "NOR"
        },
        "status": {
          "type": "string",
          "example": "RESIDENT",
          "description": "The current status of the person in the Norwegian Population Registry",
          "enum": [
            "RESIDENT",
            "RELOCATED",
            "DISAPPEARED",
            "DISEASED",
            "CEASED",
            "REGISTERED_BY_BIRTH",
            "TEMPORARY",
            "INACTIVE",
            "NON_RESIDENT",
            "ACTIVE",
            "UNKNOWN"
          ]
        },
        "employmentStatus": {
          "type": "string",
          "description": "Inferred from the applicants income report of the last month.",
          "enum": [
            "PERMANENTLY_EMPLOYED",
            "TEMPORARILY_EMPLOYED",
            "SICKNESS_ALLOWANCE",
            "DISABILITY_PENSION",
            "RETIRED",
            "UNEMPLOYED",
            "OTHER"
          ],
          "example": "PERMANENTLY_EMPLOYED"
        },
        "receivesSocialSecurityBenefits": {
          "type": "boolean",
          "example": true,
          "description": "Inferred from the applicants income report of the last month."
        },
        "hasAttachmentCharge": {
          "type": "boolean",
          "example": true,
          "description": "Searches through the movables registry (løsøre) to find active attachment charges (UTLEGG/UTPANTING)."
        },
        "residentialAddress": {
          "type": [
            "object",
            "null"
          ],
          "title": "ResidentialAddress",
          "description": "The persons Norwegian residential address. May be null, if the person is living in a foreign country.",
          "properties": {
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "example": "2019-09-16T22:14:45.624Z"
            },
            "street": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Rudvegen"
                },
                "number": {
                  "type": "string",
                  "example": "57"
                },
                "letter": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "example": "A"
                }
              }
            },
            "municipality": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "NESBYEN"
                },
                "number": {
                  "type": "string",
                  "example": "3540"
                }
              }
            }
          }
        },
        "family": {
          "type": "object",
          "properties": {
            "numChildrenBelowAge18": {
              "type": "integer",
              "description": "Number of persons in the family that are below 18 years of age"
            },
            "members": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ssn": {
                    "type": "string",
                    "example": "03028711300",
                    "description": "11 digit identification number of the person."
                  },
                  "age": {
                    "type": "integer",
                    "example": 34
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "FEMALE",
                      "MALE"
                    ]
                  },
                  "relation": {
                    "type": "string",
                    "enum": [
                      "PARENT",
                      "SPOUSE_OR_PARTNER",
                      "CHILD",
                      "SIBLING"
                    ],
                    "description": "The persons relation to the family member."
                  }
                }
              }
            }
          }
        },
        "property": {
          "type": "object",
          "title": "PropertyOverview",
          "description": "Aggregation of Kartverket API and Eiendomsverdi API",
          "properties": {
            "ownsProperty": {
              "type": "boolean",
              "example": true
            },
            "properties": {
              "type": "array",
              "items": {
                "type": "object",
                "title": "Property",
                "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                    "SelfOwnedProperty": "./SelfOwnedProperty.yaml",
                    "HousingCooperative": "./HousingCooperative.yaml"
                  }
                },
                "anyOf": [
                  {
                    "type": "object",
                    "title": "SelfOwnedProperty",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "039456312"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "SELF_OWNED",
                          "HOUSING_COOPERATIVE"
                        ],
                        "example": "SELF_OWNED"
                      },
                      "value": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimateHaircut": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "commonDebt": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "netValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "grossValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "areaMarketScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "municipalityScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "customerApprovedValue": {
                        "type": "integer",
                        "example": 20
                      },
                      "valueEstimateAccuracyLevel": {
                        "type": "number",
                        "format": "double",
                        "example": 4
                      },
                      "purchasedAt": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2019-09-16T22:14:45.624Z"
                      },
                      "cadastralUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "7"
                      },
                      "propertyUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "391"
                      },
                      "leaseholdNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "condominiumUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "ownershipShare": {
                        "type": "number",
                        "example": 0.5
                      },
                      "estateType": {
                        "type": "string",
                        "enum": [
                          "APARTMENT",
                          "DETACHED_HOUSE",
                          "TERRACED_HOUSE",
                          "SEMI_DETACHED_HOUSE",
                          "LEISURE_HOME",
                          "DORM",
                          "RESIDENTIAL_PLOT",
                          "CABIN_PLOT",
                          "SCHOOL_KINDERGARTEN",
                          "COMMERCIAL_BUILDING",
                          "FARM",
                          "HOUSING",
                          "HOUSE",
                          "SHARED_HOUSING",
                          "GARAGE",
                          "UNDEVELOPED",
                          "PUBLIC",
                          "HEALTH",
                          "MEDIA_COMM",
                          "CULTURE_AND_SPORTS",
                          "RELIGION",
                          "TRANSPORTATION",
                          "OTHER",
                          "UNKNOWN"
                        ],
                        "example": "DETACHED_HOUSE"
                      },
                      "street": {
                        "title": "Street",
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Smedstusvingen"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "18"
                          },
                          "letter": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "A"
                          }
                        }
                      },
                      "zip": {
                        "title": "Zip",
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "1480"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "SLATTUM"
                          }
                        }
                      },
                      "municipality": {
                        "title": "Municipality",
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3031"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "NITTEDAL"
                          }
                        }
                      },
                      "liens": {
                        "type": "array",
                        "items": {
                          "title": "Lien",
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "039456312"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "example": "2019-09-16T22:14:45.624Z"
                            },
                            "creditorName": {
                              "type": "string",
                              "example": "SPAREBANKEN TELEMARK"
                            },
                            "creditorOrgNumber": {
                              "type": "string",
                              "example": "985621551"
                            },
                            "value": {
                              "type": "number",
                              "example": 4500000
                            }
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "HousingCooperative",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "039456312"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "SELF_OWNED",
                          "HOUSING_COOPERATIVE"
                        ],
                        "example": "SELF_OWNED"
                      },
                      "value": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimateHaircut": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "commonDebt": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "netValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "grossValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "areaMarketScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "municipalityScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "customerApprovedValue": {
                        "type": "integer",
                        "example": 20
                      },
                      "valueEstimateAccuracyLevel": {
                        "type": "number",
                        "format": "double",
                        "example": 4
                      },
                      "purchasedAt": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2019-09-16T22:14:45.624Z"
                      },
                      "cadastralUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "7"
                      },
                      "propertyUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "391"
                      },
                      "leaseholdNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "condominiumUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "ownershipShare": {
                        "type": "number",
                        "example": 0.5
                      },
                      "estateType": {
                        "type": "string",
                        "enum": [
                          "APARTMENT",
                          "DETACHED_HOUSE",
                          "TERRACED_HOUSE",
                          "SEMI_DETACHED_HOUSE",
                          "LEISURE_HOME",
                          "DORM",
                          "RESIDENTIAL_PLOT",
                          "CABIN_PLOT",
                          "SCHOOL_KINDERGARTEN",
                          "COMMERCIAL_BUILDING",
                          "FARM",
                          "HOUSING",
                          "HOUSE",
                          "SHARED_HOUSING",
                          "GARAGE",
                          "UNDEVELOPED",
                          "PUBLIC",
                          "HEALTH",
                          "MEDIA_COMM",
                          "CULTURE_AND_SPORTS",
                          "RELIGION",
                          "TRANSPORTATION",
                          "OTHER",
                          "UNKNOWN"
                        ],
                        "example": "DETACHED_HOUSE"
                      },
                      "street": {
                        "title": "Street",
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Smedstusvingen"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "18"
                          },
                          "letter": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "A"
                          }
                        }
                      },
                      "zip": {
                        "title": "Zip",
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "1480"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "SLATTUM"
                          }
                        }
                      },
                      "municipality": {
                        "title": "Municipality",
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3031"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "NITTEDAL"
                          }
                        }
                      },
                      "housingCooperative": {
                        "title": "HousingCooperativeInformation",
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "5424543"
                          },
                          "name": {
                            "type": "string",
                            "example": "TERTITTEN BORETTSLAG"
                          },
                          "orgID": {
                            "type": "string",
                            "example": "12345678911"
                          },
                          "shareNumber": {
                            "type": "string",
                            "example": 25
                          }
                        }
                      },
                      "liens": {
                        "type": "array",
                        "items": {
                          "title": "Lien",
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "039456312"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "example": "2019-09-16T22:14:45.624Z"
                            },
                            "creditorName": {
                              "type": "string",
                              "example": "SPAREBANKEN TELEMARK"
                            },
                            "creditorOrgNumber": {
                              "type": "string",
                              "example": "985621551"
                            },
                            "value": {
                              "type": "number",
                              "example": 4500000
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "debt": {
          "type": "object",
          "properties": {
            "sumEstimatedBalance": {
              "type": "number",
              "format": "double",
              "example": 40000000
            },
            "sumOriginalBalance": {
              "type": "number",
              "format": "double",
              "example": 60000000
            },
            "sumAccruedInterestFromDebtCollectors": {
              "type": "number",
              "format": "double",
              "example": 400
            },
            "sumOwedMaintenancePayments": {
              "type": "number",
              "format": "double",
              "example": 15000
            },
            "sumOwedUnderpaidTax": {
              "type": "number",
              "format": "double",
              "example": 4000
            },
            "sumLatePaymentInterest": {
              "type": "number",
              "format": "double",
              "example": 346
            },
            "mortgageDebt": {
              "title": "MortgageDebtOverview",
              "type": "object",
              "properties": {
                "sumEstimatedBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "sumEstimatedBalanceByOwnership": {
                  "type": "number",
                  "format": "double",
                  "example": 35000000
                },
                "sumOriginalBalanceByOwnership": {
                  "type": "number",
                  "format": "double",
                  "example": 50000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "creditorName": {
                            "type": "string",
                            "example": "CREDITOR NAME"
                          },
                          "estimatedBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4107055.83,
                            "description": "An estimate of what the balance might be today."
                          },
                          "originalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4407055.83,
                            "description": "The balance gathered from the data source."
                          },
                          "updatedAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Updated date in the source registry."
                          },
                          "createdAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Created date in the source registry."
                          },
                          "estimatedDuration": {
                            "type": "number",
                            "example": 260,
                            "description": "Specifies the estimated duration in months used in the amortization calculations"
                          },
                          "estimatedRemainingDuration": {
                            "type": "number",
                            "example": 180,
                            "description": "Specifies the estimated remaining duration in months of the loan"
                          },
                          "estimatedNominalInterestRate": {
                            "type": "number",
                            "example": 13.4,
                            "format": "double",
                            "description": "Specifies the estimated nominal interest rate used in the amortization calculations"
                          },
                          "estimatedMonthlyPayment": {
                            "type": "number",
                            "example": 2980.45,
                            "format": "double",
                            "description": "Specifies the estimated monthly downpayment as a result of the amortization calculations"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "propertyOwnershipShare": {
                            "type": "number",
                            "format": "double",
                            "example": 0.5,
                            "description": "The ownership share of the property in the mortgage."
                          },
                          "originalBalanceByOwnership": {
                            "type": "number",
                            "format": "double",
                            "example": 3000000,
                            "description": "The original balance multiplied by the property ownership share."
                          },
                          "estimatedBalanceByOwnership": {
                            "type": "number",
                            "format": "double",
                            "example": 2000000,
                            "description": "The estimated balance multiplied by the property ownership share."
                          },
                          "adjustedOriginalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 50000000,
                            "description": "The assumed actual original balance of the mortgage."
                          },
                          "balanceSource": {
                            "type": "string",
                            "enum": [
                              "SKATTEETATEN",
                              "KARTVERKET"
                            ],
                            "example": "KARTVERKET",
                            "description": "Specifies which source the originalBalance and estimatedBalance come from."
                          },
                          "lienId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "288863652"
                          },
                          "propertyId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3713739"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "studentDebt": {
              "title": "StudentDebtOverview",
              "type": "object",
              "properties": {
                "sumEstimatedBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "creditorName": {
                            "type": "string",
                            "example": "CREDITOR NAME"
                          },
                          "estimatedBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4107055.83,
                            "description": "An estimate of what the balance might be today."
                          },
                          "originalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4407055.83,
                            "description": "The balance gathered from the data source."
                          },
                          "updatedAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Updated date in the source registry."
                          },
                          "createdAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Created date in the source registry."
                          },
                          "estimatedDuration": {
                            "type": "number",
                            "example": 260,
                            "description": "Specifies the estimated duration in months used in the amortization calculations"
                          },
                          "estimatedRemainingDuration": {
                            "type": "number",
                            "example": 180,
                            "description": "Specifies the estimated remaining duration in months of the loan"
                          },
                          "estimatedNominalInterestRate": {
                            "type": "number",
                            "example": 13.4,
                            "format": "double",
                            "description": "Specifies the estimated nominal interest rate used in the amortization calculations"
                          },
                          "estimatedMonthlyPayment": {
                            "type": "number",
                            "example": 2980.45,
                            "format": "double",
                            "description": "Specifies the estimated monthly downpayment as a result of the amortization calculations"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "balanceSource": {
                            "type": "string",
                            "enum": [
                              "SKATTEETATEN"
                            ],
                            "example": "SKATTEETATEN",
                            "description": "Specifies which source the originalBalance and estimatedBalance come from."
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "autoDebt": {
              "title": "AutoDebtOverview",
              "type": "object",
              "properties": {
                "sumEstimatedBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "creditorName": {
                            "type": "string",
                            "example": "CREDITOR NAME"
                          },
                          "estimatedBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4107055.83,
                            "description": "An estimate of what the balance might be today."
                          },
                          "originalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4407055.83,
                            "description": "The balance gathered from the data source."
                          },
                          "updatedAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Updated date in the source registry."
                          },
                          "createdAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Created date in the source registry."
                          },
                          "estimatedDuration": {
                            "type": "number",
                            "example": 260,
                            "description": "Specifies the estimated duration in months used in the amortization calculations"
                          },
                          "estimatedRemainingDuration": {
                            "type": "number",
                            "example": 180,
                            "description": "Specifies the estimated remaining duration in months of the loan"
                          },
                          "estimatedNominalInterestRate": {
                            "type": "number",
                            "example": 13.4,
                            "format": "double",
                            "description": "Specifies the estimated nominal interest rate used in the amortization calculations"
                          },
                          "estimatedMonthlyPayment": {
                            "type": "number",
                            "example": 2980.45,
                            "format": "double",
                            "description": "Specifies the estimated monthly downpayment as a result of the amortization calculations"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "registrationNumber": {
                            "type": "string",
                            "example": "BP22352",
                            "description": "The registration number of the vehicle."
                          },
                          "balanceSource": {
                            "type": "string",
                            "enum": [
                              "SKATTEETATEN",
                              "LOSOREREGISTERET"
                            ],
                            "example": "LOSOREREGISTERET",
                            "description": "Specifies which source the originalBalance and estimatedBalance come from."
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "unsecuredDebt": {
              "title": "UnsecuredDebtOverview",
              "type": "object",
              "properties": {
                "sumBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "sumCreditLimit": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "example": "CREDIT_FACILITY",
                        "enum": [
                          "CREDIT_FACILITY",
                          "CHARGE_CARD",
                          "REPAYMENT_LOAN"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "example": "2019-09-07T15:50+00Z",
                        "description": "Created date in the source registry."
                      },
                      "updatedAt": {
                        "type": "string",
                        "example": "2019-09-07T15:50+00Z",
                        "description": "Created date in the source registry."
                      },
                      "creditorOrgNumber": {
                        "type": "string",
                        "example": "983521592",
                        "description": "Organization number of the creditor"
                      },
                      "creditorName": {
                        "type": "string",
                        "example": "SANTANDER CONSUMER BANK AS",
                        "description": "Name of the creditor"
                      },
                      "coBorrower": {
                        "type": "string",
                        "enum": [
                          "HAS_CO_BORROWER",
                          "NO_CO_BORROWER",
                          "IS_CO_BORROWER"
                        ],
                        "example": "HAS_CO_BORROWER",
                        "description": "Specifies the coborrower status. HAS_CO_BORROWER means the loan has a co-borrower, NO_CO_BORROWER means there are no co-borrowers, IS_CO_BORROWER means the applicant is a co-borrower of this loan."
                      },
                      "balance": {
                        "type": "number",
                        "example": 400000,
                        "description": "Outstanding balance of the loan."
                      },
                      "originalBalance": {
                        "type": "number",
                        "example": 400000,
                        "description": "Applies only to type REPAYMENT_LOAN"
                      },
                      "creditLimit": {
                        "type": "number",
                        "example": 30000,
                        "description": "Applies only to type CREDIT_FACILITY"
                      },
                      "installmentCharges": {
                        "type": "number",
                        "example": 40
                      },
                      "installmentChargePeriod": {
                        "type": "string",
                        "enum": [
                          "MONTHLY",
                          "QUARTERLY",
                          "HALF_YEARLY",
                          "YEARLY"
                        ],
                        "example": "MONTHLY"
                      },
                      "interestBearingBalance": {
                        "type": "number",
                        "example": 55000
                      },
                      "nonInterestBearingBalance": {
                        "type": "number",
                        "example": 20000
                      },
                      "nomInterestRate": {
                        "type": "number",
                        "format": "double",
                        "example": 12.3
                      },
                      "paymentsPerYear": {
                        "type": "number",
                        "example": 12
                      },
                      "duration": {
                        "type": "number",
                        "example": 12,
                        "description": "Applies only to type REPAYMENT_LOAN"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "income": {
          "type": "object",
          "title": "IncomeOverview",
          "properties": {
            "yearlyGrossIncome": {
              "type": "number",
              "format": "double",
              "example": 1010000
            },
            "yearlyNetIncome": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyDrivingAllowance": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyBonus": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlySalary": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyWage": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlySicknessAllowance": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyDisabilityPension": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyPension": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyUnemploymentBenefit": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "yearlyWorkAssessmentAllowance": {
              "type": "number",
              "format": "double",
              "example": 650000
            },
            "monthlyIncomeRecords": {
              "type": "array",
              "items": {
                "title": "MonthlyIncomeRecord",
                "type": "object",
                "properties": {
                  "grossIncome": {
                    "type": "number",
                    "format": "double"
                  },
                  "netIncome": {
                    "type": "number",
                    "format": "double"
                  },
                  "date": {
                    "type": "string",
                    "format": "YYYY-MM"
                  }
                }
              },
              "example": [
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-02"
                },
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-03"
                },
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-04"
                },
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-05"
                },
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-06"
                },
                {
                  "grossIncome": 30000,
                  "netIncome": 30000,
                  "date": "2019-07"
                }
              ]
            },
            "taxRecords": {
              "type": "array",
              "description": "Sorted by key \"taxYear\" in descending order",
              "items": {
                "title": "TaxRecord",
                "type": "object",
                "properties": {
                  "taxYear": {
                    "type": "string",
                    "example": "2018"
                  },
                  "yearlyGrossIncome": {
                    "type": "number",
                    "format": "double",
                    "example": 936618
                  },
                  "yearlySalary": {
                    "type": "number",
                    "format": "double",
                    "example": 936616
                  },
                  "yearlyRentalIncome": {
                    "type": "number",
                    "format": "double",
                    "example": 10000
                  },
                  "yearlyEstimatedTax": {
                    "type": "number",
                    "format": "double",
                    "example": 273562.23
                  },
                  "yearlyEstimatedNetIncome": {
                    "type": "number",
                    "format": "double",
                    "example": 663055.77
                  },
                  "employers": {
                    "type": "array",
                    "items": {
                      "title": "Employer",
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Min Jobb AS"
                        },
                        "orgID": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "example": "123456789"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "title": "PersonWithoutConsent",
      "type": "object",
      "description": "Returns data for a person where consent is not a requirement.",
      "properties": {
        "ssn": {
          "type": "string",
          "example": "01029413157"
        },
        "firstName": {
          "type": "string",
          "example": "STOR"
        },
        "lastName": {
          "type": "string",
          "example": "MÅNE"
        },
        "maritalStatus": {
          "type": "string",
          "enum": [
            "MARRIED",
            "NOT_GIVEN",
            "UNMARRIED",
            "DIVORCED",
            "SEPARATED",
            "WIDOW_ER",
            "REGISTERED_PARTNER",
            "SEPARATED_PARTNER",
            "DIVORCED_PARTNER",
            "REMAINING_PARTNER"
          ]
        },
        "citizenships": {
          "type": "array",
          "items": {
            "title": "Citizenship",
            "type": "object",
            "properties": {
              "citizenship": {
                "type": "string",
                "example": "NOR"
              },
              "isApplicable": {
                "type": "boolean",
                "example": true,
                "description": "maps to 'erGjeldende' in the original response"
              }
            }
          }
        },
        "gender": {
          "type": "string",
          "example": "MALE",
          "enum": [
            "MALE",
            "FEMALE",
            "UNKNOWN"
          ]
        },
        "birthdate": {
          "type": "string",
          "format": "YYYY-MM-DD",
          "example": "1982-02-21"
        },
        "countryOfBirth": {
          "type": "string",
          "example": "NOR"
        },
        "status": {
          "type": "string",
          "example": "RESIDENT",
          "description": "The current status of the person in the Norwegian Population Registry",
          "enum": [
            "RESIDENT",
            "RELOCATED",
            "DISAPPEARED",
            "DISEASED",
            "CEASED",
            "REGISTERED_BY_BIRTH",
            "TEMPORARY",
            "INACTIVE",
            "NON_RESIDENT",
            "ACTIVE",
            "UNKNOWN"
          ]
        },
        "hasAttachmentCharge": {
          "type": "boolean",
          "example": true,
          "description": "Searches through the movables registry (løsøre) to find active attachment charges (UTLEGG/UTPANTING)."
        },
        "residentialAddress": {
          "type": [
            "object",
            "null"
          ],
          "title": "ResidentialAddress",
          "description": "The persons Norwegian residential address. May be null, if the person is living in a foreign country.",
          "properties": {
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "example": "2019-09-16T22:14:45.624Z"
            },
            "street": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Rudvegen"
                },
                "number": {
                  "type": "string",
                  "example": "57"
                },
                "letter": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "example": "A"
                }
              }
            },
            "municipality": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "NESBYEN"
                },
                "number": {
                  "type": "string",
                  "example": "3540"
                }
              }
            }
          }
        },
        "family": {
          "type": "object",
          "properties": {
            "numChildrenBelowAge18": {
              "type": "integer",
              "description": "Number of persons in the family that are below 18 years of age"
            },
            "members": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ssn": {
                    "type": "string",
                    "example": "03028711300",
                    "description": "11 digit identification number of the person."
                  },
                  "age": {
                    "type": "integer",
                    "example": 34
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "FEMALE",
                      "MALE"
                    ]
                  },
                  "relation": {
                    "type": "string",
                    "enum": [
                      "PARENT",
                      "SPOUSE_OR_PARTNER",
                      "CHILD",
                      "SIBLING"
                    ],
                    "description": "The persons relation to the family member."
                  }
                }
              }
            }
          }
        },
        "property": {
          "type": "object",
          "title": "PropertyOverview",
          "description": "Aggregation of Kartverket API and Eiendomsverdi API",
          "properties": {
            "ownsProperty": {
              "type": "boolean",
              "example": true
            },
            "properties": {
              "type": "array",
              "items": {
                "type": "object",
                "title": "Property",
                "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                    "SelfOwnedProperty": "./SelfOwnedProperty.yaml",
                    "HousingCooperative": "./HousingCooperative.yaml"
                  }
                },
                "anyOf": [
                  {
                    "type": "object",
                    "title": "SelfOwnedProperty",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "039456312"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "SELF_OWNED",
                          "HOUSING_COOPERATIVE"
                        ],
                        "example": "SELF_OWNED"
                      },
                      "value": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimateHaircut": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "commonDebt": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "netValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "grossValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "areaMarketScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "municipalityScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "customerApprovedValue": {
                        "type": "integer",
                        "example": 20
                      },
                      "valueEstimateAccuracyLevel": {
                        "type": "number",
                        "format": "double",
                        "example": 4
                      },
                      "purchasedAt": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2019-09-16T22:14:45.624Z"
                      },
                      "cadastralUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "7"
                      },
                      "propertyUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "391"
                      },
                      "leaseholdNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "condominiumUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "ownershipShare": {
                        "type": "number",
                        "example": 0.5
                      },
                      "estateType": {
                        "type": "string",
                        "enum": [
                          "APARTMENT",
                          "DETACHED_HOUSE",
                          "TERRACED_HOUSE",
                          "SEMI_DETACHED_HOUSE",
                          "LEISURE_HOME",
                          "DORM",
                          "RESIDENTIAL_PLOT",
                          "CABIN_PLOT",
                          "SCHOOL_KINDERGARTEN",
                          "COMMERCIAL_BUILDING",
                          "FARM",
                          "HOUSING",
                          "HOUSE",
                          "SHARED_HOUSING",
                          "GARAGE",
                          "UNDEVELOPED",
                          "PUBLIC",
                          "HEALTH",
                          "MEDIA_COMM",
                          "CULTURE_AND_SPORTS",
                          "RELIGION",
                          "TRANSPORTATION",
                          "OTHER",
                          "UNKNOWN"
                        ],
                        "example": "DETACHED_HOUSE"
                      },
                      "street": {
                        "title": "Street",
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Smedstusvingen"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "18"
                          },
                          "letter": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "A"
                          }
                        }
                      },
                      "zip": {
                        "title": "Zip",
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "1480"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "SLATTUM"
                          }
                        }
                      },
                      "municipality": {
                        "title": "Municipality",
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3031"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "NITTEDAL"
                          }
                        }
                      },
                      "liens": {
                        "type": "array",
                        "items": {
                          "title": "Lien",
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "039456312"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "example": "2019-09-16T22:14:45.624Z"
                            },
                            "creditorName": {
                              "type": "string",
                              "example": "SPAREBANKEN TELEMARK"
                            },
                            "creditorOrgNumber": {
                              "type": "string",
                              "example": "985621551"
                            },
                            "value": {
                              "type": "number",
                              "example": 4500000
                            }
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "HousingCooperative",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "039456312"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "SELF_OWNED",
                          "HOUSING_COOPERATIVE"
                        ],
                        "example": "SELF_OWNED"
                      },
                      "value": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "valueEstimateHaircut": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "commonDebt": {
                        "type": "number",
                        "format": "double",
                        "example": 5000000
                      },
                      "netValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "grossValueEstimate": {
                        "type": "number",
                        "format": "double",
                        "example": 2000000
                      },
                      "areaMarketScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "municipalityScore": {
                        "type": "integer",
                        "example": 20,
                        "minimum": 1,
                        "maximum": 20
                      },
                      "customerApprovedValue": {
                        "type": "integer",
                        "example": 20
                      },
                      "valueEstimateAccuracyLevel": {
                        "type": "number",
                        "format": "double",
                        "example": 4
                      },
                      "purchasedAt": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2019-09-16T22:14:45.624Z"
                      },
                      "cadastralUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "7"
                      },
                      "propertyUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "391"
                      },
                      "leaseholdNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "condominiumUnitNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "example": "0"
                      },
                      "ownershipShare": {
                        "type": "number",
                        "example": 0.5
                      },
                      "estateType": {
                        "type": "string",
                        "enum": [
                          "APARTMENT",
                          "DETACHED_HOUSE",
                          "TERRACED_HOUSE",
                          "SEMI_DETACHED_HOUSE",
                          "LEISURE_HOME",
                          "DORM",
                          "RESIDENTIAL_PLOT",
                          "CABIN_PLOT",
                          "SCHOOL_KINDERGARTEN",
                          "COMMERCIAL_BUILDING",
                          "FARM",
                          "HOUSING",
                          "HOUSE",
                          "SHARED_HOUSING",
                          "GARAGE",
                          "UNDEVELOPED",
                          "PUBLIC",
                          "HEALTH",
                          "MEDIA_COMM",
                          "CULTURE_AND_SPORTS",
                          "RELIGION",
                          "TRANSPORTATION",
                          "OTHER",
                          "UNKNOWN"
                        ],
                        "example": "DETACHED_HOUSE"
                      },
                      "street": {
                        "title": "Street",
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Smedstusvingen"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "18"
                          },
                          "letter": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "A"
                          }
                        }
                      },
                      "zip": {
                        "title": "Zip",
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "1480"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "SLATTUM"
                          }
                        }
                      },
                      "municipality": {
                        "title": "Municipality",
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3031"
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "NITTEDAL"
                          }
                        }
                      },
                      "housingCooperative": {
                        "title": "HousingCooperativeInformation",
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "5424543"
                          },
                          "name": {
                            "type": "string",
                            "example": "TERTITTEN BORETTSLAG"
                          },
                          "orgID": {
                            "type": "string",
                            "example": "12345678911"
                          },
                          "shareNumber": {
                            "type": "string",
                            "example": 25
                          }
                        }
                      },
                      "liens": {
                        "type": "array",
                        "items": {
                          "title": "Lien",
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "039456312"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "example": "2019-09-16T22:14:45.624Z"
                            },
                            "creditorName": {
                              "type": "string",
                              "example": "SPAREBANKEN TELEMARK"
                            },
                            "creditorOrgNumber": {
                              "type": "string",
                              "example": "985621551"
                            },
                            "value": {
                              "type": "number",
                              "example": 4500000
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "debt": {
          "type": "object",
          "properties": {
            "sumEstimatedBalance": {
              "type": "number",
              "format": "double",
              "example": 40000000
            },
            "sumOriginalBalance": {
              "type": "number",
              "format": "double",
              "example": 60000000
            },
            "mortgageDebt": {
              "title": "MortgageDebtOverview",
              "type": "object",
              "properties": {
                "sumEstimatedBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "creditorName": {
                            "type": "string",
                            "example": "CREDITOR NAME"
                          },
                          "estimatedBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4107055.83,
                            "description": "An estimate of what the balance might be today."
                          },
                          "originalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4407055.83,
                            "description": "The balance gathered from the data source."
                          },
                          "updatedAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Updated date in the source registry."
                          },
                          "createdAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Created date in the source registry."
                          },
                          "estimatedDuration": {
                            "type": "number",
                            "example": 260,
                            "description": "Specifies the estimated duration in months used in the amortization calculations"
                          },
                          "estimatedRemainingDuration": {
                            "type": "number",
                            "example": 180,
                            "description": "Specifies the estimated remaining duration in months of the loan"
                          },
                          "estimatedNominalInterestRate": {
                            "type": "number",
                            "example": 13.4,
                            "format": "double",
                            "description": "Specifies the estimated nominal interest rate used in the amortization calculations"
                          },
                          "estimatedMonthlyPayment": {
                            "type": "number",
                            "example": 2980.45,
                            "format": "double",
                            "description": "Specifies the estimated monthly downpayment as a result of the amortization calculations"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "adjustedOriginalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 50000000,
                            "description": "The assumed actual original balance of the mortgage."
                          },
                          "balanceSource": {
                            "type": "string",
                            "enum": [
                              "KARTVERKET"
                            ],
                            "example": "KARTVERKET",
                            "description": "Specifies which source the originalBalance and estimatedBalance come from."
                          },
                          "lienId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "288863652"
                          },
                          "propertyId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "3713739"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "autoDebt": {
              "title": "AutoDebtOverview",
              "type": "object",
              "properties": {
                "sumEstimatedBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "creditorName": {
                            "type": "string",
                            "example": "CREDITOR NAME"
                          },
                          "estimatedBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4107055.83,
                            "description": "An estimate of what the balance might be today."
                          },
                          "originalBalance": {
                            "type": "number",
                            "format": "double",
                            "example": 4407055.83,
                            "description": "The balance gathered from the data source."
                          },
                          "updatedAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Updated date in the source registry."
                          },
                          "createdAt": {
                            "type": "string",
                            "example": "2019-09-07T15:50+00Z",
                            "description": "Created date in the source registry."
                          },
                          "estimatedDuration": {
                            "type": "number",
                            "example": 260,
                            "description": "Specifies the estimated duration in months used in the amortization calculations"
                          },
                          "estimatedRemainingDuration": {
                            "type": "number",
                            "example": 180,
                            "description": "Specifies the estimated remaining duration in months of the loan"
                          },
                          "estimatedNominalInterestRate": {
                            "type": "number",
                            "example": 13.4,
                            "format": "double",
                            "description": "Specifies the estimated nominal interest rate used in the amortization calculations"
                          },
                          "estimatedMonthlyPayment": {
                            "type": "number",
                            "example": 2980.45,
                            "format": "double",
                            "description": "Specifies the estimated monthly downpayment as a result of the amortization calculations"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "registrationNumber": {
                            "type": "string",
                            "example": "BP22352",
                            "description": "The registration number of the vehicle."
                          },
                          "balanceSource": {
                            "type": "string",
                            "enum": [
                              "LOSOREREGISTERET"
                            ],
                            "example": "LOSOREREGISTERET",
                            "description": "Specifies which source the originalBalance and estimatedBalance come from."
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "unsecuredDebt": {
              "title": "UnsecuredDebtOverview",
              "type": "object",
              "properties": {
                "sumBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 40000000
                },
                "sumOriginalBalance": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "sumCreditLimit": {
                  "type": "number",
                  "format": "double",
                  "example": 60000000
                },
                "debts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "example": "CREDIT_FACILITY",
                        "enum": [
                          "CREDIT_FACILITY",
                          "CHARGE_CARD",
                          "REPAYMENT_LOAN"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "example": "2019-09-07T15:50+00Z",
                        "description": "Created date in the source registry."
                      },
                      "updatedAt": {
                        "type": "string",
                        "example": "2019-09-07T15:50+00Z",
                        "description": "Created date in the source registry."
                      },
                      "creditorOrgNumber": {
                        "type": "string",
                        "example": "983521592",
                        "description": "Organization number of the creditor"
                      },
                      "creditorName": {
                        "type": "string",
                        "example": "SANTANDER CONSUMER BANK AS",
                        "description": "Name of the creditor"
                      },
                      "coBorrower": {
                        "type": "string",
                        "enum": [
                          "HAS_CO_BORROWER",
                          "NO_CO_BORROWER",
                          "IS_CO_BORROWER"
                        ],
                        "example": "HAS_CO_BORROWER",
                        "description": "Specifies the coborrower status. HAS_CO_BORROWER means the loan has a co-borrower, NO_CO_BORROWER means there are no co-borrowers, IS_CO_BORROWER means the applicant is a co-borrower of this loan."
                      },
                      "balance": {
                        "type": "number",
                        "example": 400000,
                        "description": "Outstanding balance of the loan."
                      },
                      "originalBalance": {
                        "type": "number",
                        "example": 400000,
                        "description": "Applies only to type REPAYMENT_LOAN"
                      },
                      "creditLimit": {
                        "type": "number",
                        "example": 30000,
                        "description": "Applies only to type CREDIT_FACILITY"
                      },
                      "installmentCharges": {
                        "type": "number",
                        "example": 40
                      },
                      "installmentChargePeriod": {
                        "type": "string",
                        "enum": [
                          "MONTHLY",
                          "QUARTERLY",
                          "HALF_YEARLY",
                          "YEARLY"
                        ],
                        "example": "MONTHLY"
                      },
                      "interestBearingBalance": {
                        "type": "number",
                        "example": 55000
                      },
                      "nonInterestBearingBalance": {
                        "type": "number",
                        "example": 20000
                      },
                      "nomInterestRate": {
                        "type": "number",
                        "format": "double",
                        "example": 12.3
                      },
                      "paymentsPerYear": {
                        "type": "number",
                        "example": 12
                      },
                      "duration": {
                        "type": "number",
                        "example": 12,
                        "description": "Applies only to type REPAYMENT_LOAN"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```
