Core concepts

Authentication

Every KYA Pro request needs a bearer token in the Authorization header:

header
Authorization: Bearer <token>

There are two kinds of tokens. Which one you use depends on the endpoint you're calling.

Customer API tokens — kya_live_...

Use for: anything a person or your integration would call — account management, permissions, handoffs, compliance packs, and per-workspace ingest.

Format: starts with kya_live_ (test tokens start with kya_test_).

Scope: every token is tied to one workspace. There is no way to reach another workspace with a kya_live_ token.

How to obtain one

Two ways:

  1. Get your first token at sign-in. When you finish email sign-in via POST /api/v1/accounts/verify, the response includes a token named default. Use it right away or issue a new one.
  2. Issue additional tokens for CI, integrations, or per-service use. You need an existing kya_live_ token:
bash
curl -X POST https://api.veldtlabs.ai/api/v1/accounts/tokens \
  -H "Authorization: Bearer $VELDT_KYA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci-pipeline"}'

Storage rules

  • Treat every kya_live_ token like a password. Never commit it to source control.
  • List existing tokens (name and prefix only — the full secret is never shown again):
bash
curl https://api.veldtlabs.ai/api/v1/accounts/tokens \
  -H "Authorization: Bearer $VELDT_KYA_TOKEN"

Revoke a leaked token:

bash
curl -X DELETE https://api.veldtlabs.ai/api/v1/accounts/tokens/<token_id> \
  -H "Authorization: Bearer $VELDT_KYA_TOKEN"

Ingress tokens — for high-volume collectors

Cloud customers can skip this section — use your kya_live_* token from the Setup section for every endpoint, including ingest. Ingress tokens are for teams running KYA themselves who need faster ingest.

Use for: the event ingest endpoint (POST /api/v1/admin/agents/events/invocation) when you run a shared collector pulling data from many runtime instances. Ingress tokens use a faster path built for sustained ingest.

Format: free-form string set up by the operator via env vars.

Two flavors:

Scoped ingress tokens

Map one token to one workspace. Set up by your operator in the deployment runbook (self-hosted only). Callers just send the token — the server figures out the workspace:

bash
curl -X POST https://api.veldtlabs.ai/api/v1/admin/agents/events/invocation \
  -H "Authorization: Bearer $INGRESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agent_key": "billing.orchestrator", "outcome": "success"}'

Prefer this when you can. No cross-workspace risk — the token IS the workspace.

Fallback ingress token

Single shared token used by any collector. The caller MUST include tenant_id in the request body. Set up by your operator in the deployment runbook.

bash
curl -X POST https://api.veldtlabs.ai/api/v1/admin/agents/events/invocation \
  -H "Authorization: Bearer $INGRESS_FALLBACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tenant_id": "tenant_example",
    "agent_key": "billing.orchestrator",
    "outcome": "success"
  }'

If tenant_id is missing, the request is rejected with 403 (see errors).

Which token do I use?

EndpointToken type
/api/v1/accounts/**kya_live_
/api/v1/admin/agents/events/** (ingest)Ingress token, or kya_live_

The ingest endpoints accept either — pick based on volume and where the caller lives.

Missing or invalid tokens

SituationHTTP statusError code
No Authorization header401unauthorized
Header present, no Bearer prefix401unauthorized
Token doesn't match any known ingress or kya_live_ account401unauthorized
Fallback token used without tenant_id in body403forbidden
Valid token, but account is past trial or subscription lapsed402payment_required
Valid token, but caller isn't an admin on an admin-only endpoint403forbidden

See the errors reference for the full error format.