> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minimo.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Record Guest Consent

> Record the marketing consent a guest gave to one restaurant, with evidence

Guide: [Consent, unsubscribe and preferences](https://docs.minimo.it/embedded/consent.md). Errors: [Errors and limits](https://docs.minimo.it/embedded/errors.md).


## OpenAPI

````yaml put /public/v1/tenants/{tenant}/subscriptions
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /public/v1/tenants/{tenant}/subscriptions:
    servers:
      - url: https://api.minimo.it
    put:
      summary: Record guest consent
      description: >-
        Records the marketing consent (or its withdrawal) a guest gave to one
        restaurant in your forms, with evidence. A restaurant's marketing email
        only reaches guests with this consent. See [Consent](/embedded/consent).


        Up to 500 guests per call. Each guest gets its own `outcome`. Safe to
        repeat. `POST` works the same.
      operationId: recordGuestConsent
      parameters:
        - name: tenant
          in: path
          required: true
          description: >-
            Your reference for the customer (for example the restaurant id). 1
            to 64 letters, digits, `.` `_` `:` `-`.
          schema:
            type: string
            example: restaurant_4812
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subscriptions:
                  type: array
                  items:
                    $ref: '#/components/schemas/TenantSubscriptionInput'
                  description: 1 to 500 guests.
              required:
                - subscriptions
            example:
              subscriptions:
                - email: anna@example.com
                  status: subscribed
                  source: booking
                  firstName: Anna
                  evidence:
                    ref: booking:9921
                    consentText: I want offers and news from Trattoria da Mario by email.
                    consentedAt: '2026-11-08T19:30:00+01:00'
      responses:
        '200':
          description: One result per guest
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      tenant:
                        type: string
                        example: restaurant_4812
                      results:
                        type: array
                        items:
                          $ref: '#/components/schemas/TenantSubscriptionResult'
                    required:
                      - tenant
                      - results
              example:
                data:
                  tenant: restaurant_4812
                  results:
                    - index: 0
                      email: anna@example.com
                      contactId: 4521
                      outcome: subscribed
                      error: null
                      code: null
        '401':
          description: >-
            `INVALID_TOKEN`: missing or wrong key, or a key without the
            **Widgets** or **Events** permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: '`TENANT_CONSENT_NOT_ENABLED`: save the widget settings first.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: '`INVALID_TENANT`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: '`TENANT_CREATION_LIMIT_REACHED`: too many new restaurants today.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: |-
            curl --request PUT \
              --url 'https://api.minimo.it/public/v1/tenants/restaurant_4812/subscriptions' \
              --header 'Authorization: Bearer YOUR_MINIMO_KEY' \
              --header 'Content-Type: application/json' \
              --data '{"subscriptions": [{"email": "anna@example.com", "status": "subscribed", "source": "booking", "firstName": "Anna", "evidence": {"ref": "booking:9921", "consentText": "I want offers and news from Trattoria da Mario by email.", "consentedAt": "2026-11-08T19:30:00+01:00"}}]}'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/tenants/restaurant_4812/subscriptions',
            {
              method: 'PUT',
              headers: {
                Authorization: 'Bearer YOUR_MINIMO_KEY',
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({"subscriptions": [{"email": "anna@example.com", "status": "subscribed", "source": "booking", "firstName": "Anna", "evidence": {"ref": "booking:9921", "consentText": "I want offers and news from Trattoria da Mario by email.", "consentedAt": "2026-11-08T19:30:00+01:00"}}]}),
            });

            const { data } = await res.json();

            console.log(data);
        - lang: Python
          source: |-
            import requests

            res = requests.put(
                'https://api.minimo.it/public/v1/tenants/restaurant_4812/subscriptions',
                headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
                json={"subscriptions": [{"email": "anna@example.com", "status": "subscribed", "source": "booking", "firstName": "Anna", "evidence": {"ref": "booking:9921", "consentText": "I want offers and news from Trattoria da Mario by email.", "consentedAt": "2026-11-08T19:30:00+01:00"}}]},
            )
            print(res.status_code, res.text)
components:
  schemas:
    TenantSubscriptionInput:
      type: object
      properties:
        email:
          type: string
          description: The guest. Exactly one of `email` or `contactId`.
          example: anna@example.com
        contactId:
          type: integer
          example: 4521
        status:
          type: string
          enum:
            - subscribed
            - unsubscribed
        source:
          type: string
          enum:
            - api
            - booking
            - import
          description: Where the consent was collected. Default `api`.
        evidence:
          $ref: '#/components/schemas/ConsentEvidence'
          description: Required with `subscribed`.
        firstName:
          type: string
          example: Anna
        lastName:
          type: string
          example: Rossi
        reason:
          type: string
          description: 'With `unsubscribed`: why. Stored with the record.'
          example: Guest unticked the box
      required:
        - status
    TenantSubscriptionResult:
      type: object
      properties:
        index:
          type: integer
          description: Position in your list.
          example: 0
        email:
          type: string
          nullable: true
          example: anna@example.com
        contactId:
          type: integer
          nullable: true
          example: 4521
        outcome:
          type: string
          enum:
            - subscribed
            - unchanged
            - unsubscribed
            - skipped_opted_out
            - contact_not_found
            - invalid
          description: >-
            `subscribed` / `unsubscribed`: written. `unchanged`: already so.
            `skipped_opted_out`: the guest unsubscribed and no later consent was
            proven (`evidence.consentedAt`). `contact_not_found`: withdrawal for
            an unknown guest. `invalid`: see `error`.
        error:
          type: string
          nullable: true
          example: evidence.ref is required
        code:
          type: string
          nullable: true
          enum:
            - invalid_email
            - disposable_email
            - role_email
          description: >-
            Why a subscription was refused for list quality: a malformed
            address, a throwaway mailbox or a generic mailbox (`info@`,
            `noreply@`). Withdrawals are never refused.
      required:
        - index
        - outcome
    ApiError:
      type: object
      properties:
        status:
          type: string
          example: FAIL
        message:
          type: string
          description: The error code to test in your code.
          example: INVALID_PARAMETERS
        userMessage:
          type: string
          description: >-
            When present, a sentence that says what to fix. You can show or log
            it.
          example: Set the origins allowed to embed the widgets first.
      description: >-
        Every error has this shape. See [Errors and limits](/embedded/errors)
        for every code.
    ConsentEvidence:
      type: object
      properties:
        ref:
          type: string
          description: 'Your reference of the consent: the booking, the form, the signup.'
          example: booking:8842
        ip:
          type: string
          example: 203.0.113.7
        userAgent:
          type: string
          example: Mozilla/5.0 (iPhone; …)
        consentText:
          type: string
          description: The consent text the guest saw.
          example: I want offers and news from Trattoria da Mario by email.
        consentVersion:
          type: string
          example: booking-form-v3
        legalBasis:
          type: string
          description: For example `consent` or `soft_opt_in`. Default `consent`.
          example: consent
        consentedAt:
          type: string
          description: >-
            When the guest agreed (ISO 8601). Needed to subscribe again a guest
            who unsubscribed: only a consent given after the withdrawal counts.
          example: '2026-11-08T19:30:00+01:00'
        formId:
          type: string
          example: form-42
        bookingRef:
          type: string
          example: '8842'
      required:
        - ref
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.