Skip to content

API reference

Account API

What the key can reach, where each Redact layer processes text, the NER places and models a call may choose, and the limits.

Base URL
https://api.komplai.dk

Read what this key can reach

GET /v1/access

Lists the services this key reaches in its organisation, with their scopes, hosting, processing and limits. Call it first: for Redact, hosting.processing.layers names where each layer processes text, text_contract the options and limits that apply, and text_contract.jobs_accepting_submissions whether text jobs are accepted. Works for personal keys and for organisation integration keys, which reach Redact only; an organisation integration key's response also names the integration in principal. It sends no text, runs no model and counts as one request. services[].edition is deprecated and is always "custom"; read scopes and processing instead.

Scopes
access:read
Try it

Calls are real: komplai processes what you send, each call counts towards your key's limits, and processing in EU cloud counts towards your organisation's monthly AI spending cap. Use test data.

A key that starts with kp_org_ or kp_live_. It stays on this page until you leave it and is sent only to api.komplai.dk.

Responses

200 OK

What this key can reach, where each Redact layer processes text, and the limits.

Headers

  • Request-Id string required

    This request's id: your X-Request-Id when you sent one valid UUID, otherwise a new UUID. An error body repeats it as request_id.

    Format
    uuid

Body

  • organisation_id string required
    Format
    uuid
  • principal object

    Only for an organisation integration key: the integration that owns it. A personal key's answer has no principal.

    Child fields (3)
    • type string required
      One of
      integration
    • integration_id string required
      Format
      uuid
    • name any required

      The integration's name. A string, or null.

  • scopes string[] required

    Every scope the key has.

  • services object[] required
    Child fields (62)
    • service string required

      redact for an organisation integration key. A personal key can also reach chat, decide and mcp.

    • edition string required deprecated

      Always custom. Read scopes and processing instead.

      One of
      custom
    • scopes string[] required

      This key's scopes for the service.

    • hosting object required

      Where the service runs. For Redact, processing.layers names where each layer processes text.

      Child fields (41)
      • id string
      • environment string
      • shared boolean
      • api object
        Child fields (3)
        • provider string
        • name string
        • region string
      • processing object
        Child fields (33)
        • kind string

          per-layer for Redact.

        • provider string
        • layers object[]

          Redact: one entry per layer and processing choice. The eu-cloud entry appears only when your organisation has an EU route.

          Child fields (30)
          • detector string required

            The detectors value this layer serves.

            One of
            regex ner llm
          • processing string required

            The processing value that selects this layer.

            One of
            local eu-cloud
          • provider string required
            One of
            komplai
          • location string required

            Where the layer processes text, for example EU · Germany or Local infrastructure · Denmark. For ner: its default place.

          • configured boolean required

            Whether the layer is set up for you now. It reports setup, not live health.

          • ner_deployment string

            ner: the place NER runs when a request names none. Missing when the server has no default place set up: then configured is false, no place has default true, and a request must name its place.

            One of
            eu-de local
          • places object[]

            ner: every place NER can run, with whether a run can use it now. Send one as nerDeployment.

            Child fields (8)
            • id string required

              The value for nerDeployment.

              One of
              eu-de local
            • location string required

              Where NER processes text there: EU · Germany or Local infrastructure · Denmark.

            • available boolean required

              Whether a text operation with detectors can use the place now. While more than one place is set up, this is the answer of a health check made in the last 30 seconds.

            • reason string required nullable

              null when available. unconfigured: komplai has not switched the place on for the API. unavailable: it is set up but did not answer its health check. not_allowed: your organisation does not allow local processing through the API, and NER on local infrastructure is local processing (403 processing_choice_not_allowed).

              One of
              unconfigured unavailable not_allowed
            • default boolean required

              Where NER runs when a request names no place.

            • detect object required

              The same for POST /v1/redact/detect and the text operations without detectors, which run NER through another komplai service that reaches each place with its own settings. A place can be available for one and not the other.

              Child fields (2)
              • available boolean required

                Whether those operations can use the place now.

              • reason string required nullable

                null when available. unconfigured: the place is not switched on for them. unavailable: it is set up but did not answer its health check. not_allowed: as for the operations with detectors.

                One of
                unconfigured unavailable not_allowed
          • models object[]

            ner: the NER models you may choose (nerModel). llm: the language models at this processing (model), including models that are not validated for Redact, which cannot be chosen. The eu-cloud entry lists models only while your organisation's EU route is enabled.

            One of

            • object
              • id string required

                The value for nerModel.

              • name string required
              • status string required
                One of
                stable beta alpha
              • default boolean required

                The model a run uses when it names none.

              • places string[] required

                The places the model runs at.

                Each item is one of
                eu-de local
            • object
              • id string required

                The value for model.

              • name string required
              • available boolean required

                Whether a run can name the model now.

              • reason string required nullable

                null when available. not_validated: not validated for Redact, so it cannot be chosen. not_offered: validated, but not offered right now. unreachable: the list of local models could not be read. unconfigured: the place is not set up.

                One of
                not_validated not_offered unreachable unconfigured
              • default boolean required

                The model a run uses here when it names none.

          • available boolean

            llm with processing local: whether a local model can run Redact now.

          • reason string nullable

            llm with processing local: null when available, else why not.

            One of
            unconfigured unreachable not_offered
    • processing object required

      What the organisation's agreement allows for this service.

      Child fields (14)
      • data_mode string

        synthetic: use test data only. personal: personal data under the agreement in agreement_reference.

        One of
        synthetic personal
      • agreement_reference any

        The data processing agreement that covers personal data. A string, or null.

      • modes string[]
      • text_contract object

        Redact with redact:process: the request options and limits that apply to this key.

        Child fields (9)
        • supported_engines string[]

          pipeline, plus agentic for a person whose organisation has the preview.

        • detector_choices string[]
          Each item is one of
          regex ner llm
        • local_configured_detectors string[]

          The layers set up on local infrastructure now.

          Each item is one of
          regex ner llm
        • default_mode string
        • default_processing string
          One of
          local
        • synchronous_max_utf16_chars integer
        • job_max_utf16_chars integer
        • file_input object

          PDF and Word input (beta). Missing when it is switched off.

          Can hold fields that are not listed here.

        • jobs_accepting_submissions boolean

          Whether POST /v1/redact/jobs accepts text jobs now.

      • storage object

        What is stored, and for how long.

        Can hold fields that are not listed here.

    • limits object required
      Child fields (1)
      • requests_per_minute integer

        Requests per minute for the service: per person for a personal key, shared with that person's other keys and use of the hub; per integration for an organisation integration key, shared by its keys and kept across rotation.

  • hosting object

    Only when the key reaches one service: a summary of its hosting.

    Child fields (21)
    • id string
    • environment string
    • shared boolean
    • api object
      Child fields (3)
      • provider string
      • name string
      • region string
    • ner object

      Redact: where NER runs when a request names no place, and every place with whether a run can use it now. The same places as the ner layer in services[].hosting.processing.layers. Missing when the server has no default place set up.

      Child fields (13)
      • provider string required
        One of
        komplai
      • name string required
      • region string required

        The default place's location: EU · Germany or Local infrastructure · Denmark.

      • deployment string required

        The default place: the nerDeployment a request gets when it names none.

        One of
        eu-de local
      • places object[] required
        Child fields (8)
        • id string required

          The value for nerDeployment.

          One of
          eu-de local
        • location string required

          Where NER processes text there: EU · Germany or Local infrastructure · Denmark.

        • available boolean required

          Whether a text operation with detectors can use the place now. While more than one place is set up, this is the answer of a health check made in the last 30 seconds.

        • reason string required nullable

          null when available. unconfigured: komplai has not switched the place on for the API. unavailable: it is set up but did not answer its health check. not_allowed: your organisation does not allow local processing through the API, and NER on local infrastructure is local processing (403 processing_choice_not_allowed).

          One of
          unconfigured unavailable not_allowed
        • default boolean required

          Where NER runs when a request names no place.

        • detect object required

          The same for POST /v1/redact/detect and the text operations without detectors, which run NER through another komplai service that reaches each place with its own settings. A place can be available for one and not the other.

          Child fields (2)
          • available boolean required

            Whether those operations can use the place now.

          • reason string required nullable

            null when available. unconfigured: the place is not switched on for them. unavailable: it is set up but did not answer its health check. not_allowed: as for the operations with detectors.

            One of
            unconfigured unavailable not_allowed
  • processing object

    Only when the key reaches one service.

    Child fields (1)
    • data_mode string
      One of
      synthetic personal
  • limits object required
    Child fields (3)
    • requests_per_minute integer

      Only when the key reaches one service. Requests per minute for the service: per person for a personal key, shared with that person's other keys and use of the hub; per integration for an organisation integration key, shared by its keys and kept across rotation.

    • organisation_requests_per_minute integer
    • shared_requests_per_minute integer
401 Unauthorized

The key is missing or not valid.

Error codes

  • api_key_required No Authorization: Bearer header with a komplai key.
  • invalid_api_key The key is unknown, expired, revoked or retired, the person behind a personal key is no longer a member or no longer assigned any app the key covers, or your organisation's API access for it is not set up or no longer active.
  • invalid_token The key was revoked or expired, or its access ended, while the request was admitted or processed.

Headers

  • Request-Id string required

    This request's id: your X-Request-Id when you sent one valid UUID, otherwise a new UUID. An error body repeats it as request_id.

    Format
    uuid
403 Forbidden

The key may not do this, or the organisation's access does not cover it.

Error codes

  • insufficient_scope The key lacks a scope the operation needs (x-komplai-scopes): it was not issued or created with it, its person is no longer assigned the app, or the organisation's processing approval no longer covers it.
  • identity_retired The person behind a personal key has been removed from komplai.

Headers

  • Request-Id string required

    This request's id: your X-Request-Id when you sent one valid UUID, otherwise a new UUID. An error body repeats it as request_id.

    Format
    uuid
429 Too Many Requests

Refused for now. Wait the seconds in Retry-After before you try again.

Error codes

  • rate_limited Too many requests: the per-minute limit of the person behind a personal key (shared with that person's other keys and use of the hub) or of the integration behind an organisation integration key (shared by its keys), the organisation's (120), the API's (300) or the per-IP network limit. Wait Retry-After seconds.

Headers

  • Request-Id string required

    This request's id: your X-Request-Id when you sent one valid UUID, otherwise a new UUID. An error body repeats it as request_id.

    Format
    uuid
  • Retry-After integer required

    Seconds to wait before trying again (at most 60).

    Value
    1 to 60
  • x-ratelimit-limit integer

    Requests per minute allowed from your IP address (the per-IP network limit).

  • x-ratelimit-remaining integer

    Requests left in the current minute from your IP address.

  • x-ratelimit-reset integer

    Seconds until the per-IP window resets.

503 Service Unavailable

Processing is not available right now.

Error codes

Headers

  • Request-Id string required

    This request's id: your X-Request-Id when you sent one valid UUID, otherwise a new UUID. An error body repeats it as request_id.

    Format
    uuid
RequestGET /v1/access
curl
curl https://api.komplai.dk/v1/access \
  -H "Authorization: Bearer $KOMPLAI_TOKEN"
PowerShell
$headers = @{
    Authorization = "Bearer $env:KOMPLAI_TOKEN"
}

$request = @{
    Method = 'Get'
    Uri = 'https://api.komplai.dk/v1/access'
    Headers = $headers
}
$response = Invoke-RestMethod @request
$response | ConvertTo-Json -Depth 100
Python
import os

import requests

response = requests.get(
    "https://api.komplai.dk/v1/access",
    headers={
        "Authorization": f"Bearer {os.environ['KOMPLAI_TOKEN']}",
    },
    timeout=330,
)
print(response.status_code, response.headers.get("Request-Id"))
print(response.json())
JavaScript
const response = await fetch("https://api.komplai.dk/v1/access", {
  headers: {
    Authorization: `Bearer ${process.env.KOMPLAI_TOKEN}`,
  },
});

console.log(response.status, response.headers.get("Request-Id"));
console.log(await response.json());
C#
using System;
using System.Net.Http;
using System.Net.Http.Headers;

using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(330) };
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.komplai.dk/v1/access");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("KOMPLAI_TOKEN"));

using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
if (response.Headers.TryGetValues("Request-Id", out var requestId))
{
    Console.WriteLine(string.Join(", ", requestId));
}
Console.WriteLine(await response.Content.ReadAsStringAsync());

Set the environment variable KOMPLAI_TOKEN to your key first.

Response
200 OK
{
  "organisation_id": "5b0d6c2e-8f3a-4d1b-9c7e-2a4f6b8d0e13",
  "principal": {
    "type": "integration",
    "integration_id": "7a9c1e3f-5b7d-4f9a-8c2e-4d6f8a0b2c4e",
    "name": "Sagsbehandlingsrobot"
  },
  "scopes": ["access:read", "redact:detect", "redact:process"],
  "services": [
    {
      "service": "redact",
      "edition": "custom",
      "scopes": ["access:read", "redact:detect", "redact:process"],
      "hosting": {
        "id": "komplai-local",
        "environment": "prod",
        "shared": true,
        "api": {
          "provider": "komplai",
          "name": "Komplai EU cloud",
          "region": "EU · Germany"
        },
        "processing": {
          "kind": "per-layer",
          "provider": "komplai",
          "layers": [
            {
              "detector": "regex",
              "processing": "local",
              "provider": "komplai",
              "location": "EU · Germany",
              "configured": true
            },
            {
              "detector": "ner",
              "processing": "local",
              "provider": "komplai",
              "location": "EU · Germany",
              "configured": true,
              "ner_deployment": "eu-de",
              "places": [
                {
                  "id": "eu-de",
                  "location": "EU · Germany",
                  "available": true,
                  "reason": null,
                  "default": true,
                  "detect": {
                    "available": true,
                    "reason": null
                  }
                },
                {
                  "id": "local",
                  "location": "Local infrastructure · Denmark",
                  "available": false,
                  "reason": "unconfigured",
                  "default": false,
                  "detect": {
                    "available": false,
                    "reason": "unconfigured"
                  }
                }
              ],
              "models": [
                {
                  "id": "danish-pii-ner-v1.3.0",
                  "name": "Dansk NER 1.3.0",
                  "status": "stable",
                  "default": true,
                  "places": ["eu-de", "local"]
                }
              ]
            },
            {
              "detector": "llm",
              "processing": "local",
              "provider": "komplai",
              "location": "Local infrastructure · Denmark",
              "configured": true,
              "available": true,
              "reason": null,
              "models": [
                {
                  "id": "qwen3.8-27b-q8",
                  "name": "Qwen 3.8 · 27B (Q8)",
                  "available": true,
                  "reason": null,
                  "default": true
                }
              ]
            },
            {
              "detector": "llm",
              "processing": "eu-cloud",
              "provider": "komplai",
              "location": "EU · France",
              "configured": true,
              "models": [
                {
                  "id": "mistral-small-3.2-24b-instruct-2506",
                  "name": "Mistral Small 3.2 (24B)",
                  "available": true,
                  "reason": null,
                  "default": true
                },
                {
                  "id": "qwen3.5-397b-a17b",
                  "name": "Qwen3.5 (397B-A17B)",
                  "available": false,
                  "reason": "not_validated",
                  "default": false
                }
              ]
            }
          ]
        }
      },
      "processing": {
        "data_mode": "synthetic",
        "agreement_reference": null,
        "modes": ["regex", "ner", "semantic"],
        "text_contract": {
          "supported_engines": ["pipeline"],
          "detector_choices": ["regex", "ner", "llm"],
          "explicit_detector_selection": true,
          "true_ner_only": true,
          "local_configured_detectors": ["regex", "ner", "llm"],
          "default_mode": "ner",
          "default_processing": "local",
          "policy": "all-detected",
          "offset_encoding": "utf-16",
          "synchronous_max_utf16_chars": 750000,
          "job_max_utf16_chars": 2000000,
          "file_input": {
            "beta": true,
            "operations": ["POST /v1/redact/file", "POST /v1/redact/file/jobs"],
            "formats": ["pdf", "docx"],
            "max_file_bytes": 52428800,
            "max_pdf_pages": 2000,
            "extraction_timeout_ms": 120000,
            "ocr": false,
            "pages_without_text": "refused unless allowPagesWithoutText",
            "extraction": {
              "step": "file-extraction",
              "processing": "local",
              "provider": "komplai",
              "location": "EU · Germany",
              "storage": "memory",
              "ocr": false,
              "retention": "The file and its extracted text are held in memory while the request runs and are not stored. POST /v1/redact/file/jobs stores the extracted text encrypted as a text job, with that job's retention."
            }
          },
          "result_max_bytes": 33554432,
          "complexity_limits": {
            "candidate_matches_per_utf16_char": 2,
            "candidate_matches_base": 1000,
            "matched_utf16_chars_per_utf16_char": 16,
            "matched_utf16_chars_base": 16000,
            "coreference_work_per_utf16_char": 4,
            "coreference_work_base": 4000,
            "organisation_rule_timeout_base_ms": 5000,
            "organisation_rule_timeout_ns_per_utf16_char_per_rule": 20,
            "organisation_rule_workers_per_process": 2,
            "organisation_rule_queue": false,
            "exceeded_error": "processing_complexity_exceeded"
          },
          "jobs_accepting_submissions": true,
          "semantic_requires_configured_approved_runtime": true,
          "eu_cloud_requires_explicit_selection_and_shared_ai_budget": true
        },
        "storage": {
          "synchronous_input": "transient_processor_memory",
          "synchronous_result": "response_only",
          "job_input": "encrypted_while_queued_or_running",
          "job_result": "encrypted_until_agreed_expiry_or_deletion",
          "result_read_deletes": false,
          "personal_job_storage_policy_required": true,
          "backup_retention": "separate_infrastructure_agreement",
          "usage_and_audit": "metadata_only_separate_retention"
        }
      },
      "limits": {
        "requests_per_minute": 60
      }
    }
  ],
  "hosting": {
    "id": "komplai-local",
    "environment": "prod",
    "shared": true,
    "api": {
      "provider": "komplai",
      "name": "Komplai EU cloud",
      "region": "EU · Germany"
    },
    "ner": {
      "provider": "komplai",
      "name": "Komplai EU cloud",
      "region": "EU · Germany",
      "deployment": "eu-de",
      "places": [
        {
          "id": "eu-de",
          "location": "EU · Germany",
          "available": true,
          "reason": null,
          "default": true,
          "detect": {
            "available": true,
            "reason": null
          }
        },
        {
          "id": "local",
          "location": "Local infrastructure · Denmark",
          "available": false,
          "reason": "unconfigured",
          "default": false,
          "detect": {
            "available": false,
            "reason": "unconfigured"
          }
        }
      ]
    }
  },
  "processing": {
    "data_mode": "synthetic"
  },
  "limits": {
    "requests_per_minute": 60,
    "organisation_requests_per_minute": 120,
    "shared_requests_per_minute": 300
  }
}
401 Unauthorized
{
  "error": "api_key_required",
  "request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
  "doc_url": "https://developers.komplai.dk/errors/api_key_required"
}
403 Forbidden
{
  "error": "insufficient_scope",
  "request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
  "doc_url": "https://developers.komplai.dk/errors/insufficient_scope"
}
429 Too Many Requests
{
  "error": "rate_limited",
  "request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
  "doc_url": "https://developers.komplai.dk/errors/rate_limited"
}
503 Service Unavailable
{
  "error": "access_service_unavailable",
  "request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
  "doc_url": "https://developers.komplai.dk/errors/access_service_unavailable"
}
komplaidevelopers
Contact us

Search the documentation

Use the arrow keys to choose and Enter to open.