AdminCreateApiKeyDTO
Package: @nauth-toolkit/core
Type: DTO (Request)
Administrative API key creation on behalf of a user. Bypasses allowUserCreation.
- NestJS
- Express
- Fastify
import { AdminCreateApiKeyDTO } from '@nauth-toolkit/nestjs';
import { AdminCreateApiKeyDTO } from '@nauth-toolkit/core';
import { AdminCreateApiKeyDTO } from '@nauth-toolkit/core';
Properties
| Property | Type | Required | Description with validation inline |
|---|---|---|---|
sub | string | Yes | Target user sub (UUID v4). |
name | string | No | Optional label. |
expiresInDays | number | null | Yes | Expiry in days, or null for never (if allowed). |
allowedIps | string[] | No | IPs / IPv4 CIDR ranges. |
Example
{
"sub": "550e8400-e29b-41d4-a716-446655440000",
"expiresInDays": 90,
"allowedIps": ["203.0.113.0/24"]
}