DKBSignDocs

Core concepts

Contacts

A per-user address book that can be shared at organisation level, with imports from CSV, LDAP, Google, and Outlook.

Address book

Contacts are scoped to the caller and optionally to the organisation (visibility: private or org). Create with POST /api/contacts. Fields: first_name, last_name, email, phone, title, company, visibility, optional extra object. Duplicate email for the same owner → 409. Delete returns 204.

List query parameters are q, source (manual|csv|ldap|google|outlook), visibility, scope (mine|org|all), limit (1–200, default 50), and offset.

Imports without an email insert the row with extra.possible_duplicate: true. Review them on GET /api/contacts/possible-duplicates.

Imports

Large imports run in the background and return 202 { "job_id": "<uuid>" }. Poll GET /api/contacts/imports/{job_id} until queued → running → done / failed. The job includes counts (total, created, updated, skipped, errors).

  • CSV — POST /api/contacts/imports/csv/preview (multipart file) then POST /api/contacts/imports/csv with file, a JSON mapping (contact field → CSV column), and optional visibility. Suggested headers: first name / prénom, last name / nom, email, phone, title / fonction, company / entreprise.
  • LDAP — store a connection, test it, then POST /api/contacts/imports/ldap with connection_id
  • Google and Outlook — you complete OAuth, then POST the short-lived access_token. The gateway forwards it; it is not stored or logged.
json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "source": "csv",
  "status": "done",
  "counts": { "total": 120, "created": 80, "updated": 30, "skipped": 8, "errors": 2 },
  "error": null
}

LDAP connections

POST /api/contacts/ldap-connections stores name, host, port (default 389), use_ssl, bind_dn, bind_password (encrypted at rest, never returned), base_dn, optional search_filter (default (&(objectClass=person)(mail=*))), and optional attribute_map. Test with POST .../{connection_id}/test (ok, sample_count, sample).

Settings

GET / PUT /api/contacts/config controls:

  • import_default_visibility — private or org
  • dedup_strategy — update merges on email; skip keeps the first row
  • phone_default_region — ISO country used to normalize national numbers (for example CI)