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

# Crea evento di monitoraggio API

> Invia dal tuo backend un evento di login, gioco, bonus, pagamento, disputa o sicurezza per salvarlo, arricchirlo e valutarlo con le regole Didit.



Prompt API per la creazione di eventi di monitoraggio
        Copia il prompt negli appunti



      
      

\<pre>

\`Send one non-monetary monitoring event (login, session, gameplay, bonus, affiliate, payment, dispute, security, responsible gambling or custom) from my backend to Didit.

Endpoint:
POST https://verification.didit.me/v3/events/

Authentication:
Use the x-api-key header with my Didit API key, from my backend only. A scoped key needs transactions: write.

Goal:
\- Record what happened on my platform so Didit's event rules can score it alongside my transactions, and read the verdict from the response.

Request body (application/json):
\{
"event_id": "login-2026-10-17-000001",   // required - my id, unique per application, the idempotency key (max 128)
"event_category": "auth",                // required - auth, session, gameplay, bonus, affiliate, payment, dispute, security, responsible_gambling, custom
"action_type": "login",                  // required - what happened inside the category (max 128)
"occurred_at": "2026-10-17T09:15:02.481Z", // required - at most 7 days in the past, 5 minutes in the future
"subject": { "vendor_data": "user-42", "entity_type": "individual" }, // required - entity_type individual (default) or company
"session": { "session_id": "web-session-abc", "sequence": 142 },
"device_context": { "fingerprint": "didit-fp-v2:a8c1", "network_context": { "ip_address": "203.0.113.42" } },
"transaction_context": { "amount": "1000.00", "currency": "EUR", "payment_reference_id": "dep_735" },
"payload": { "method": "password" },     // category fields, max 16 KB
"custom_values": { "vip_tier": "gold" }  // max 100 scalar keys
}

Behavior:
\- Validated, stored, IP-enriched and evaluated by the real-time event rules before the response returns. Cross-subject and long-window rules run asynchronously within minutes (correlation_pending: true).
\- Some actions require payload keys, for example gameplay.p2p_settlement (game_id, counterparty_vendor_data, stake_amount, net_result_amount, role, and one of hand_id, round_id, match_id), payment.deposit_completed (payment_reference_id, amount, currency, payment_method, status) and dispute.chargeback_opened (payment_reference_id and one of dispute_id, chargeback_id). transaction_context keys count towards these requirements.
\- Send hashes and references, never a card number, a full withdrawal address, a password hash or an MFA secret.
\- Idempotency: the same event_id with the same event_category, action_type, occurred_at, subject.vendor_data and payload returns 200 with idempotent_replay true and the stored event's result. Different values in those fields return 409; the other fields are not compared. Retry safely on timeouts.
\- The IP address used for enrichment and rules is device_context.network_context.ip_address as you send it.
\- In a sandbox application no rules run: status is ACCEPTED and rules_evaluated_count is 0.
\- The subject resolves to the user (or company) with that vendor_data; one is created when none exists.
\- Event ingestion is opt-in: until it is switched on in Transactions > Settings > Event monitoring, this call returns 403 with code event_monitoring_disabled and stores nothing.

Example call:
curl -X POST "https://verification.didit.me/v3/events/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"event_id":"login-2026-10-17-000001","event_category":"auth","action_type":"login","occurred_at":"2026-10-17T09:15:02.481Z","subject":{"vendor_data":"user-42"},"device_context":{"network_context":{"ip_address":"203.0.113.42"}},"payload":{"method":"password"}}'

What to read from the response:
\- event_uuid - Didit id of the stored event.
\- status - ACCEPTED (stored, no rule changed it), APPROVED, IN_REVIEW or DECLINED.
\- score, rules_evaluated_count, rules_matched_count, rule_matches[] (rule_id, library_key, mode, is_async).
\- correlation_pending - when true, read GET /v3/events/{event_uuid}/ later for the final status.
\- retention_class and expires_at (null for payment and dispute events).
\- idempotent_replay - true when the event was already stored.

Failure modes:
\- 400 - validation error keyed by field (missing field, occurred_at outside the window, payload over 16 KB, nested custom_values, missing required payload keys).
\- 401 - the API key has expired.
\- 403 - missing API key (a wrong, revoked or expired key gets 401), a scoped key without transactions: write, or code event_monitoring_disabled.
\- 409 - event_id reused with different content; use a new event_id.
\- 429 - more than 600 ingestion requests per minute for this API key (event and transaction ingestion share this budget, apart from the 300 of every other write); honor Retry-After.

Side effects: stores the event, may create the subject's user or company, and applies the actions of matched active rules (score, status, tags, notes, list entries, cases).

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

Incolla in

> [!NOTE]
>
> L'acquisizione degli eventi è un'opzione da attivare. Abilitala in **Transazioni > Impostazioni > Monitoraggio eventi** prima di inviare eventi; fino ad allora questo endpoint risponde con `403` e `"code": "event_monitoring_disabled"`.[Acquisizione degli eventi](https://docs.didit.me/it/transaction-monitoring/events.md) descrive l'envelope, le dieci categorie, le chiavi obbligatorie del payload e le classi di conservazione. [Regole sugli eventi](https://docs.didit.me/it/transaction-monitoring/event-rules.md) spiegano quali regole vengono eseguite nella richiesta e quali in modo asincrono. Per inviare eventi da un browser o da un'app invece che dal tuo backend, usa [invio di eventi tramite SDK](https://docs.didit.me/it/transaction-monitoring/sdk-event-submission.md).


## OpenAPI

````yaml it/openapi-25.json POST /v3/events/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: API di verifica dell'identità. Autenticati con l'intestazione x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/events/:
    post:
      tags:
        - Monitoring Events
      summary: Crea evento di monitoraggio
      description: >-
        Invia un evento non monetario (login, session, gameplay, bonus,
        affiliate, payment, dispute, security, responsible gambling o custom)
        dal tuo backend. L'evento viene convalidato rispetto al contratto della
        sua categoria, memorizzato, arricchito con dati IP una volta per
        indirizzo pubblico univoco e valutato dalle tue regole sugli eventi in
        tempo reale prima della restituzione della risposta; le regole tra
        soggetti diversi e su finestre temporali ampie vengono eseguite in modo
        asincrono (`correlation_pending: true`), mentre in un'applicazione
        sandbox non viene eseguita alcuna regola. `event_id` è la chiave di
        idempotenza: lo stesso `event_id` con gli stessi `event_category`,
        `action_type`, `occurred_at`, `subject.vendor_data` e `payload`
        restituisce `200` con `idempotent_replay: true` e l'esito memorizzato
        (gli altri campi dell'involucro non vengono confrontati), mentre valori
        diversi restituiscono `409`. L'ingestione degli eventi è facoltativa
        (opt-in) per applicazione: finché non viene attivata, questo endpoint
        restituisce `403` con `code: event_monitoring_disabled` e non memorizza
        nulla. Una chiave API con ambito limitato richiede `transactions:
        write`. Consulta [Ingestione degli
        eventi](https://docs.didit.me/it/transaction-monitoring/events) e
        [Regole sugli
        eventi](https://docs.didit.me/it/transaction-monitoring/event-rules);
        per inviare eventi da un browser o da un'app, usa [Invio di eventi
        tramite
        SDK](https://docs.didit.me/it/transaction-monitoring/sdk-event-submission).
      operationId: create_monitoring_event
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitoringEventCreateRequest'
            examples:
              Login:
                value:
                  event_id: login-2026-10-17-000001
                  event_category: auth
                  action_type: login
                  occurred_at: '2026-10-17T09:15:02.481Z'
                  time_zone: Europe/Madrid
                  subject:
                    vendor_data: user-42
                    entity_type: individual
                  session:
                    session_id: web-session-abc
                    sequence: 142
                  device_context:
                    fingerprint: fp-a8c1
                    network_context:
                      ip_address: 203.0.113.42
                  payload:
                    method: password
                  custom_values:
                    vip_tier: gold
              Deposit completed:
                value:
                  event_id: deposit-2026-10-17-000002
                  event_category: payment
                  action_type: deposit_completed
                  occurred_at: '2026-10-17T09:16:40Z'
                  subject:
                    vendor_data: user-42
                  transaction_context:
                    amount: '100.00'
                    currency: EUR
                    direction: inbound
                    payment_reference_id: dep_736
                  payload:
                    payment_method: card
                    status: completed
              Chargeback opened:
                value:
                  event_id: chargeback-2026-10-16-000318
                  event_category: dispute
                  action_type: chargeback_opened
                  occurred_at: '2026-10-16T14:02:11Z'
                  subject:
                    vendor_data: user-42
                  payload:
                    payment_reference_id: dep_735
                    chargeback_id: cb_5521
                    amount: '250.00'
                    currency: EUR
                    reason_code: fraud
      responses:
        '200':
          description: >-
            Riproduzione idempotente: un evento con questo `event_id` e lo
            stesso contenuto è già memorizzato. Non è stato memorizzato o
            valutato nuovamente nulla; il corpo descrive l'evento memorizzato.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringEventIngestResult'
              examples:
                Replay:
                  value:
                    event_uuid: 33333333-4444-5555-6666-777777777777
                    event_id: login-2026-10-17-000001
                    status: ACCEPTED
                    score: 0
                    rules_evaluated_count: 6
                    rules_matched_count: 0
                    correlation_pending: false
                    retention_class: standard
                    expires_at: '2026-11-16T09:15:02.481000Z'
                    idempotent_replay: true
                    rule_matches: []
        '201':
          description: L'evento è stato memorizzato e valutato.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringEventIngestResult'
              examples:
                Stored, no rule matched:
                  value:
                    event_uuid: 33333333-4444-5555-6666-777777777777
                    event_id: login-2026-10-17-000001
                    status: ACCEPTED
                    score: 0
                    rules_evaluated_count: 6
                    rules_matched_count: 0
                    correlation_pending: false
                    retention_class: standard
                    expires_at: '2026-11-16T09:15:02.481000Z'
                    idempotent_replay: false
                    rule_matches: []
                Rule matched, async rule pending:
                  value:
                    event_uuid: 33333333-4444-5555-6666-777777777777
                    event_id: login-2026-10-17-000001
                    status: IN_REVIEW
                    score: 40
                    rules_evaluated_count: 6
                    rules_matched_count: 1
                    correlation_pending: true
                    retention_class: risk_relevant
                    expires_at: '2027-01-15T09:15:02.481000Z'
                    idempotent_replay: false
                    rule_matches:
                      - rule_id: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
                        library_key: null
                        mode: ACTIVE
                        is_async: false
        '400':
          description: >-
            Validazione non riuscita. Il body è indicizzato per campo; i campi
            nidificati sono oggetti nidificati. Non viene memorizzato nulla.
          content:
            application/json:
              examples:
                Missing fields:
                  value:
                    event_id:
                      - This field is required.
                    subject:
                      - This field is required.
                Unknown category:
                  value:
                    event_category:
                      - '"login" is not a valid choice.'
                occurred_at too old:
                  value:
                    occurred_at:
                      - >-
                        occurred_at is more than 7 days in the past. Use the
                        batch import lane for backfills.
                occurred_at in the future:
                  value:
                    occurred_at:
                      - occurred_at is more than 5 minutes in the future.
                Missing subject vendor_data:
                  value:
                    subject:
                      vendor_data:
                        - This field is required.
                Missing required payload keys:
                  value:
                    payload:
                      - >-
                        payment.deposit_completed requires: payment_method,
                        status.
                Missing one-of payload key:
                  value:
                    payload:
                      - >-
                        dispute.chargeback_opened requires one of: dispute_id,
                        chargeback_id.
                Security change without changed_field:
                  value:
                    payload:
                      - security.*_changed requires 'changed_field'.
                Payload too large:
                  value:
                    payload:
                      - >-
                        payload exceeds 16384 bytes. Summarise telemetry
                        client-side.
                Too many custom_values:
                  value:
                    custom_values:
                      - custom_values accepts at most 100 keys.
                Nested custom value:
                  value:
                    custom_values:
                      - >-
                        custom_values['limits'] must be a scalar - rule
                        conditions cannot address nested values.
        '401':
          description: >-
            La chiave API con ambito è scaduta. Solo una chiave scaduta riceve
            `401`; una chiave mancante o non valida riceve `403`.
          content:
            application/json:
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            Intestazione `x-api-key` mancante (una chiave errata, revocata o
            scaduta restituisce `401`), una chiave con ambito priva di
            `transactions: write`, una chiave limitata ad alcuni workflow o a
            sessioni approvate (tale chiave non accede mai ai dati di
            monitoraggio delle transazioni), oppure una richiesta proveniente
            dall'esterno dell'allowlist IP della chiave. Restituito anche con
            `code: event_monitoring_disabled` quando l'ingestione degli eventi è
            disattivata per l'applicazione; in tal caso nulla viene memorizzato
            e il controllo viene eseguito prima della validazione del corpo.
          content:
            application/json:
              examples:
                Event monitoring disabled:
                  value:
                    detail: >-
                      Event monitoring is not enabled for this application. Turn
                      on event ingestion in the transaction monitoring settings
                      before submitting events.
                    code: event_monitoring_disabled
                Missing or invalid API key:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without access:
                  value:
                    detail: This API key has no write access to transactions.
                Key limited to workflows or approved sessions:
                  value:
                    detail: >-
                      This API key only reaches sessions inside its workflow or
                      status limits, so it can't use this endpoint.
                IP not allowed:
                  value:
                    detail: This API key can't be used from this IP address.
        '409':
          description: >-
            `event_id` è già stato utilizzato per un evento con contenuto
            diverso (categoria, tipo di azione, `occurred_at`, `vendor_data` del
            soggetto o payload). Invia l'evento con un nuovo `event_id`.
          content:
            application/json:
              examples:
                event_id reused:
                  value:
                    event_id: >-
                      event_id 'login-2026-10-17-000001' already exists with a
                      different payload.
        '429':
          description: >-
            Limite di frequenza superato: le creazioni di transazioni e
            l'ingestione di eventi (`POST /v3/transactions/`, `POST
            /v3/events/`, `POST /v3/events/batch/`) condividono un budget di 600
            richieste al minuto per chiave API, separato dalle 300 condivise da
            tutte le altre richieste di scrittura. Attendi `Retry-After`
            secondi, quindi riprova.
          headers:
            Retry-After:
              description: >-
                Secondi da attendere prima di riprovare, arrotondati per eccesso
                in modo che il nuovo tentativo rientri nella finestra
                successiva.
              schema:
                type: integer
                minimum: 1
                example: 30
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    detail: >-
                      Ingestion rate limit exceeded. You can make up to 600
                      requests per minute.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/events/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "event_id": "login-2026-10-17-000001",
                "event_category": "auth",
                "action_type": "login",
                "occurred_at": "2026-10-17T09:15:02.481Z",
                "subject": {"vendor_data": "user-42", "entity_type": "individual"},
                "session": {"session_id": "web-session-abc", "sequence": 142},
                "device_context": {
                  "fingerprint": "fp-a8c1",
                  "network_context": {"ip_address": "203.0.113.42"}
                },
                "payload": {"method": "password"}
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.monitoring_events.create(
                event_id="login-2026-10-17-000001",
                event_category="auth",
                action_type="login",
                occurred_at="2026-10-17T09:15:02.481Z",
                time_zone="Europe/Madrid",
                subject={
                    "vendor_data": "user-42",
                    "entity_type": "individual",
                },
                session={
                    "session_id": "web-session-abc",
                    "sequence": 142,
                },
                device_context={
                    "fingerprint": "fp-a8c1",
                    "network_context": {
                        "ip_address": "203.0.113.42",
                    },
                },
                payload={"method": "password"},
                custom_values={"vip_tier": "gold"},
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.monitoringEvents.create({
              event_id: "login-2026-10-17-000001",
              event_category: "auth",
              action_type: "login",
              occurred_at: "2026-10-17T09:15:02.481Z",
              time_zone: "Europe/Madrid",
              subject: {
                vendor_data: "user-42",
                entity_type: "individual",
              },
              session: {
                session_id: "web-session-abc",
                sequence: 142,
              },
              device_context: {
                fingerprint: "fp-a8c1",
                network_context: {
                  ip_address: "203.0.113.42",
                },
              },
              payload: { method: "password" },
              custom_values: { vip_tier: "gold" },
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.MonitoringEvents.Create(ctx, didit.MonitoringEventCreateRequest{\n\tEventID:       \"login-2026-10-17-000001\",\n\tEventCategory: \"auth\",\n\tActionType:    \"login\",\n\tOccurredAt:    time.Date(2026, 10, 17, 9, 15, 2, 0, time.UTC),\n\tTimeZone:      didit.String(\"Europe/Madrid\"),\n\tSubject: didit.MonitoringEventCreateRequestSubject{\n\t\tVendorData: \"user-42\",\n\t\tEntityType: didit.String(\"individual\"),\n\t},\n\tSession: didit.Some(didit.MonitoringEventCreateRequestSession{\n\t\tSessionID: didit.String(\"web-session-abc\"),\n\t\tSequence:  didit.Int(142),\n\t}),\n\tDeviceContext: didit.Some(didit.MonitoringEventCreateRequestDeviceContext{\n\t\tFingerprint: didit.String(\"fp-a8c1\"),\n\t\tNetworkContext: didit.Some(didit.MonitoringEventCreateRequestDeviceContextNetworkContext{\n\t\t\tIPAddress: didit.String(\"203.0.113.42\"),\n\t\t}),\n\t}),\n\tPayload:      didit.Some(map[string]any{\"method\": \"password\"}),\n\tCustomValues: didit.Some(map[string]any{\"vip_tier\": \"gold\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.time.OffsetDateTime;

            import java.util.Map;

            import me.didit.Didit;

            import me.didit.types.MonitoringEventCreateRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.monitoringEvents().create(MonitoringEventCreateRequest.builder()
                    .eventId("login-2026-10-17-000001")
                    .eventCategory(MonitoringEventCreateRequest.EventCategory.of("auth"))
                    .actionType("login")
                    .occurredAt(OffsetDateTime.parse("2026-10-17T09:15:02.481Z"))
                    .timeZone("Europe/Madrid")
                    .subject(MonitoringEventCreateRequest.Subject.builder()
                            .vendorData("user-42")
                            .entityType("individual")
                            .build())
                    .session(MonitoringEventCreateRequest.Session.builder()
                            .sessionId("web-session-abc")
                            .sequence(142L)
                            .build())
                    .deviceContext(MonitoringEventCreateRequest.DeviceContext.builder()
                            .fingerprint("fp-a8c1")
                            .networkContext(MonitoringEventCreateRequest.DeviceContext.NetworkContext.builder()
                                    .ipAddress("203.0.113.42")
                                    .build())
                            .build())
                    .payload(Map.of("method", "password"))
                    .customValues(Map.of("vip_tier", MonitoringEventCreateRequest.CustomValuesValue.ofString("gold")))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->monitoringEvents->create([
                'event_id' => 'login-2026-10-17-000001',
                'event_category' => 'auth',
                'action_type' => 'login',
                'occurred_at' => '2026-10-17T09:15:02.481Z',
                'time_zone' => 'Europe/Madrid',
                'subject' => [
                    'vendor_data' => 'user-42',
                    'entity_type' => 'individual',
                ],
                'session' => [
                    'session_id' => 'web-session-abc',
                    'sequence' => 142,
                ],
                'device_context' => [
                    'fingerprint' => 'fp-a8c1',
                    'network_context' => [
                        'ip_address' => '203.0.113.42',
                    ],
                ],
                'payload' => ['method' => 'password'],
                'custom_values' => ['vip_tier' => 'gold'],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.monitoring_events.create(
              event_id: "login-2026-10-17-000001",
              event_category: "auth",
              action_type: "login",
              occurred_at: "2026-10-17T09:15:02.481Z",
              time_zone: "Europe/Madrid",
              subject: {
                vendor_data: "user-42",
                entity_type: "individual",
              },
              session: {
                session_id: "web-session-abc",
                sequence: 142,
              },
              device_context: {
                fingerprint: "fp-a8c1",
                network_context: {
                  ip_address: "203.0.113.42",
                },
              },
              payload: { method: "password" },
              custom_values: { vip_tier: "gold" }
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Collections.Generic;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.MonitoringEvents.CreateAsync(new
            MonitoringEventCreateRequest

            {
                EventId = "login-2026-10-17-000001",
                EventCategory = "auth",
                ActionType = "login",
                OccurredAt = DateTimeOffset.Parse("2026-10-17T09:15:02.481Z"),
                TimeZone = "Europe/Madrid",
                Subject = new()
                {
                    VendorData = "user-42",
                    EntityType = "individual",
                },
                Session = new MonitoringEventCreateRequestSession
                {
                    SessionId = "web-session-abc",
                    Sequence = 142,
                },
                DeviceContext = new MonitoringEventCreateRequestDeviceContext
                {
                    Fingerprint = "fp-a8c1",
                    NetworkContext = new MonitoringEventCreateRequestDeviceContextNetworkContext
                    {
                        IpAddress = "203.0.113.42",
                    },
                },
                Payload = new Dictionary<string, object> { ["method"] = "password" },
                CustomValues = new Dictionary<string, object> { ["vip_tier"] = "gold" },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    MonitoringEventCreateRequest:
      type: object
      description: >-
        L'envelope dell'evento, lo stesso per ogni categoria. Sono accettati gli
        alias in camelCase: `eventId`, `eventCategory` (o `category`),
        `actionType`, `occurredAt`, `timeZone` (o `zoneId`), `deviceContext` (o
        `device`), `transactionContext`, `customValues` (o `props`); all'interno
        di `subject`: `vendorData`, `entityType`, `fullName`; all'interno di
        `session`: `sessionId`, `pageUrl`; all'interno di `transaction_context`:
        `paymentReferenceId`.
      required:
        - event_id
        - event_category
        - action_type
        - occurred_at
        - subject
      properties:
        event_id:
          type: string
          maxLength: 128
          description: >-
            Il tuo identificatore per l'evento, univoco per applicazione. È la
            chiave di idempotenza: il reinvio, con questo identificatore, degli
            stessi valori di `event_category`, `action_type`, `occurred_at`,
            `subject.vendor_data` e `payload` costituisce un replay, qualsiasi
            elemento differente genera un conflitto.
          example: login-2026-10-17-000001
        event_category:
          type: string
          enum:
            - auth
            - session
            - gameplay
            - bonus
            - affiliate
            - payment
            - dispute
            - security
            - responsible_gambling
            - custom
          description: Categoria dell'evento.
          example: auth
        action_type:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            Cosa è successo all'interno della categoria. Vocabolario aperto; le
            azioni gestite elencate in [Event
            ingestion](https://docs.didit.me/it/transaction-monitoring/events)
            (ad esempio `login`, `deposit_completed`, `chargeback_opened`)
            sbloccano la convalida tipizzata e i campi delle regole gestite. Gli
            spazi vuoti iniziali e finali vengono rimossi.
          example: login
        occurred_at:
          type: string
          format: date-time
          description: >-
            Data e ora in cui l'evento si è verificato nel tuo sistema, ISO 8601
            (un valore senza offset viene interpretato come UTC). Non deve
            essere antecedente a più di 7 giorni nel passato né può essere più
            di 5 minuti nel futuro.
          example: '2026-10-17T09:15:02.481Z'
        time_zone:
          type: string
          nullable: true
          maxLength: 64
          description: >-
            Fuso orario dell'evento dal tuo lato, ad esempio `Europe/Madrid`.
            Memorizzato con l'evento; non restituito dagli endpoint di lettura.
        subject:
          type: object
          description: >-
            L'utente o l'azienda a cui appartiene l'evento. Si risolve
            nell'utente (o azienda) con questo `vendor_data` nella tua
            applicazione; ne viene creato uno se non ne esiste alcuno.
          required:
            - vendor_data
          properties:
            vendor_data:
              type: string
              minLength: 1
              maxLength: 255
              description: Il tuo ID per il soggetto.
              example: user-42
            entity_type:
              type: string
              maxLength: 32
              default: individual
              description: >-
                `company` risolve il soggetto in un'azienda; qualsiasi altro
                valore (predefinito `individual`) lo risolve in una persona
                fisica. Lo stesso `vendor_data` può indicare uno per ciascun
                tipo.
              example: individual
            full_name:
              type: string
              nullable: true
              maxLength: 512
              description: >-
                Nome visualizzato, utilizzato solo quando questo evento crea
                l'utente o l'azienda.
            email:
              type: string
              format: email
              nullable: true
              description: Validato come indirizzo email; non memorizzato sull'evento.
            phone:
              type: string
              nullable: true
              maxLength: 32
              description: Validato; non memorizzato sull'evento.
            country:
              type: string
              nullable: true
              maxLength: 3
              description: Validato; non memorizzato sull'evento.
        business:
          type: object
          description: >-
            L'azienda a cui appartiene l'evento, quando differisce dal soggetto.
            Viene letto solo `vendor_data`.
          additionalProperties: true
          properties:
            vendor_data:
              type: string
              maxLength: 255
              description: Il tuo ID per l'azienda. Filtrabile come `business_vendor_data`.
              example: merchant-7
        session:
          type: object
          description: Il contesto della tua sessione per l'evento.
          properties:
            session_id:
              type: string
              nullable: true
              maxLength: 255
              description: >-
                Il tuo identificatore di sessione. Filtrabile e restituito come
                `session_id`.
            sequence:
              type: integer
              nullable: true
              description: >-
                Posizione dell'evento all'interno della sessione. Restituita
                come `session_sequence`.
            page_url:
              type: string
              nullable: true
              maxLength: 2048
              description: Validato; non memorizzato sull'evento.
            referrer:
              type: string
              nullable: true
              maxLength: 2048
              description: Validato; non memorizzato sull'evento.
        device_context:
          type: object
          additionalProperties: true
          description: >-
            Contesto del dispositivo e di rete, memorizzato così come inviato e
            restituito da `GET /v3/events/{event_uuid}/`. In questo canale
            server Didit non vede la connessione dell'utente finale, quindi l'IP
            arricchito e utilizzato dalle regole è `network_context.ip_address`
            esattamente come inviato.
          properties:
            fingerprint:
              type: string
              maxLength: 255
              description: >-
                Fingerprint del dispositivo. Filtrabile come
                `device_fingerprint`.
            persistent_device_id:
              type: string
              maxLength: 255
              description: Il tuo identificatore persistente del dispositivo.
            bot_score:
              type: integer
              description: >-
                Punteggio bot dal tuo sistema di rilevamento, come numero
                intero.
            network_context:
              type: object
              additionalProperties: true
              properties:
                ip_address:
                  type: string
                  maxLength: 64
                  description: >-
                    Indirizzo IP dell'utente finale. Gli indirizzi pubblici
                    vengono arricchiti una sola volta per ciascun indirizzo
                    univoco.
                  example: 203.0.113.42
        transaction_context:
          type: object
          description: >-
            Contesto monetario. I valori non vuoti qui presenti soddisfano anche
            le chiavi obbligatorie del payload dell'azione.
          properties:
            amount:
              type: string
              nullable: true
              description: Importo come stringa decimale (è accettato anche un numero).
              example: '1000.00'
            currency:
              type: string
              nullable: true
              maxLength: 10
              description: Codice valuta.
            direction:
              type: string
              nullable: true
              maxLength: 16
              description: >-
                Direzione del movimento di denaro, ad esempio `inbound` o
                `outbound`.
            payment_reference_id:
              type: string
              nullable: true
              maxLength: 255
              description: >-
                Il tuo riferimento di pagamento. Filtrabile come
                `payment_reference_id`.
        payload:
          type: object
          additionalProperties: true
          description: >-
            I campi di dominio della categoria, massimo 16384 byte una volta
            codificati in JSON. Alcune azioni richiedono chiavi (in `payload` o
            in `transaction_context`): `gameplay.p2p_settlement` richiede
            `game_id`, `counterparty_vendor_data`, `stake_amount`,
            `net_result_amount`, `role` e uno tra `hand_id`, `round_id`,
            `match_id`; `gameplay.bet_placed` e `gameplay.bet_settled`
            richiedono `game_id`; `payment.deposit_initiated`,
            `payment.deposit_completed`, `payment.withdrawal_requested` e
            `payment.withdrawal_completed` richiedono `payment_reference_id`,
            `amount`, `currency`, `payment_method`, `status`;
            `payment.withdrawal_address_changed` richiede
            `withdrawal_address_hash`; `dispute.chargeback_opened`,
            `dispute.chargeback_won` e `dispute.chargeback_lost` richiedono
            `payment_reference_id` e uno tra `dispute_id`, `chargeback_id`;
            `session.bot_signal_observed` richiede `telemetry_schema_version` e
            uno tra `bot_score`, `actions_per_minute`, `timing_variance_ms`,
            `pointer_entropy`, `keystroke_entropy`, `reaction_time_ms_p50`;
            `responsible_gambling.self_exclusion_match` richiede
            `registry_source`, `exclusion_status`, `identity_match_ref`. Ogni
            azione `security` che termina con `_changed` richiede
            `changed_field`, oltre a `previous_reference_hash` o
            `new_reference_hash` quando il campo è `password`, `mfa_method`,
            `mfa`, `email`, `phone`, `withdrawal_address`, `payout_method` o
            `api_key`. Invia hash e riferimenti, mai un numero di carta, un
            indirizzo di prelievo completo, un hash della password o un segreto
            MFA.
        custom_values:
          type: object
          description: >-
            Fino a 100 chiavi personalizzate, indirizzabili dalle regole come
            `custom_values.<key>`. I valori devono essere scalari (stringa,
            numero, booleano o null); oggetti e array annidati vengono
            rifiutati.
          additionalProperties:
            nullable: true
            oneOf:
              - type: string
              - type: number
              - type: boolean
      example:
        event_id: login-2026-10-17-000001
        event_category: auth
        action_type: login
        occurred_at: '2026-10-17T09:15:02.481Z'
        time_zone: Europe/Madrid
        subject:
          vendor_data: user-42
          entity_type: individual
        session:
          session_id: web-session-abc
          sequence: 142
        device_context:
          fingerprint: fp-a8c1
          network_context:
            ip_address: 203.0.113.42
        payload:
          method: password
        custom_values:
          vip_tier: gold
    MonitoringEventIngestResult:
      type: object
      description: >-
        Esito dell'acquisizione di un evento. Viene restituita la stessa
        struttura sia per un nuovo evento sia per una ripetizione idempotente.
      required:
        - event_uuid
        - event_id
        - status
        - score
        - rules_evaluated_count
        - rules_matched_count
        - correlation_pending
        - retention_class
        - expires_at
        - idempotent_replay
        - rule_matches
      properties:
        event_uuid:
          type: string
          format: uuid
          description: Identificatore Didit dell'evento memorizzato.
        event_id:
          type: string
          description: Il tuo `event_id`.
        status:
          type: string
          enum:
            - ACCEPTED
            - APPROVED
            - IN_REVIEW
            - DECLINED
          description: >-
            Stato dopo l'esecuzione delle regole in tempo reale. Vedi
            `MonitoringEvent.status`.
        score:
          type: integer
          description: Punteggio ottenuto dopo l'esecuzione delle regole in tempo reale.
        rules_evaluated_count:
          type: integer
          minimum: 0
          description: >-
            Numero di regole di evento valutate nella richiesta. 0 in
            un'applicazione sandbox, in cui non viene eseguita alcuna regola.
        rules_matched_count:
          type: integer
          minimum: 0
          description: >-
            Numero di regole che hanno trovato corrispondenza, incluse le regole
            in modalità `TEST`.
        correlation_pending:
          type: boolean
          description: >-
            `true` quando una regola asincrona deve ancora essere eseguita.
            Leggi `GET /v3/events/{event_uuid}/` qualche minuto dopo per
            ottenere `status` e `score` definitivi.
        retention_class:
          type: string
          enum:
            - low_value
            - standard
            - risk_relevant
            - monetary_or_compliance
          description: >-
            Classe di conservazione, dopo l'eventuale promozione applicata da
            una regola corrispondente.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Data e ora di scadenza ed eliminazione dell'evento in base alla
            relativa classe di conservazione. Null per gli eventi
            `monetary_or_compliance` (pagamento e contestazione).
        idempotent_replay:
          type: boolean
          description: >-
            `true` quando un evento con questo `event_id` e lo stesso contenuto
            era già memorizzato; i valori sono quelli dell'evento memorizzato e
            nessuna regola è stata rieseguita.
        rule_matches:
          type: array
          description: Regole che hanno prodotto una corrispondenza con l'evento.
          items:
            type: object
            required:
              - rule_id
              - library_key
              - mode
              - is_async
            properties:
              rule_id:
                type: string
                format: uuid
                description: UUID della regola.
              library_key:
                type: string
                nullable: true
                description: >-
                  Chiave della libreria se la regola è stata installata dalla
                  libreria di regole, altrimenti null.
              mode:
                type: string
                enum:
                  - ACTIVE
                  - TEST
                description: >-
                  Le regole `TEST` registrano la corrispondenza ma non applicano
                  alcuna azione.
              is_async:
                type: boolean
                description: >-
                  `true` quando la corrispondenza proviene dal passaggio
                  asincrono.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        La chiave API della tua applicazione, da Developers -> API keys nella
        Business Console. La chiave primaria ha accesso completo. Una chiave con
        nome può avere un ambito definito: nessuno, lettura o scrittura per
        risorsa, limitata ad alcuni workflow o a sessioni approvate, a un elenco
        di indirizzi IP e a una data di scadenza. 401 indica che la chiave è
        errata, revocata o scaduta; 403 indica che non è stata inviata alcuna
        chiave, che la chiave non ha accesso a questa risorsa o azione, oppure
        che la richiesta proviene da un indirizzo non incluso nel suo elenco IP;
        404 su una route di sessione indica che la sessione non rientra nei
        workflow o negli stati previsti dalla chiave. Una chiave senza accesso
        ai media riceve gli URL di immagini, video e PDF come null, e una chiave
        senza permessi di scrittura sulle sessioni riceve link e token di
        sessione come null. Consulta https://docs.didit.me/console/api-keys.

````

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