Skip to main content

AdminCreateApiKeyDTO

Package: @nauth-toolkit/core Type: DTO (Request)

Administrative API key creation on behalf of a user. Bypasses allowUserCreation.

import { AdminCreateApiKeyDTO } from '@nauth-toolkit/nestjs';

Properties​

PropertyTypeRequiredDescription with validation inline
substringYesTarget user sub (UUID v4).
namestringNoOptional label.
expiresInDaysnumber | nullYesExpiry in days, or null for never (if allowed).
allowedIpsstring[]NoIPs / IPv4 CIDR ranges.

Example​

{
"sub": "550e8400-e29b-41d4-a716-446655440000",
"expiresInDays": 90,
"allowedIps": ["203.0.113.0/24"]
}

Used By​