# app.studynext.cards

> A single flashcard (front/back) with spaced-repetition scheduling state. rkey is the client's card id (see the `id` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded. Note: unlike most other app.studynext.* records this property is named `id`, not `localId`.

- Kind: record
- Record key: any
- Authority: studynext.app
- Lexicon: 1
- Published by [studynext.app](https://lexicon.garden/identity/did:plc:nstib2qjcu3tyun7cxz4dxcm), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cards)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cards/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cards/analytics)

## Record (`app.studynext.cards`)

Type: record · key any

### Properties

- `back` (string, required)
  - Constraints: maxLength: 15000
- `createdAt` (string · datetime)
- `deckId` (string, required)
  - Constraints: maxLength: 512
- `difficulty` (string): FSRS difficulty 1-10, stringified — AT Protocol's data model has no float type. Old clients ignore this field.
- `dueDate` (string, required): Calendar date in YYYY-MM-DD format; not a timestamp.
- `easeFactor` (string, required): Spaced-repetition ease factor, stringified — AT Protocol's data model has no float type.
- `firstReviewDate` (string): Calendar date in YYYY-MM-DD format; not a timestamp.
- `flag` (integer): Anki cards.flags low 3 bits (0=none, 1-7 colors). Old clients ignore this field.
  - Constraints: minimum: 0, maximum: 7
- `front` (string, required)
  - Constraints: maxLength: 15000
- `id` (string, required): Matches local FlashCard.id and equals this record's own rkey (see the record-level description above).
  - Constraints: maxLength: 300
- `interval` (string, required): Spaced-repetition interval in days, stringified — AT Protocol's data model has no float type.
- `lapses` (integer): Review failure count. Old clients ignore this field.
  - Constraints: minimum: 0
- `lastGrade` (string): Most recent grading result (drives the problem-number chip color in 'problem-by-problem' plans). Absent for ungraded cards; old clients ignore this field. Also duplicated in app.studynext.cardMetadata so an old client's whole-record rewrite cannot erase it.
  - Constraints: knownValues: again | hard | good | easy
- `lastReviewDate` (string): Calendar date in YYYY-MM-DD format; not a timestamp.
- `media` (array): Attached media manifest. File bytes live in PDS blobs; front/back reference them by name (<img src>/[sound:]). Old clients ignore this field.
  - `items` (ref)
    - Reference: `#mediaEntry`
- `pdsRkey` (string · tid): Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.
- `problemRounds` (integer): For cards owned by a 'problem-by-problem' plan: how many times this item was graded good or better while in review state (round progress toward the plan's targetRounds). Absent for standard cards; old clients ignore this field.
  - Constraints: minimum: 0
- `repetitions` (integer, required)
  - Constraints: minimum: 0
- `stability` (string): FSRS stability in days, stringified — AT Protocol's data model has no float type. Old clients ignore this field.
- `state` (string, required)
  - Constraints: knownValues: new | learning | review | relearning
- `stepIndex` (integer, required)
  - Constraints: minimum: 0
- `suspended` (boolean): Anki queue=-1 (suspended). Excluded from the study queue. Old clients ignore this field.
- `syncedAt` (string · datetime): ISO timestamp of the last successful push. Used by the pushing client for its own last-write-wins pull-merge decisions.
- `tags` (array, required)
  - Constraints: maxLength: 20
  - `items` (string)
    - Constraints: maxLength: 150

## #mediaEntry (`app.studynext.cards#mediaEntry`)

Type: object

### Properties

- `blob` (blob, required)
  - Constraints: maxSize: 26214400, accept: image/*, audio/*
- `mimeType` (string, required)
  - Constraints: maxLength: 100
- `name` (string, required)
  - Constraints: maxLength: 200
- `size` (integer, required)
  - Constraints: minimum: 0

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A single flashcard (front/back) with spaced-repetition scheduling state. rkey is the client's card id (see the `id` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded. Note: unlike most other app.studynext.* records this property is named `id`, not `localId`.",
      "key": "any",
      "record": {
        "properties": {
          "back": {
            "maxLength": 15000,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "deckId": {
            "maxLength": 512,
            "type": "string"
          },
          "difficulty": {
            "description": "FSRS difficulty 1-10, stringified — AT Protocol's data model has no float type. Old clients ignore this field.",
            "type": "string"
          },
          "dueDate": {
            "description": "Calendar date in YYYY-MM-DD format; not a timestamp.",
            "type": "string"
          },
          "easeFactor": {
            "description": "Spaced-repetition ease factor, stringified — AT Protocol's data model has no float type.",
            "type": "string"
          },
          "firstReviewDate": {
            "description": "Calendar date in YYYY-MM-DD format; not a timestamp.",
            "type": "string"
          },
          "flag": {
            "description": "Anki cards.flags low 3 bits (0=none, 1-7 colors). Old clients ignore this field.",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          },
          "front": {
            "maxLength": 15000,
            "type": "string"
          },
          "id": {
            "description": "Matches local FlashCard.id and equals this record's own rkey (see the record-level description above).",
            "maxLength": 300,
            "type": "string"
          },
          "interval": {
            "description": "Spaced-repetition interval in days, stringified — AT Protocol's data model has no float type.",
            "type": "string"
          },
          "lapses": {
            "description": "Review failure count. Old clients ignore this field.",
            "minimum": 0,
            "type": "integer"
          },
          "lastGrade": {
            "description": "Most recent grading result (drives the problem-number chip color in 'problem-by-problem' plans). Absent for ungraded cards; old clients ignore this field. Also duplicated in app.studynext.cardMetadata so an old client's whole-record rewrite cannot erase it.",
            "knownValues": [
              "again",
              "hard",
              "good",
              "easy"
            ],
            "type": "string"
          },
          "lastReviewDate": {
            "description": "Calendar date in YYYY-MM-DD format; not a timestamp.",
            "type": "string"
          },
          "media": {
            "description": "Attached media manifest. File bytes live in PDS blobs; front/back reference them by name (<img src>/[sound:]). Old clients ignore this field.",
            "items": {
              "ref": "#mediaEntry",
              "type": "ref"
            },
            "type": "array"
          },
          "pdsRkey": {
            "description": "Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.",
            "format": "tid",
            "type": "string"
          },
          "problemRounds": {
            "description": "For cards owned by a 'problem-by-problem' plan: how many times this item was graded good or better while in review state (round progress toward the plan's targetRounds). Absent for standard cards; old clients ignore this field.",
            "minimum": 0,
            "type": "integer"
          },
          "repetitions": {
            "minimum": 0,
            "type": "integer"
          },
          "stability": {
            "description": "FSRS stability in days, stringified — AT Protocol's data model has no float type. Old clients ignore this field.",
            "type": "string"
          },
          "state": {
            "knownValues": [
              "new",
              "learning",
              "review",
              "relearning"
            ],
            "type": "string"
          },
          "stepIndex": {
            "minimum": 0,
            "type": "integer"
          },
          "suspended": {
            "description": "Anki queue=-1 (suspended). Excluded from the study queue. Old clients ignore this field.",
            "type": "boolean"
          },
          "syncedAt": {
            "description": "ISO timestamp of the last successful push. Used by the pushing client for its own last-write-wins pull-merge decisions.",
            "format": "datetime",
            "type": "string"
          },
          "tags": {
            "items": {
              "maxLength": 150,
              "type": "string"
            },
            "maxLength": 20,
            "type": "array"
          }
        },
        "required": [
          "id",
          "deckId",
          "front",
          "back",
          "tags",
          "state",
          "interval",
          "easeFactor",
          "repetitions",
          "stepIndex",
          "dueDate"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "mediaEntry": {
      "properties": {
        "blob": {
          "accept": [
            "image/*",
            "audio/*"
          ],
          "maxSize": 26214400,
          "type": "blob"
        },
        "mimeType": {
          "maxLength": 100,
          "type": "string"
        },
        "name": {
          "maxLength": 200,
          "type": "string"
        },
        "size": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "name",
        "mimeType",
        "size",
        "blob"
      ],
      "type": "object"
    }
  },
  "id": "app.studynext.cards",
  "lexicon": 1
}
```
