> For the complete documentation index, see [llms.txt](https://multisource.gitbook.io/api-dintegration-multisource/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multisource.gitbook.io/api-dintegration-multisource/integration/validate-and-update.md).

# Validate & Update

## Processus de traitement des adresses

Le processus par lots se compose des étapes suivantes :

{% stepper %}
{% step %} <i class="fa-inbox-full">:inbox-full:</i> [Créer un lot](#create)
{% endstep %}

{% step %}
Fournir les données

* <i class="fa-file-circle-plus">:file-circle-plus:</i> [Variante A – Ajout d’enregistrements](#addrecords)
* <i class="fa-upload">:upload:</i> [Variante B – Téléversement de fichier](#fileupload)
  {% endstep %}

{% step %} <i class="fa-play">:play:</i> [Démarrer le traitement](#start)
{% endstep %}

{% step %}
Télécharger les résultats

* <i class="fa-memo-circle-check">:memo-circle-check:</i> [Variante A – Récupération des enregistrements](#getrecords)
* <i class="fa-upload">:upload:</i> [Variante B – Téléchargement de fichier](#filedownload)
  {% endstep %}
  {% endstepper %}

## Fonctions

### <i class="fa-inbox-full">:inbox-full:</i> Create

Un lot (Batch) est le cadre dans lequel le traitement a lieu. Un nouveau lot doit être créé pour chaque exécution d’adresses.

<table><thead><tr><th width="239">Paramètres de requête</th><th>Explication</th></tr></thead><tbody><tr><td><code>orderNr</code></td><td>Numéro de référence personnalisé pouvant être attribué pour identifier une commande de manière unique, par exemple pour des demandes ultérieures ou des clarifications.</td></tr><tr><td><code>dataGroupCode</code></td><td>Identification unique du groupe de données.</td></tr><tr><td><code>userDescription</code></td><td><p>Nom de la campagne ou du lot. </p><p>→ Généré lors de la création du lot de données (<code>/dataGroups/create</code>). Doit être référencé ici.</p></td></tr><tr><td><code>processId</code></td><td><p>ID attribué par le système pour le processus. </p><p>→ Valeur par défaut : <code>400</code></p></td></tr><tr><td><code>processingDate</code></td><td>Définit quand le lot doit être lancé (par exemple, création du lot aujourd’hui, traitement pendant le week-end).</td></tr><tr><td><code>businessCase</code></td><td><p>Définit le déroulement du processus en fonction de préréglages définis à l’avance. </p><p>→ Valeur par défaut : <code>0</code></p></td></tr><tr><td><code>product</code></td><td><p>Sélection du produit souhaité, par exemple :</p><ul><li><code>1</code> <strong>Enrich :</strong> Enrichissement des données existantes.</li><li><code>2</code> <strong>Reference :</strong> Analyse des données par rapport aux sources de données disponibles, sans modification des données → Résultat : Rapport d’analyse de Multisource et, le cas échéant, de la Poste Suisse.</li><li><code>3</code> <strong>AdressUpdate :</strong> Mise à jour des adresses existantes.</li></ul></td></tr><tr><td><code>notificationEmail</code></td><td>Adresse e-mail pour les notifications. Si aucune adresse spécifique n’est renseignée, l’adresse e-mail de l’utilisateur actuellement connecté sera utilisée par défaut.</td></tr></tbody></table>

## POST /addressprocessing/create

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}},"schemas":{"BatchCreateRequest":{"required":["orderNr","userDescription","processId","product"],"type":"object","properties":{"orderNr":{"type":"string"},"dataGroupCode":{"type":"string","nullable":true},"userDescription":{"type":"string","nullable":true},"processId":{"type":"integer","format":"int32"},"businessCase":{"type":"integer","format":"int32"},"product":{"$ref":"#/components/schemas/ProductCase"},"notificationEmail":{"type":"string"},"processingDate":{"type":"string","format":"date-time"},"settings":{"type":"object","additionalProperties":{"type":"string"}}}},"ProductCase":{"enum":[1,2,3],"type":"integer","description":"**Allowed values:**\n- `1` = `Enrich`\n- `2` = `Reference`\n- `3` = `AddressUpdate`","format":"int32"},"BatchDetail":{"type":"object","properties":{"batchId":{"type":"integer","format":"int32"},"batchUniqueId":{"type":"string","format":"uuid"},"processGroup":{"type":"integer","format":"int32"},"insertBy":{"type":"string","nullable":true},"insertAt":{"type":"string","format":"date-time","nullable":true},"description":{"type":"string","nullable":true},"userDescription":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"processingDate":{"type":"string","format":"date-time","nullable":true},"duration":{"type":"integer","format":"int32","nullable":true},"errorCount":{"type":"integer","format":"int32","nullable":true},"warningCount":{"type":"integer","format":"int32","nullable":true},"warningRejectCount":{"type":"integer","format":"int32","nullable":true},"createTypeId":{"type":"integer","format":"int32"},"runSingle":{"type":"boolean","nullable":true},"agent":{"type":"string","nullable":true},"datagroupId":{"type":"integer","format":"int32","nullable":true},"orderNr":{"type":"string","nullable":true},"settings":{"type":"object","additionalProperties":{"type":"string"},"nullable":true},"files":{"type":"array","items":{"$ref":"#/components/schemas/BatchFile"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/BatchStep"}}}},"BatchFile":{"type":"object","properties":{"fileUniqueId":{"type":"string","format":"uuid"},"direction":{"type":"string","nullable":true},"fileName":{"type":"string","nullable":true},"processFileDetection":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"s3Key":{"type":"string","nullable":true}}},"BatchStep":{"type":"object","properties":{"stepId":{"type":"integer","format":"int32"},"status":{"type":"string","nullable":true},"sortOrder":{"type":"integer","format":"int32","nullable":true},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"duration":{"type":"integer","format":"int32","nullable":true},"errorCount":{"type":"integer","format":"int32","nullable":true},"warningCount":{"type":"integer","format":"int32","nullable":true},"warningRejectCount":{"type":"integer","format":"int32","nullable":true},"recordCount":{"type":"integer","format":"int32","nullable":true},"description":{"type":"string","nullable":true},"modulUniqueId":{"type":"string","format":"uuid","nullable":true},"descriptionAdd":{"type":"string","nullable":true}}}}},"paths":{"/addressprocessing/create":{"post":{"tags":["Batch"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/BatchCreateRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/BatchCreateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/BatchDetail"}},"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetail"}},"text/json":{"schema":{"$ref":"#/components/schemas/BatchDetail"}}}}}}}}}
```

### <i class="fa-file-circle-plus">:file-circle-plus:</i> AddRecords

Cette fonction permet de téléverser des enregistrements un par un ou de compléter un envoi existant avec des enregistrements supplémentaires.

## PUT /addressprocessing/addrecords

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}},"schemas":{"BatchProcessingApiRecord":{"type":"object","properties":{"customerId":{"type":"string","nullable":true},"segmentation":{"type":"object","additionalProperties":{"type":"string"},"nullable":true},"dwhId":{"type":"string","nullable":true},"egid":{"type":"string","nullable":true},"edid":{"type":"string","nullable":true},"postAddressId":{"type":"string","nullable":true},"freetext1":{"type":"string","nullable":true},"freetext2":{"type":"string","nullable":true},"freetext3":{"type":"string","nullable":true},"freetext4":{"type":"string","nullable":true},"freetext5":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"streetNo":{"type":"string","nullable":true},"streetAdd":{"type":"string","nullable":true},"careOf":{"type":"string","nullable":true},"poBox":{"type":"string","nullable":true},"poZip":{"type":"string","nullable":true},"poTown":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"town":{"type":"string","nullable":true},"mobileNo":{"type":"string","nullable":true},"phoneNo":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"uid":{"type":"string","nullable":true},"chnr":{"type":"string","nullable":true}}}}},"paths":{"/addressprocessing/addrecords":{"put":{"tags":["Batch"],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

### <i class="fa-upload">:upload:</i> FileUpload

Ajoute un fichier au traitement.

## POST /addressprocessing/fileupload

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/fileupload":{"post":{"tags":["Batch"],"parameters":[{"name":"batchId","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"batchUid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"description","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","allOf":[{"type":"object","properties":{"ContentType":{"type":"string"},"ContentDisposition":{"type":"string"},"Headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"Length":{"type":"integer","format":"int64"},"Name":{"type":"string"},"FileName":{"type":"string"}}},{"type":"object","properties":{"mapping":{"type":"string"}}}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

### <i class="fa-play">:play:</i> Start

Lance le traitement.

## POST /addressprocessing/start

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/start":{"post":{"tags":["Batch"],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

### <i class="fa-memo-circle-check">:memo-circle-check:</i> GetRecords

Récupère les résultats d’un batch AdressProcessing directement au format **JSON**.

Cet endpoint est utile lorsque les données doivent être traitées directement dans le système, sans téléchargement de fichier.

## GET /addressprocessing/getrecords

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/getrecords":{"get":{"tags":["Batch"],"parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"file","in":"query","description":"Optional.","schema":{"type":"boolean","default":false}},{"name":"fileDecompress","in":"query","description":"Optional.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK"}}}}}}
```

### <i class="fa-download">:download:</i> FileDownload

Télécharge les résultats d’un batch AdressProcessing sous forme de fichier.

La sortie est fournie au format **TSV** (valeurs séparées par des tabulations).

Le paramètre **compressed** permet de définir si le fichier est livré **compressé (.txt.gz)** (false) ou **non compressé (.txt)** (true).

## GET /addressprocessing/filedownload

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/filedownload":{"get":{"tags":["Batch"],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"decompress","in":"query","description":"Optional.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK"}}}}}}
```

## Étapes optionnelles (pour des cas d'utilisation avancés)

### Detail

Fournit un aperçu de tous les fichiers disponibles et de leurs étapes de traitement. Contient également l'identifiant unique (`fileUniqueId`) de chaque fichier.

#### Batch-Status

<table><thead><tr><th width="111">ID du statut</th><th width="200">Nom</th><th>Description</th></tr></thead><tbody><tr><td><code>0</code></td><td><code>Created</code></td><td>Créé, pas encore traité</td></tr><tr><td><code>1</code></td><td><code>Execute</code></td><td>En file d’attente; le traitement démarre dès que les ressources sont disponibles</td></tr><tr><td><code>2</code></td><td><code>Processing</code></td><td>Traitement en cours</td></tr><tr><td><code>3</code></td><td><code>Marked for processing</code></td><td>Statut intermédiaire entre <em>Execute</em> et <em>Processing</em></td></tr><tr><td><code>4</code></td><td><code>Done</code></td><td>Traitement terminé avec succès</td></tr><tr><td><code>6</code></td><td><code>Error</code></td><td>Erreur survenue pendant le traitement</td></tr><tr><td><code>8</code></td><td><code>Skipped</code></td><td>Certains modules ont été ignorés</td></tr></tbody></table>

## GET /addressprocessing/detail

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}},"schemas":{"BatchDetail":{"type":"object","properties":{"batchId":{"type":"integer","format":"int32"},"batchUniqueId":{"type":"string","format":"uuid"},"processGroup":{"type":"integer","format":"int32"},"insertBy":{"type":"string","nullable":true},"insertAt":{"type":"string","format":"date-time","nullable":true},"description":{"type":"string","nullable":true},"userDescription":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"processingDate":{"type":"string","format":"date-time","nullable":true},"duration":{"type":"integer","format":"int32","nullable":true},"errorCount":{"type":"integer","format":"int32","nullable":true},"warningCount":{"type":"integer","format":"int32","nullable":true},"warningRejectCount":{"type":"integer","format":"int32","nullable":true},"createTypeId":{"type":"integer","format":"int32"},"runSingle":{"type":"boolean","nullable":true},"agent":{"type":"string","nullable":true},"datagroupId":{"type":"integer","format":"int32","nullable":true},"orderNr":{"type":"string","nullable":true},"settings":{"type":"object","additionalProperties":{"type":"string"},"nullable":true},"files":{"type":"array","items":{"$ref":"#/components/schemas/BatchFile"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/BatchStep"}}}},"BatchFile":{"type":"object","properties":{"fileUniqueId":{"type":"string","format":"uuid"},"direction":{"type":"string","nullable":true},"fileName":{"type":"string","nullable":true},"processFileDetection":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"s3Key":{"type":"string","nullable":true}}},"BatchStep":{"type":"object","properties":{"stepId":{"type":"integer","format":"int32"},"status":{"type":"string","nullable":true},"sortOrder":{"type":"integer","format":"int32","nullable":true},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"duration":{"type":"integer","format":"int32","nullable":true},"errorCount":{"type":"integer","format":"int32","nullable":true},"warningCount":{"type":"integer","format":"int32","nullable":true},"warningRejectCount":{"type":"integer","format":"int32","nullable":true},"recordCount":{"type":"integer","format":"int32","nullable":true},"description":{"type":"string","nullable":true},"modulUniqueId":{"type":"string","format":"uuid","nullable":true},"descriptionAdd":{"type":"string","nullable":true}}}}},"paths":{"/addressprocessing/detail":{"get":{"tags":["Batch"],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/BatchDetail"}},"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetail"}},"text/json":{"schema":{"$ref":"#/components/schemas/BatchDetail"}}}}}}}}}
```

### AddDatagroup

Ajoute un groupe de données.

Data is organised into Data Groups. These allow you to logically separate records when needed – for example to process and analyse existing customers, new customers, or campaigns independently.

In many cases, however, a single Data Group is sufficient, where all data can be loaded and continuously updated.

> Note: Once a Data Group is started, the existing data in that group will be overwritten.

## PUT /addressprocessing/adddatagroup

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/adddatagroup":{"put":{"tags":["Batch"],"parameters":[{"name":"description","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```

### GetDataGroups

Liste les groupes de données disponibles.

## GET /addressprocessing/getdatagroups

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/getdatagroups":{"get":{"tags":["Batch"],"parameters":[{"name":"loadAll","in":"query","required":true,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK"}}}}}}
```

### SetBatchSettings

Définit les paramètres du lot.

<table><thead><tr><th width="170">Paramètres de requête</th><th>Explication</th></tr></thead><tbody><tr><td><code>property-name</code></td><td><p>Valeurs des paramètres de configuration :</p><ul><li><strong><code>InputMapping</code></strong> Définit le mapping des données appliqué au traitement des données.</li><li><strong><code>RangeBack</code></strong> Définit la période des changements d’adresse à prendre en compte (par ex. déménagements des 12 derniers mois). → Valeur par défaut : 36 mois</li><li><strong><code>WebhookUrl</code></strong> Permet l’automatisation après la fin du traitement du lot (actuellement uniquement en tant que requête GET avec des paramètres dans la query string). Peut être utilisé pour automatiser des processus supplémentaires et déclencher des actions chez le client après la fin du traitement (par ex. mise à jour de rapports dans Power BI).</li><li><strong><code>webhookmethod</code></strong> Définit la méthode HTTP utilisée pour l’appel (par ex. POST ou PUT).</li><li><strong><code>webhookheader</code></strong> Optionnel – définit les en-têtes HTTP sous forme de JSON stringifié, par exemple pour transmettre des tokens d’authentification.</li><li><strong>webhookbody</strong> Optionnel – définit le corps HTTP sous forme de JSON stringifié, par exemple pour envoyer des données personnalisées ou des payloads.</li></ul></td></tr></tbody></table>

## POST /addressprocessing/setbatchsettings

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Batch"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}}},"paths":{"/addressprocessing/setbatchsettings":{"post":{"tags":["Batch"],"parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}},"text/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}},"application/*+json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```
