updateCard
Updates basic card fields (content, url, tags, notes). Automatically triggers AI reprocessing when content changes.Arguments
The unique identifier of the card to update.
Updated card content. For quote cards, quotation marks are automatically normalized.Triggers AI reprocessing: When content changes, the card re-enters the processing pipeline for metadata extraction and categorization.
Updated URL. Typically used for link cards.
Updated tags array. Replaces existing tags completely.
Updated notes text. Replaces existing notes.
Returns
Returns
null on success. Throws an error if the operation fails.Behavior
Authorization Check
Authorization Check
Quote Normalization
Quote Normalization
For quote-type cards, content is automatically normalized:Quotation marks are removed and content is cleaned.
Processing Pipeline Trigger
Processing Pipeline Trigger
When
content is updated:- Sets
processingStatus.metadatato"pending" - For link cards, also sets
processingStatus.categorizeto"pending" - Schedules
cardProcessingWorkflowto run asynchronously - Workflow re-extracts AI metadata, tags, and summaries
Timestamp Updates
Timestamp Updates
Always updates
updatedAt to current timestamp, regardless of which field changed.Error Handling
Thrown when no authenticated session exists.
Thrown when card with given ID doesn’t exist.
Thrown when authenticated user doesn’t own the card.
updateCardField
Unified mutation for updating any card field or performing card operations (favorite, delete, restore).Arguments
The unique identifier of the card to update.
The field or operation to perform:
"content"- Update main content"url"- Update URL"notes"- Update notes"tags"- Update user tags"aiSummary"- Update AI summary"isFavorited"- Toggle favorite status"removeAiTag"- Remove specific AI tag"delete"- Soft delete card"restore"- Restore deleted card
The new value for the field. Type depends on the field:
content,url,notes,aiSummary: stringtags: string[]isFavorited,delete,restore: not needed (operation-based)
Required when
field is "removeAiTag". Specifies which AI tag to remove.Returns
Returns the update result (typically the card object or null). Return type varies based on operation.
Field-Specific Behavior
content
content
Updates card content:
- Trims whitespace
- Normalizes quotes for quote-type cards
- Sets
processingStatus.metadatato pending if content changed - For link cards, also sets
processingStatus.categorizeto pending - Triggers
cardProcessingWorkflowasynchronously
url
url
Updates card URL:
- Trims whitespace, sets to
undefinedif empty - Sets
processingStatus.classifyto pending - Sets
processingStatus.metadatato pending - Sets
processingStatus.categorizeto pending - Clears existing
linkPreviewandlinkCategorymetadata - Sets
metadataStatusto"pending" - Triggers complete reprocessing pipeline
notes
notes
Updates notes field:
- Trims whitespace, sets to
undefinedif empty - Does not trigger AI reprocessing
tags
tags
aiSummary
aiSummary
Manually updates AI-generated summary:
- Trims whitespace, sets to
undefinedif empty - Does not trigger automatic regeneration
isFavorited
isFavorited
Toggles favorite status:
- Flips boolean value:
true→false,false→true,undefined→true - No value parameter needed
removeAiTag
removeAiTag
Removes a specific AI-generated tag:
- Requires
tagToRemoveparameter - Filters out the specified tag
- Sets
aiTagstoundefinedif no tags remain - Returns card unchanged if tag not found or no AI tags exist
delete
delete
Soft deletes the card:
- Sets
isDeletedtotrue - Sets
deletedAtto current timestamp - Card remains in database but hidden from normal queries
- Can be restored with
"restore"operation
restore
restore
Restores a soft-deleted card:
- Sets
isDeletedtoundefined - Sets
deletedAttoundefined - Throws error if card is not deleted
- Card reappears in normal queries
Error Handling
Thrown when no authenticated session exists.
Thrown when card with given ID doesn’t exist.
Thrown when authenticated user doesn’t own the card.
Thrown when attempting to restore a card that isn’t deleted.
Thrown when an invalid field name is provided.
Source References
updateCard:packages/convex/card/updateCard.ts:12updateCardField:packages/convex/card/updateCard.ts:86