Skip to main content

import_contacts

Function import_contacts 

Source
pub async fn import_contacts(
    __arg0: State<App>,
    tn_id: TnId,
    __arg2: IdTag,
    __arg3: Auth,
    __arg4: OptionalRequestId,
    __arg5: Path<u64>,
    __arg6: Query<ImportContactsQuery>,
    body: String,
) -> ClResult<(StatusCode, Json<ApiResponse<ImportContactsResult>>)>
Expand description

POST /api/address-books/{ab_id}/import?conflict=skip|replace|add

Body: text/vcard containing one or more BEGIN:VCARD ... END:VCARD blocks. Returns a per-card result summary with any parse/write failures.

Conflict modes (matched by vCard UID against existing rows in the address book):

  • skip (default) — keep the existing contact, count it under skipped.
  • replace — overwrite the existing contact (same UID), count under updated.
  • add — drop the incoming UID and mint a fresh one so the card lands as a new contact alongside the existing one. Useful when the user wants every card from the file to land regardless of UID collisions.