Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Klokin API keys API
version: 1.0.0
description: 'REST API for the Klokin employee time-tracking platform.
## Authentication
Most endpoints accept a Bearer token in the `Authorization` header — either
a JWT obtained from `POST /v1/auth/login`, or an organization API key
(`klkn_…`) created on the "API raktai" admin page. API keys carry an
explicit permission list; JWT users get their role''s permissions.
## Organization context
Multi-tenant requests resolve the organization from the `X-Organization`
header (organization domain). Super-admin JWTs may operate across
organizations; everyone else is scoped to their own.
## Errors
Errors return `{ "error": "" }` (messages are in Lithuanian) and,
where applicable, a stable machine-readable `code` such as
`PLAN_LIMIT_REACHED`, `PLAN_FEATURE_REQUIRED` or `RATE_LIMIT_EXCEEDED`.
## Rate limiting
API-key requests are rate limited per minute by the organization''s plan:
STARTAS 30, VERSLAS 60, PAŽENGĘS 300, ĮMONĖ unlimited. Every response
carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`
(seconds until the window resets). Exceeding the limit returns `429` with a
`Retry-After` header and `code: RATE_LIMIT_EXCEEDED`. The admin dashboard
(JWT) is not subject to these limits.
## Versioning
The API is versioned in the path (`/v1`). Backwards-incompatible changes
ship under a new version; additive changes may appear within `/v1`.'
servers:
- url: /v1
security:
- bearerAuth: []
tags:
- name: API Keys
paths:
/api-keys:
get:
tags:
- API Keys
summary: List the organization's API keys
responses:
'200':
description: API keys (hashes never returned)
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ApiKey'
operationId: getApiKeys
x-operation-id-source: derived
post:
tags:
- API Keys
summary: Create an API key
description: 'Requires `api_keys.create` and the `api_access` plan feature.
The plaintext key is returned once and never stored.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- permissions
properties:
name:
type: string
permissions:
type: array
items:
type: string
expiresAt:
type: string
format: date-time
responses:
'201':
description: Created; response contains the plaintext key once
'403':
$ref: '#/components/responses/Forbidden'
operationId: postApiKeys
x-operation-id-source: derived
/api-keys/mcp:
post:
tags:
- API Keys
summary: Self-service MCP key (inherits caller's permissions)
description: Requires the `mcp_access` plan feature.
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
expiresInDays:
type: integer
responses:
'201':
description: Created; response contains the plaintext key once
'403':
$ref: '#/components/responses/Forbidden'
operationId: postApiKeysMcp
x-operation-id-source: derived
/api-keys/{id}:
delete:
tags:
- API Keys
summary: Revoke an API key
parameters:
- $ref: '#/components/parameters/IdPath'
responses:
'200':
description: Revoked
operationId: deleteApiKeysById
x-operation-id-source: derived
components:
schemas:
Error:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable message (Lithuanian)
code:
type: string
description: Stable machine-readable code, present on plan/limit errors.
enum:
- PLAN_LIMIT_REACHED
- PLAN_FEATURE_REQUIRED
feature:
type: string
plan:
$ref: '#/components/schemas/PlanId'
PlanId:
type: string
enum:
- startas
- verslas
- pazenges
- imone
ApiKey:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
keyPrefix:
type: string
description: First characters of the key, e.g. klkn_ab12
permissions:
type: array
items:
type: string
authSource:
type: string
enum:
- manual
- mcp
lastUsedAt:
type:
- string
- 'null'
format: date-time
expiresAt:
type:
- string
- 'null'
format: date-time
isActive:
type: boolean
createdAt:
type: string
format: date-time
parameters:
IdPath:
name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
Forbidden:
description: Missing permission or plan feature
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Admin JWT from POST /v1/auth/login, or a `klkn_…` API key.