# ReaderApiKey

**Kind:** Database Model

**Source:** [`atloria-monorepo/libs/database/prisma/schema.prisma`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/database/prisma/schema.prisma#L3209)

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `accountId` | `String` | ✓ |  |
| `projectId` | `String` | ✓ |  |
| `name` | `String` | ✓ |  |
| `keyHash` | `String` | ✓ | unique |
| `keyPrefix` | `String` | ✓ |  |
| `lastUsedAt` | `DateTime` | - |  |
| `revokedAt` | `DateTime` | - |  |
| `createdAt` | `DateTime` | ✓ |  |

## Diagram

```mermaid
erDiagram
    ReaderApiKey {
        id String [PK]
        accountId String
        projectId String
        name String
        keyHash String [UNIQUE]
        keyPrefix String
        lastUsedAt DateTime?
        revokedAt DateTime?
        createdAt DateTime
    }
    ReaderApiKey ||--|| ReaderAccount : ""
    ReaderApiKey ||--|| Project : ""
```

## Relationships

- HAS_ONE → `ReaderAccount`
- HAS_ONE → `Project`
