# Create or update cold-calling consent

Creates or updates the cold-calling consent (consentement anti-démarchage)
for a customer.
**Behavior:**
- One consent record per customer (upsert).
- If the customer previously had their consent revoked, calling this endpoint

reactivates it (clears the revocation date).
- Proof files (
`proofs`
) are uploaded to the customer's cloud storage (ImmoCloud) under

`Documents confidentiels/Consentement`
 subfolder.
- If a proof file cannot be stored, the request fails with
`502`
 and the

consent is
**not**
 recorded (no partial save).

**Content-Type:** Use `multipart/form-data` when uploading proof files,
or `application/json` when no files are attached.

Endpoint: POST /customers/{customerId}/consent
Version: 1.6.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer opaque

## Path parameters:

  - `customerId` (integer, required)
    Unique identifier of the customer.

## Request fields (multipart/form-data):

  - `reason` (string, required)
    Reason/motive for the consent (e.g. "Accord verbal", "Formulaire signé").
    Example: Accord verbal lors de la visite

  - `accept_outside_hours` (boolean)
    Whether the customer accepts being contacted outside business hours.
    Example: true

  - `proofs` (array | null)
    Proof files (scanned documents, signed forms, etc.).
Files are uploaded to the customer's cloud storage (ImmoCloud) under `Documents confidentiels/Consentement` subfolder.
Only used with `multipart/form-data` content type.

  - `consent_date` (string | null)
    Date when consent was given. ISO 8601 format.
Defaults to current date/time when omitted.
    Example: 2026-06-15T10:00:00+02:00

## Response 204:

  - `204` (unknown)
    Consent created or updated successfully

## Response 403:

  - `403` (unknown)
    Access denied. The error `code` is always `FORBIDDEN`; the `message` gives the cause:
- `You do not have permission to perform this action.`
 — the access does not

hold the API pack / right required by the endpoint.
- `Insufficient scope for this request.`
 — the resource targeted by the request

(user, customer, product, agency, transaction, ...) is outside the scope of

the authenticated access.
- `Access denied for this editor.`
 /
`Your IP address has been blocked.`
 —

editor or IP restriction.

## Response 403 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 422:

  - `422` (unknown)
    Validation failed

## Response 422 fields (application/json):

  - `error` (object)

  - `error.code` (string)
    Enum: "VALIDATION_ERROR"

  - `error.message` (string)

  - `error.details` (array)

  - `error.details.field` (string)

  - `error.details.message` (string)

## Response 502:

  - `502` (unknown)
    An upstream dependency failed to process the request

## Response 502 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 403 examples:

  - `Missing API pack / right` (unknown)

  - `Resource outside the scope of the access` (unknown)

