MATIH Platform is in active MVP development. Documentation reflects current implementation status.
6. Identity & Access Management
API Keys
Overview

API Key Overview

Production - ApiKeyController - 15 endpoints at /api/v1/api-keys

API keys provide long-lived authentication tokens for programmatic access to the MATIH platform. Unlike JWT tokens, API keys do not expire based on time alone and support scoped permissions, IP whitelisting, and rate limiting.


API Key Features

FeatureDescription
Scoped PermissionsEach key has a defined set of scopes (permissions)
IP WhitelistingRestrict key usage to specific IP addresses or CIDR blocks
Rate LimitingPer-key request rate limits
Key RotationGraceful rotation with configurable grace period
Key Typesuser, service, integration
Test ModeSeparate test keys for development
ExpirationOptional expiration in days
Prefix FormatKeys start with mk_live_ or mk_test_ for identification

Key Storage Security

API keys are never stored in plain text:

  • The full key is only returned once at creation time
  • A SHA-256 hash of the key is stored in the key_hash column
  • The first 8 characters are stored as key_prefix for display purposes

Section Pages

PageDescription
Creating KeysKey creation with scopes and configuration
Key RotationAutomatic and manual rotation
Scopes & LimitsScope definitions and rate limiting
IP WhitelistingIP restriction management