Third-party apps currently need to provide a note type ID (mid) when inserting a note through the AnkiDroid content-provider API. If they want cards in a particular deck, the
available workflow is to create the note and then move each generated card individually.
That workflow cannot correctly respect card-template deck overrides: a client cannot read whether a template has a deck override, and moving every generated card afterward
overwrites any deck selected during note creation. This was observed with Pleco in issue #21832 (Notes added via API ignore any "Deck Override" settings of the provided note type (model) · Issue #21832 · ankidroid/Anki-Android · GitHub).
Add a versioned API capability for atomic note creation with these semantics:
- Accept fields and tags, an optional note type ID, and an optional target deck ID.
- If no note type ID is provided, resolve it using the same documented adding-defaults policy as AnkiDroid’s Note Editor.
- Create the note in the target deck (or the adding default if omitted).
- Apply card-template deck overrides during creation; an override should take precedence for the relevant generated card.
- Return the new note ID.
- Avoid requiring clients to query and move individual cards after creation.
This should be capability/version-gated so existing third-party integrations retain their current behavior.
Example expected result:
- Target deck: Chinese
- Note type: Basic (and reversed card)
- Card 2 template override: Chinese::Production
Creating one note through the new API should place Card 1 in Chinese and Card 2 in Chinese::Production.
This would let future API clients handle deck overrides correctly, while keeping ordinary explicit card-move operations unchanged.