Draft a contact person from text or an image (tenant:masterdata:write)
POST /api/masterdata/addresses/{id}/contacts:draft
Module: Master data · operationId: draftContactPerson · Tag: Drafts · Auth: access token (Authorization: Bearer <accessToken>)
Extracts a contact person of the address from pasted text or an image (url and email are
not used). Nothing is stored. duplicates lists contacts of the same address that look the same.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string (uuid) | yes |
Request body
application/json (required)
email(string): Email address whose domain is looked up (address drafts only) (max length 320)imageData(string): Base64 image or data URI (business card, scanned letter); read via OCR after a malware scan (an image with a finding, or when the scan is unavailable, is not read and a warning on imageData says why) (max length 3145728)mimeType(string):image/*orapplication/pdf(max length 64)text(string): Pasted text: email signature, letterhead, delivery address … (max length 20000)url(string): Website or imprint URL (address drafts only) (max length 2048)
Example:
{
"text": "Erika Musterfrau\nLeitung Einkauf\nMobil +49 171 1234567\nerika.musterfrau@muster.de"
}
Responses
- 200 The draft (
application/json) - 400 Malformed body or query parameter (
application/json) - 401 Missing, invalid or expired token (empty body)
- 403 The token lacks the permission or carries no tenant (
application/json) - 404 Not found in the caller's tenant (or merged, see
code) (application/json) - 413 The body is over the limit (2 MiB; AI drafts 4 MiB) (
application/json) - 429 Too many AI drafts or imprint lookups of this person – wait
Retry-Afterseconds (rate limits) (application/json) - 502 The AI could not read the input (
application/json) - 503 The AI is not reachable (
application/json)
Fields of the 200 answer:
aiAvailable(boolean, required): False when the AI was not availabledraft(ContactPerson, required): One contact person (Ansprechpartner). Needs a first or last name; at most one default contact.aspNr(integer): Number within the address; assignedavailableFrom1(string, nullable): Reachable from (HH:MM)availableFrom2(string, nullable): Second time window: reachable from (HH:MM)availableTo1(string, nullable): AfteravailableFrom1availableTo2(string, nullable): AfteravailableFrom2birthday(string (date), nullable): Birthday (YYYY-MM-DD)blockReason(string, read-only): Reason of the blockblockedAt(string (date-time), read-only): Time of the blockblockedBy(string, read-only): Actor of the blockcustomFields(CustomFields): Values of tenant-defined fields (/api/masterdata/field-defs) by key. On write the map is merged into the stored values;nullremoves a key, an omitted map keeps all values. Unknown or archived keys and missing required fields answer400.department(string): DepartmentdoNotCall(boolean): Do not callemail1(string (email)): First e-mail addressemail2(string (email)): Second e-mail addressemailOptOut(boolean): No marketing e-mailsfax(string): E.164firstName(string): First name (max length 128)gdprConsent(string): GDPR consent state (one ofUNKNOWN,GRANTED,DENIED,REVOKED; default"UNKNOWN")gdprConsentDate(string (date), nullable): Required whengdprConsentis GRANTEDid(string (uuid)): Id of the contact personinfo(string): Info textisActive(boolean): False whenleftAtis set (defaulttrue)isBlocked(boolean, read-only): Blocked contact: left out of phone contacts and the platform notification list. Set withPOST /addresses/{id}/contacts/{cid}/blockisDefault(boolean): Default contact of the address (at most one)languageCode(string): Language (ISO 639-1)lastName(string): Last name (max length 128)leftAt(string (date), nullable): Date the person left the company; setsisActivefalseletterSalutation(string): Salutation line of letterslinkedinUrl(string (uri)): LinkedIn profile (max length 255)mobile(string): E.164namePrefix(string): Name prefixnameSuffix(string): Name suffixphone1(string): E.164phone2(string): E.164portalUserId(string): Linked desk portal user (max length 255)position(string): PositionpostalAddressAnsNr(integer, nullable):ansNrof a postal address of the same addresspreferredChannel(string): Preferred contact channel (one ofEMAIL,PHONE,MOBILE,LETTER,PORTAL)reportsToAspNr(integer, nullable):aspNrof the manager within the same address (no cycles)roles(array of string): Roles in the buying centre or for ticket routingsalutationCode(string): Code ofsalutationstimezone(string): IANA time zonetitle(string): Titleversion(integer): Version of this contact (child updates)
duplicates(array of ChildDuplicate, required): Contact persons of the same address that look the sameid(string (uuid), required): Id of the existing contact person or postal addresslabel(string, required): Name or street line of the existing entrynumber(integer, required):aspNroransNrreason(string, required): Why it looks the same (EMAIL, NAME or POSTAL_CODE)
fieldSources(FieldSources, required): Where each pre-filled field (JSON name) came fromwarnings(array of DraftWarning, required): Unknown lookup codes, invalid formats or failed sourcesmessage(string, required): German hintfield(string): JSON name of the draft field (empty for the whole draft)
Example 200 answer:
{
"aiAvailable": true,
"draft": {
"email1": "info@hotel-waldblick.example",
"firstName": "Markus",
"lastName": "Pongratz",
"phone1": "+49992477810",
"position": "Inhaber",
"salutationCode": "HERR"
},
"duplicates": [],
"fieldSources": {
"email1": "text",
"firstName": "text",
"lastName": "text",
"phone1": "text",
"position": "text"
},
"warnings": []
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/masterdata/addresses/3f6c1a52-7b1e-4d2a-9c8e-2b5f0d6a91e4/contacts:draft' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"text":"Erika Musterfrau\nLeitung Einkauf\nMobil +49 171 1234567\nerika.musterfrau@muster.de"}'