API Key
Life Cycle
Route | Create | Read | Update | Delete |
---|---|---|---|---|
/admin/api/keys | ||||
/admin/api/keys/new | ||||
/admin/api/keys/:id | ||||
/app/:tenant/settings/api/keys | ||||
/app/:tenant/settings/api/keys/new | ||||
/app/:tenant/settings/api/keys/:id |
Properties
Name | Title | Type | Description |
---|---|---|---|
tenantId * | Tenant | Tenant | |
key * | Key | UUID | Autogenerated |
alias * | Alias | String | Shows as 'created by XYZ' on Custom Entity Rows |
max * | Max | Int | Maximum number of usages |
expires * | Expires | DateTime | |
active * | Active | Boolean | |
entities * | Entities | ApiKeyEntity[] | CRUD permissions of Custom Entities |
apiKeyLogs | API Key Logs | ApiKeyLog[] | IP, Endpoint, Method, Params, Status and Error |
logs | Logs | Log[] | API Key audit trails/events |
createdRows | Rows | Row[] | Custom entity rows created by API Key |
Model
model ApiKey {
id String @id @default(cuid())
createdAt DateTime @default(now())
createdByUserId String
createdByUser User @relation(fields: [createdByUserId], references: [id], onDelete: Cascade)
tenantId String
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
key String @default(uuid())
alias String
max Int
expires DateTime
active Boolean
entities ApiKeyEntity[]
apiKeyLogs ApiKeyLog[]
logs Log[]
rows Row[]
@@unique([tenantId, alias])
}