Gå til indholdet

API-reference

Konto-API

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

Basisadresse
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
Prøv kaldet

Kaldene er rigtige: komplai behandler det, du sender, hvert kald tæller med i nøglens grænser, og behandling i EU-cloud tæller med i organisationens månedlige loft for AI-forbrug. Brug testdata.

En nøgle, der starter med kp_org_ eller kp_live_. Den bliver på denne side, til du forlader den, og sendes kun til api.komplai.dk.

Svar

200 OK

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

Headere

  • Request-Id string påkrævet

    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 påkrævet
    Format
    uuid
  • principal object

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

    Underfelter (3)
    • type string påkrævet
      En af
      integration
    • integration_id string påkrævet
      Format
      uuid
    • name any påkrævet

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

  • scopes string[] påkrævet

    Every scope the key has.

  • services object[] påkrævet
    Underfelter (62)
    • service string påkrævet

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

    • edition string påkrævet udfases

      Always custom. Read scopes and processing instead.

      En af
      custom
    • scopes string[] påkrævet

      This key's scopes for the service.

    • hosting object påkrævet

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

      Underfelter (41)
      • id string
      • environment string
      • shared boolean
      • api object
        Underfelter (3)
        • provider string
        • name string
        • region string
      • processing object
        Underfelter (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.

          Underfelter (30)
          • detector string påkrævet

            The detectors value this layer serves.

            En af
            regex ner llm
          • processing string påkrævet

            The processing value that selects this layer.

            En af
            local eu-cloud
          • provider string påkrævet
            En af
            komplai
          • location string påkrævet

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

          • configured boolean påkrævet

            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.

            En af
            eu-de local
          • places object[]

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

            Underfelter (8)
            • id string påkrævet

              The value for nerDeployment.

              En af
              eu-de local
            • location string påkrævet

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

            • available boolean påkrævet

              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 påkrævet kan være null

              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).

              En af
              unconfigured unavailable not_allowed
            • default boolean påkrævet

              Where NER runs when a request names no place.

            • detect object påkrævet

              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.

              Underfelter (2)
              • available boolean påkrævet

                Whether those operations can use the place now.

              • reason string påkrævet kan være null

                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.

                En af
                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.

            En af

            • object
              • id string påkrævet

                The value for nerModel.

              • name string påkrævet
              • status string påkrævet
                En af
                stable beta alpha
              • default boolean påkrævet

                The model a run uses when it names none.

              • places string[] påkrævet

                The places the model runs at.

                Hvert element er en af
                eu-de local
            • object
              • id string påkrævet

                The value for model.

              • name string påkrævet
              • available boolean påkrævet

                Whether a run can name the model now.

              • reason string påkrævet kan være null

                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.

                En af
                not_validated not_offered unreachable unconfigured
              • default boolean påkrævet

                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 kan være null

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

            En af
            unconfigured unreachable not_offered
    • processing object påkrævet

      What the organisation's agreement allows for this service.

      Underfelter (14)
      • data_mode string

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

        En af
        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.

        Underfelter (9)
        • supported_engines string[]

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

        • detector_choices string[]
          Hvert element er en af
          regex ner llm
        • local_configured_detectors string[]

          The layers set up on local infrastructure now.

          Hvert element er en af
          regex ner llm
        • default_mode string
        • default_processing string
          En af
          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.

          Kan indeholde felter, der ikke står her.

        • jobs_accepting_submissions boolean

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

      • storage object

        What is stored, and for how long.

        Kan indeholde felter, der ikke står her.

    • limits object påkrævet
      Underfelter (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.

    Underfelter (21)
    • id string
    • environment string
    • shared boolean
    • api object
      Underfelter (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.

      Underfelter (13)
      • provider string påkrævet
        En af
        komplai
      • name string påkrævet
      • region string påkrævet

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

      • deployment string påkrævet

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

        En af
        eu-de local
      • places object[] påkrævet
        Underfelter (8)
        • id string påkrævet

          The value for nerDeployment.

          En af
          eu-de local
        • location string påkrævet

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

        • available boolean påkrævet

          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 påkrævet kan være null

          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).

          En af
          unconfigured unavailable not_allowed
        • default boolean påkrævet

          Where NER runs when a request names no place.

        • detect object påkrævet

          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.

          Underfelter (2)
          • available boolean påkrævet

            Whether those operations can use the place now.

          • reason string påkrævet kan være null

            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.

            En af
            unconfigured unavailable not_allowed
  • processing object

    Only when the key reaches one service.

    Underfelter (1)
    • data_mode string
      En af
      synthetic personal
  • limits object påkrævet
    Underfelter (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.

Fejlkoder

  • 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.

Headere

  • Request-Id string påkrævet

    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.

Fejlkoder

  • 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.

Headere

  • Request-Id string påkrævet

    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.

Fejlkoder

  • 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.

Headere

  • Request-Id string påkrævet

    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 påkrævet

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

    Værdi
    1 til 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.

Fejlkoder

Headere

  • Request-Id string påkrævet

    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
KaldGET /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());

Sæt først miljøvariablen KOMPLAI_TOKEN til din nøgle.

Svar
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
Kontakt os

Søg i dokumentationen

Vælg med piletasterne, og åbn med Enter.