{
  "x-generator": "NSwag v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))",
  "openapi": "3.0.0",
  "info": {
    "title": "Azimea API",
    "description": "Send contacts, events, catalogue items and transactional email from your own systems, and read contacts and orders. Every request carries an API key made in Settings › API keys: `Authorization: Bearer azm_live_…`. Each key holds only the permissions given to it. Every answer has the same envelope: `{ isSuccess, value, status, errors, fieldErrors }`; an error carries a `code`, listed in the docs' error codes catalog.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://dashboard.azimea.com",
      "description": "Production (EU)"
    }
  ],
  "paths": {
    "/api/v1/contact-attributes": {
      "post": {
        "tags": [
          "Contact-Attributes"
        ],
        "summary": "Create a contact field",
        "description": "Defines a custom attribute before any contact carries it, so its type is fixed: a value is then stored as that type everywhere, and a rule like greater than 5000 means one thing in every segment. The key is lowercase letters, digits and underscores, starting with a letter, up to 40 characters (audience.attribute_key_invalid); a built-in field's name is refused (audience.attribute_reserved), an existing key gives 409 audience.attribute_exists, and a company has at most 100 fields (audience.attribute_limit_reached). The label defaults to the key made readable. Needs contacts:write.",
        "operationId": "createContactAttribute",
        "requestBody": {
          "x-name": "CreateContactAttributeRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactAttributeRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "The field as defined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfContactAttributeDefinitionDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "key": "plan",
                    "label": "Plan",
                    "type": "Text",
                    "description": "The subscription plan the person is on.",
                    "createdFrom": "Api",
                    "createdAt": "2026-10-05T09:30:00+00:00",
                    "archivedAt": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": [
          "Contact-Attributes"
        ],
        "summary": "List contact fields",
        "description": "The company's own contact fields (custom attributes), archived ones included, ordered by key: the keys you can send in a contact's attributes and use in segment rules, each with its type (Text, Number, Boolean, Date, DateTime, TextList) and where it was created (Ui, Api, Csv). Needs contacts:read.",
        "operationId": "getContactAttributes",
        "responses": {
          "200": {
            "description": "Every contact field definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfIReadOnlyListOfContactAttributeDefinitionDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": [
                    {
                      "key": "plan",
                      "label": "Plan",
                      "type": "Text",
                      "description": "The subscription plan the person is on.",
                      "createdFrom": "Api",
                      "createdAt": "2026-10-05T09:30:00+00:00",
                      "archivedAt": null
                    }
                  ],
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/contacts/{reference}": {
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Erase a contact",
        "description": "Erases a person at their request (GDPR right to erasure), the same way the dashboard does: their name, address, attributes, tags and consent history are removed, a single anonymous row remains so a later import does not bring them back, and the other parts of Azimea erase theirs (timeline, flow runs, messages, orders, reports). It cannot be undone. `reference` is the contact's Azimea id, `ext:<your id>` or `email:<address>`; the last two find only contacts your system or an import created, a store's customers are found by their Azimea id. A contact already erased is not found again (404): nothing is left to erase. Needs the `contacts:erase` permission, which no other permission includes.",
        "operationId": "eraseContact",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The erased contact's id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfErasedContactDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "id": "01a10900-0000-7000-8000-000000000101"
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:erase permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact",
        "description": "One contact, named by Azimea's id (any contact, store ones included), by ext:<your user id> or by email:<address>. The ext: and email: forms find only contacts your own systems created (API or import), not those a connected store brings: a store's customers are found by their Azimea id. A reference in none of the three forms is refused with audience.contact_reference_invalid. Needs contacts:read.",
        "operationId": "getContactByReference",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contact, with its consent status, tags and custom attributes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfContactDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "id": "01a10a3c-5e2f-7b41-9c0d-4f7a2b6e1d90",
                    "storeId": null,
                    "email": "ana.popescu@example.com",
                    "firstName": "Ana",
                    "lastName": "Popescu",
                    "phone": "+40721000000",
                    "city": "Cluj-Napoca",
                    "countryCode": "RO",
                    "consentStatus": "Subscribed",
                    "isPayingCustomer": false,
                    "orderCount": 0,
                    "totalSpent": 0,
                    "lastOrderAt": null,
                    "sourceCreatedAt": null,
                    "lastSyncedAt": null,
                    "fromOrders": false,
                    "consentSource": "api",
                    "consentUpdatedAt": "2026-10-05T09:30:00+00:00",
                    "storeConsentMode": null,
                    "marketingDeclared": false,
                    "tags": [
                      "trial"
                    ],
                    "attributes": {
                      "plan": "pro",
                      "seats": 12
                    },
                    "lastOpenAt": null,
                    "lastClickAt": null,
                    "lastEmailedAt": null,
                    "language": "ro",
                    "addedAt": "2026-10-05T09:30:00+00:00",
                    "lastConversionAt": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "A page of the company's contacts for its own systems, newest first: everyone (store, import and API contacts alike), or only the people of one segment (segment, an id from GET /segments), the same people a campaign or a flow aimed at that segment would reach. page from 1, pageSize 1 to 200 (default 50); totalCount tells how many pages there are. Needs contacts:read.",
        "operationId": "listContacts",
        "parameters": [
          {
            "name": "segment",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "guid",
              "nullable": true
            },
            "example": "01a10a3c-6b7d-7c52-8e1f-2a3b4c5d6e7f"
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 1
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 100
          }
        ],
        "responses": {
          "200": {
            "description": "A page of contacts with the total count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfContactPageDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "items": [
                      {
                        "id": "01a10a3c-5e2f-7b41-9c0d-4f7a2b6e1d90",
                        "storeId": null,
                        "email": "ana.popescu@example.com",
                        "firstName": "Ana",
                        "lastName": "Popescu",
                        "phone": "+40721000000",
                        "city": "Cluj-Napoca",
                        "countryCode": "RO",
                        "consentStatus": "Subscribed",
                        "isPayingCustomer": false,
                        "orderCount": 0,
                        "totalSpent": 0,
                        "lastOrderAt": null,
                        "sourceCreatedAt": null,
                        "lastSyncedAt": null,
                        "fromOrders": false,
                        "consentSource": "api",
                        "consentUpdatedAt": "2026-10-05T09:30:00+00:00",
                        "storeConsentMode": null,
                        "marketingDeclared": false,
                        "tags": [
                          "trial"
                        ],
                        "attributes": {
                          "plan": "pro",
                          "seats": 12
                        },
                        "lastOpenAt": null,
                        "lastClickAt": null,
                        "lastEmailedAt": null,
                        "language": "ro",
                        "addedAt": "2026-10-05T09:30:00+00:00",
                        "lastConversionAt": null
                      }
                    ],
                    "page": 1,
                    "pageSize": 100,
                    "totalCount": 1
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create or update a contact",
        "description": "Writes one person from your own system. The contact is found by id, then externalId (your user id), then email, and created when none matches (an email is then required: audience.contact_email_required); a user id and an email that point at two different contacts are refused, never merged (409 audience.contact_identity_conflict). Fields left out stay as they are; attributes is a patch (a key sent is set, null removes it), and an unknown attribute key is created when the contact settings allow it, refused with audience.attribute_unknown otherwise. consent only moves up: Customer makes an existing customer, Subscribed needs proof.text (audience.consent_proof_required) and also brings back someone who unsubscribed, Unsubscribed stops marketing only; a bounce or a complaint is never lifted. topics turns topics on or off by key (topics.not_found, topics.archived). A store's contact keeps the email, id and consent the store syncs (audience.contact_store_managed), except an unsubscribe, which is always honoured. A new contact counts toward the plan (audience.contact_limit_reached). Sending the same contact twice leaves it as the first call did, so retries are safe. Needs contacts:write.",
        "operationId": "upsertContact",
        "requestBody": {
          "x-name": "UpsertContactRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertContactRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "The contact as stored, and whether it was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfUpsertContactResponseDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "contact": {
                      "id": "01a10a3c-5e2f-7b41-9c0d-4f7a2b6e1d90",
                      "storeId": null,
                      "email": "ana.popescu@example.com",
                      "firstName": "Ana",
                      "lastName": "Popescu",
                      "phone": "+40721000000",
                      "city": "Cluj-Napoca",
                      "countryCode": "RO",
                      "consentStatus": "Subscribed",
                      "isPayingCustomer": false,
                      "orderCount": 0,
                      "totalSpent": 0,
                      "lastOrderAt": null,
                      "sourceCreatedAt": null,
                      "lastSyncedAt": null,
                      "fromOrders": false,
                      "consentSource": "api",
                      "consentUpdatedAt": "2026-10-05T09:30:00+00:00",
                      "storeConsentMode": null,
                      "marketingDeclared": false,
                      "tags": [
                        "trial"
                      ],
                      "attributes": {
                        "plan": "pro",
                        "seats": 12
                      },
                      "lastOpenAt": null,
                      "lastClickAt": null,
                      "lastEmailedAt": null,
                      "language": "ro",
                      "addedAt": "2026-10-05T09:30:00+00:00",
                      "lastConversionAt": null
                    },
                    "created": true
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/segments": {
      "get": {
        "tags": [
          "Segments"
        ],
        "summary": "List segments",
        "description": "The company's saved segments with their live counts: count is everyone the segment's rule picks now, sendableCount those Azimea may email. Pass a segment's id to GET /contacts?segment= to read its people. Needs contacts:read.",
        "operationId": "listSegments",
        "responses": {
          "200": {
            "description": "Every segment, with its rule and counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfIReadOnlyListOfSegmentListItemDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": [
                    {
                      "id": "01a10a3c-6b7d-7c52-8e1f-2a3b4c5d6e7f",
                      "name": "Pro plan",
                      "description": "Everyone on the pro plan.",
                      "definition": {
                        "join": "All",
                        "rules": [
                          {
                            "fieldKey": "plan",
                            "operator": "Equals",
                            "value": "pro"
                          }
                        ]
                      },
                      "builtInKey": null,
                      "count": 412,
                      "sendableCount": 377
                    }
                  ],
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/topics": {
      "get": {
        "tags": [
          "Topics"
        ],
        "summary": "List topics",
        "description": "The company's active email topics, the keys a contact's topics can turn on or off in POST /contacts. Archived topics are left out: they can no longer be set. Needs contacts:read.",
        "operationId": "listTopics",
        "responses": {
          "200": {
            "description": "Every active topic",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfIReadOnlyListOfTopicDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": [
                    {
                      "id": "01a10a3c-7a8b-7d63-9f20-3b4c5d6e7f80",
                      "key": "product_news",
                      "name": "Product news",
                      "description": "New features and changes, about once a month.",
                      "isArchived": false
                    }
                  ],
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/contact-attributes/{key}": {
      "patch": {
        "tags": [
          "Contact-Attributes"
        ],
        "summary": "Update a contact field",
        "description": "Renames or describes a custom attribute, or archives it (archived: true hides it from pickers and keeps every stored value; false brings it back). Its key and type never change: rules and stored values rely on them. Needs contacts:write.",
        "operationId": "updateContactAttribute",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateContactAttributeRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactAttributeRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "The field as it is now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfContactAttributeDefinitionDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "key": "plan",
                    "label": "Subscription plan",
                    "type": "Text",
                    "description": "The subscription plan the person is on.",
                    "createdFrom": "Api",
                    "createdAt": "2026-10-05T09:30:00+00:00",
                    "archivedAt": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/contacts/batch": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create or update contacts in bulk",
        "description": "Up to 1,000 contacts in one call, each written exactly as POST /contacts would and each refused on its own: one invalid contact does not stop the others. The answer lists every contact in the order sent, with its status (Created, Updated or Failed), its id or its errors (code, field, params), and the totals. More than 1,000 is refused with audience.batch_too_large. The whole batch counts as one call for the rate limit. Needs contacts:write.",
        "operationId": "upsertContactsBatch",
        "requestBody": {
          "x-name": "UpsertContactsBatchRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertContactsBatchRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Totals and one result per contact, in the order sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfUpsertContactsBatchResponseDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "created": 1,
                    "updated": 0,
                    "failed": 1,
                    "results": [
                      {
                        "index": 0,
                        "status": "Created",
                        "id": "01a10a3c-5e2f-7b41-9c0d-4f7a2b6e1d90",
                        "errors": null
                      },
                      {
                        "index": 1,
                        "status": "Failed",
                        "id": null,
                        "errors": [
                          {
                            "code": "validation.email",
                            "field": "Email",
                            "params": null
                          }
                        ]
                      }
                    ]
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the contacts:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/items/{externalId}": {
      "delete": {
        "tags": [
          "Items"
        ],
        "summary": "Delete a catalogue item",
        "description": "Removes one of the items your system sent, by your own id (`externalId`), so emails stop recommending it. To keep its history instead, send it again with `active: false`. Items synced from a connected store cannot be deleted here. Needs the `items:write` permission.",
        "operationId": "deleteItem",
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfObject"
                },
                "example": {
                  "isSuccess": true,
                  "value": null,
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the items:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get a catalogue item",
        "description": "Reads one of the items your system sent, by your own id (`externalId`). Items synced from a connected store are not found here. Needs the `items:read` permission.",
        "operationId": "getItem",
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfCatalogItemDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "id": "01a10900-0000-7000-8000-000000000001",
                    "source": "api",
                    "storeId": null,
                    "externalId": "plan-pro",
                    "kind": "plan",
                    "name": "Pro plan",
                    "description": "Unlimited projects and priority support.",
                    "url": "https://example.com/pricing#pro",
                    "imageUrl": "https://example.com/img/pro.png",
                    "price": 49,
                    "comparePrice": 59,
                    "currency": "EUR",
                    "inStock": true,
                    "stockQuantity": null,
                    "categories": [
                      "plans"
                    ],
                    "attributes": {
                      "billing": "monthly",
                      "seats": 5
                    },
                    "active": true,
                    "createdAt": "2026-10-05T09:00:00+00:00",
                    "updatedAt": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the items:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/items": {
      "post": {
        "tags": [
          "Items"
        ],
        "summary": "Create or update a catalogue item",
        "description": "Adds a product, plan or service from your own system to the catalogue Azimea recommends in emails, or updates it. `id` is your own id for the item: sending the same id again updates the same item, and a field left out keeps its value. A new item defaults to a product, in stock and active; `kind` is `product`, `plan`, `service` or `other`. To stop recommending an item but keep its history, send `active: false` instead of deleting it. Items synced from a connected store are not written here. Needs the `items:write` permission. Refusals come back as `catalog.*` codes on the field, for example `catalog.item_name_missing`, `catalog.item_currency_invalid`, or `catalog.items_limit` once the catalogue holds 100,000 items.",
        "operationId": "upsertItem",
        "requestBody": {
          "x-name": "CatalogItemRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogItemRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "The item as stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfCatalogItemDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "id": "01a10900-0000-7000-8000-000000000001",
                    "source": "api",
                    "storeId": null,
                    "externalId": "plan-pro",
                    "kind": "plan",
                    "name": "Pro plan",
                    "description": "Unlimited projects and priority support.",
                    "url": "https://example.com/pricing#pro",
                    "imageUrl": "https://example.com/img/pro.png",
                    "price": 49,
                    "comparePrice": 59,
                    "currency": "EUR",
                    "inStock": true,
                    "stockQuantity": null,
                    "categories": [
                      "plans"
                    ],
                    "attributes": {
                      "billing": "monthly",
                      "seats": 5
                    },
                    "active": true,
                    "createdAt": "2026-10-05T09:00:00+00:00",
                    "updatedAt": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the items:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/items/batch": {
      "post": {
        "tags": [
          "Items"
        ],
        "summary": "Create or update many catalogue items",
        "description": "The same as `POST /items` for up to 1,000 items in one call, which counts as a single call for the rate limit. Each item is written or refused on its own: the answer counts the created, updated and failed items and gives one result per item, by its position in the request, with the reasons as `catalog.*` codes. More than 1,000 items refuses the whole call with `catalog.batch_too_large`. Needs the `items:write` permission.",
        "operationId": "upsertItemsBatch",
        "requestBody": {
          "x-name": "CatalogItemsBatchRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogItemsBatchRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "What happened to each item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfCatalogItemsBatchResponseDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "created": 0,
                    "updated": 1,
                    "failed": 0,
                    "results": [
                      {
                        "index": 0,
                        "status": "updated",
                        "id": "01a10900-0000-7000-8000-000000000001",
                        "errors": null
                      }
                    ]
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the items:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/commerce/orders": {
      "get": {
        "tags": [
          "Commerce"
        ],
        "summary": "List orders",
        "description": "The orders of your connected stores, newest first, in pages (`page` from 1, `pageSize` 1–200, default 50). Statuses are the same for every platform: `Pending`, `Paid`, `Completed`, `Cancelled`, `Refunded`, `Failed`, `Draft`. Filter by `storeId`, by `status`, by `view` (`All`, `Paid` = paid or completed, `Pending`, `Abandoned` = orders left at checkout, `Refunded`), by the last `days` (1–3660, by placement date), or with `search` over the order number, email and name (at most 100 characters). Needs the `orders:read` permission.",
        "operationId": "getOrders",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "guid",
              "nullable": true
            },
            "example": null
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "example": null
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "nullable": true,
              "allOf": [
                {
                  "$ref": "#/components/schemas/OrderStatus"
                }
              ]
            },
            "example": null
          },
          {
            "name": "view",
            "in": "query",
            "required": true,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/OrderView"
                }
              ]
            },
            "example": "Paid"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            },
            "example": 30
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 1
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "One page of orders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfOrderPageDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "items": [
                      {
                        "id": "01a10900-0000-7000-8000-000000000101",
                        "storeId": "01a10900-0000-7000-8000-000000000201",
                        "number": "1042",
                        "status": "Paid",
                        "currency": "EUR",
                        "total": 129.9,
                        "email": "ana@example.com",
                        "customerName": "Ana Popescu",
                        "placedAt": "2026-10-04T18:12:00+00:00",
                        "paidAt": "2026-10-04T18:13:00+00:00",
                        "lineCount": 2
                      }
                    ],
                    "page": 1,
                    "pageSize": 50,
                    "totalCount": 1
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the orders:read permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/events": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Track events from your product",
        "description": "Tells Azimea what people did in your product (`user.signed_up`, `trial.ending`, `kyc.completed`). Each event is recorded on the person's timeline and starts every published flow whose trigger is that event name; the person is found, or created, from `contact` (the same object `POST /contacts` takes, with at least `id`, `externalId` or `email`). Send up to 100 events per call; a call counts once for the rate limit. `id` is your own id, unique in your account: sending it again is counted as a duplicate, so retries are safe. Names use lowercase letters, digits, `_` and `.`, start with a letter, at most 64 characters; the prefixes `order.`, `cart.`, `customer.`, `subscriber.`, `contact.`, `email.` and `azimea.` are reserved. `occurredAt` may be up to 30 days in the past and not in the future; `properties` is a JSON object of at most 16 KB and 3 levels. Each event is accepted or rejected on its own, with `activity.*` codes per field. Needs the `events:write` permission.",
        "operationId": "trackEvents",
        "requestBody": {
          "x-name": "TrackEventsRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackEventsRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "How many events were accepted, were duplicates, or were rejected (with the reasons per event)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfTrackEventsResponseDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "accepted": 1,
                    "duplicates": 0,
                    "rejected": []
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: no events, or more than 100 (activity.batch_too_large)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the events:write permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sending/emails": {
      "post": {
        "tags": [
          "Sending"
        ],
        "summary": "Send a transactional email",
        "description": "Queues one email your own code asks for, about the person's own account or order: an order confirmation, an access code, a password link. It is transactional, so it needs no marketing consent; it is only stopped for an address that bounced or complained, and then comes back with the status `Suppressed` and the reason (`sending.gate_bounced`, `sending.gate_complained`). Do not use it for newsletters or offers: those are campaigns and flows, which check consent. It goes out from your company's default sender, on a verified domain; until one exists the email waits in the queue (`sending.no_verified_sender`). `to` is one address, `subject` at most 300 characters, `html` at most 500,000 characters. The answer's `id` is the message id the delivery webhooks (`email.delivered`, `email.bounced`, `email.complained`) carry. Send an `Idempotency-Key` header (your own id for this send, up to 150 visible ASCII characters) to make retries safe: a second call with the same key, from any key of your account, returns the first message and sends nothing more, even if its body differs. Without the header, a retry queues a second email. Needs the `emails:send` permission.",
        "operationId": "sendEmail",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "example": null
          }
        ],
        "requestBody": {
          "x-name": "SendTransactionalEmailRequestDto",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTransactionalEmailRequestDto"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "The message id and its status: Queued, or Suppressed with the reason",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelopeOfQueuedEmailDto"
                },
                "example": {
                  "isSuccess": true,
                  "value": {
                    "id": "01a10900-0000-7000-8000-000000000301",
                    "status": "Queued",
                    "reason": null
                  },
                  "status": 0,
                  "errors": [],
                  "fieldErrors": null
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: see errors[].code and fieldErrors",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "The key lacks the emails:send permission"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiEnvelopeOfContactAttributeDefinitionDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContactAttributeDefinitionDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ContactAttributeDefinitionDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ContactAttributeType"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "createdFrom": {
            "$ref": "#/components/schemas/ContactAttributeSource"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "ContactAttributeType": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Text",
          "Number",
          "Boolean",
          "Date",
          "DateTime",
          "TextList"
        ],
        "enum": [
          "Text",
          "Number",
          "Boolean",
          "Date",
          "DateTime",
          "TextList"
        ]
      },
      "ContactAttributeSource": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Ui",
          "Api",
          "Csv"
        ],
        "enum": [
          "Ui",
          "Api",
          "Csv"
        ]
      },
      "ApiError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {}
          }
        }
      },
      "CreateContactAttributeRequestDto": {
        "type": "object",
        "example": {
          "key": "plan",
          "label": "Plan",
          "type": "Text",
          "description": "The subscription plan the person is on."
        },
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "example": "plan"
          },
          "label": {
            "type": "string",
            "maxLength": 80,
            "minLength": 0,
            "nullable": true,
            "example": "Plan"
          },
          "type": {
            "example": "Text",
            "$ref": "#/components/schemas/ContactAttributeType"
          },
          "description": {
            "type": "string",
            "maxLength": 300,
            "minLength": 0,
            "nullable": true,
            "example": "The subscription plan the person is on."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "message": {
            "type": "string",
            "default": "One or more errors occurred!"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "ApiEnvelopeOfErasedContactDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/ErasedContactDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ErasedContactDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          }
        }
      },
      "ApiEnvelopeOfIReadOnlyListOfContactAttributeDefinitionDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ContactAttributeDefinitionDto"
            }
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ApiEnvelopeOfContactDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContactDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ContactDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "storeId": {
            "type": "string",
            "format": "guid",
            "nullable": true
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          },
          "consentStatus": {
            "$ref": "#/components/schemas/EmailConsentStatus"
          },
          "isPayingCustomer": {
            "type": "boolean"
          },
          "orderCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalSpent": {
            "type": "number",
            "format": "decimal"
          },
          "lastOrderAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sourceCreatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fromOrders": {
            "type": "boolean"
          },
          "consentSource": {
            "type": "string",
            "nullable": true
          },
          "consentUpdatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "storeConsentMode": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/ConsentMode"
              }
            ]
          },
          "marketingDeclared": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "attributes": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {}
          },
          "lastOpenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastClickAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastEmailedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "addedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastConversionAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "EmailConsentStatus": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Unknown",
          "SoftOptIn",
          "Subscribed",
          "Unsubscribed",
          "Bounced",
          "Complained",
          "CheckoutStarted",
          "PendingConfirmation"
        ],
        "enum": [
          "Unknown",
          "SoftOptIn",
          "Subscribed",
          "Unsubscribed",
          "Bounced",
          "Complained",
          "CheckoutStarted",
          "PendingConfirmation"
        ]
      },
      "ConsentMode": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Explicit",
          "Notice",
          "OwnConsent",
          "None"
        ],
        "enum": [
          "Explicit",
          "Notice",
          "OwnConsent",
          "None"
        ]
      },
      "ApiEnvelopeOfContactPageDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContactPageDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ContactPageDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactDto"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ListContactsRequestDto": {
        "type": "object",
        "additionalProperties": false
      },
      "ApiEnvelopeOfIReadOnlyListOfSegmentListItemDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/SegmentListItemDto"
            }
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "SegmentListItemDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "definition": {
            "$ref": "#/components/schemas/RuleFilter"
          },
          "builtInKey": {
            "type": "string",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "sendableCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "RuleFilter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "join": {
            "$ref": "#/components/schemas/RuleJoin"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterRule"
            }
          }
        }
      },
      "RuleJoin": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "All",
          "Any"
        ],
        "enum": [
          "All",
          "Any"
        ]
      },
      "FilterRule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "fieldKey": {
            "type": "string"
          },
          "operator": {
            "$ref": "#/components/schemas/RuleOperator"
          },
          "value": {}
        }
      },
      "RuleOperator": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Equals",
          "NotEquals",
          "Contains",
          "GreaterThan",
          "LessThan",
          "Before",
          "After",
          "NotContains",
          "WithinLastDays",
          "NotWithinLastDays"
        ],
        "enum": [
          "Equals",
          "NotEquals",
          "Contains",
          "GreaterThan",
          "LessThan",
          "Before",
          "After",
          "NotContains",
          "WithinLastDays",
          "NotWithinLastDays"
        ]
      },
      "ApiEnvelopeOfIReadOnlyListOfTopicDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/TopicDto"
            }
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "TopicDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isArchived": {
            "type": "boolean"
          }
        }
      },
      "UpdateContactAttributeRequestDto": {
        "type": "object",
        "example": {
          "label": "Subscription plan",
          "description": null,
          "archived": false
        },
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 80,
            "minLength": 0,
            "nullable": true,
            "example": "Subscription plan"
          },
          "description": {
            "type": "string",
            "maxLength": 300,
            "minLength": 0,
            "nullable": true,
            "example": null
          },
          "archived": {
            "type": "boolean",
            "nullable": true,
            "example": false
          }
        }
      },
      "ApiEnvelopeOfUpsertContactResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpsertContactResponseDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "UpsertContactResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/ContactDto"
          },
          "created": {
            "type": "boolean"
          }
        }
      },
      "UpsertContactRequestDto": {
        "type": "object",
        "example": {
          "id": null,
          "externalId": "user_4821",
          "email": "ana.popescu@example.com",
          "firstName": "Ana",
          "lastName": "Popescu",
          "phone": "+40721000000",
          "city": "Cluj-Napoca",
          "countryCode": "RO",
          "language": "ro",
          "attributes": {
            "plan": "pro",
            "seats": 12
          },
          "consent": {
            "basis": "Subscribed",
            "proof": {
              "text": "Send me product news and offers from Notely.",
              "textVersion": "2",
              "locale": "ro_RO",
              "ipAddress": "203.0.113.7",
              "givenAt": "2026-10-05T09:30:00+00:00"
            }
          },
          "topics": {
            "product_news": true
          }
        },
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid",
            "nullable": true,
            "example": null
          },
          "externalId": {
            "type": "string",
            "maxLength": 64,
            "minLength": 0,
            "nullable": true,
            "example": "user_4821"
          },
          "email": {
            "type": "string",
            "nullable": true,
            "example": "ana.popescu@example.com"
          },
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 0,
            "nullable": true,
            "example": "Ana"
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 0,
            "nullable": true,
            "example": "Popescu"
          },
          "phone": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": true,
            "example": "+40721000000"
          },
          "city": {
            "type": "string",
            "maxLength": 100,
            "minLength": 0,
            "nullable": true,
            "example": "Cluj-Napoca"
          },
          "countryCode": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$",
            "nullable": true,
            "example": "RO"
          },
          "language": {
            "type": "string",
            "pattern": "^[A-Za-z]{2,3}([_-][A-Za-z0-9]{2,8})*$",
            "nullable": true,
            "example": "ro"
          },
          "attributes": {
            "type": "object",
            "nullable": true,
            "example": {
              "plan": "pro",
              "seats": 12
            },
            "additionalProperties": {}
          },
          "consent": {
            "nullable": true,
            "example": {
              "basis": "Subscribed",
              "proof": {
                "text": "Send me product news and offers from Notely.",
                "textVersion": "2",
                "locale": "ro_RO",
                "ipAddress": "203.0.113.7",
                "givenAt": "2026-10-05T09:30:00+00:00"
              }
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContactConsentRequestDto"
              }
            ]
          },
          "topics": {
            "type": "object",
            "nullable": true,
            "example": {
              "product_news": true
            },
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "ContactConsentRequestDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "basis": {
            "example": "Subscribed",
            "$ref": "#/components/schemas/ContactConsentBasis"
          },
          "proof": {
            "nullable": true,
            "example": {
              "text": "Send me product news and offers from Notely.",
              "textVersion": "2",
              "locale": "ro_RO",
              "ipAddress": "203.0.113.7",
              "givenAt": "2026-10-05T09:30:00+00:00"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContactConsentProofRequestDto"
              }
            ]
          }
        }
      },
      "ContactConsentBasis": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Customer",
          "Subscribed",
          "Unsubscribed"
        ],
        "enum": [
          "Customer",
          "Subscribed",
          "Unsubscribed"
        ]
      },
      "ContactConsentProofRequestDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 0,
            "nullable": true,
            "example": "Send me product news and offers from Notely."
          },
          "textVersion": {
            "type": "string",
            "maxLength": 64,
            "minLength": 0,
            "nullable": true,
            "example": "2"
          },
          "locale": {
            "type": "string",
            "maxLength": 16,
            "minLength": 0,
            "nullable": true,
            "example": "ro_RO"
          },
          "ipAddress": {
            "type": "string",
            "nullable": true,
            "example": "203.0.113.7"
          },
          "givenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-10-05T09:30:00+00:00"
          }
        }
      },
      "ApiEnvelopeOfUpsertContactsBatchResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpsertContactsBatchResponseDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "UpsertContactsBatchResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "updated": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactBatchItemResultDto"
            }
          }
        }
      },
      "ContactBatchItemResultDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/ContactBatchItemStatus"
          },
          "id": {
            "type": "string",
            "format": "guid",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ContactBatchItemErrorDto"
            }
          }
        }
      },
      "ContactBatchItemStatus": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Created",
          "Updated",
          "Failed"
        ],
        "enum": [
          "Created",
          "Updated",
          "Failed"
        ]
      },
      "ContactBatchItemErrorDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string",
            "nullable": true
          },
          "params": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {}
          }
        }
      },
      "UpsertContactsBatchRequestDto": {
        "type": "object",
        "example": {
          "contacts": [
            {
              "id": null,
              "externalId": "user_4821",
              "email": "ana.popescu@example.com",
              "firstName": "Ana",
              "lastName": "Popescu",
              "phone": "+40721000000",
              "city": "Cluj-Napoca",
              "countryCode": "RO",
              "language": "ro",
              "attributes": {
                "plan": "pro",
                "seats": 12
              },
              "consent": {
                "basis": "Subscribed",
                "proof": {
                  "text": "Send me product news and offers from Notely.",
                  "textVersion": "2",
                  "locale": "ro_RO",
                  "ipAddress": "203.0.113.7",
                  "givenAt": "2026-10-05T09:30:00+00:00"
                }
              },
              "topics": {
                "product_news": true
              }
            },
            {
              "id": null,
              "externalId": null,
              "email": "not-an-address",
              "firstName": null,
              "lastName": null,
              "phone": null,
              "city": null,
              "countryCode": null,
              "language": null,
              "attributes": null,
              "consent": null,
              "topics": null
            }
          ]
        },
        "additionalProperties": false,
        "required": [
          "contacts"
        ],
        "properties": {
          "contacts": {
            "type": "array",
            "minLength": 1,
            "nullable": false,
            "example": [
              {
                "id": null,
                "externalId": "user_4821",
                "email": "ana.popescu@example.com",
                "firstName": "Ana",
                "lastName": "Popescu",
                "phone": "+40721000000",
                "city": "Cluj-Napoca",
                "countryCode": "RO",
                "language": "ro",
                "attributes": {
                  "plan": "pro",
                  "seats": 12
                },
                "consent": {
                  "basis": "Subscribed",
                  "proof": {
                    "text": "Send me product news and offers from Notely.",
                    "textVersion": "2",
                    "locale": "ro_RO",
                    "ipAddress": "203.0.113.7",
                    "givenAt": "2026-10-05T09:30:00+00:00"
                  }
                },
                "topics": {
                  "product_news": true
                }
              },
              {
                "id": null,
                "externalId": null,
                "email": "not-an-address",
                "firstName": null,
                "lastName": null,
                "phone": null,
                "city": null,
                "countryCode": null,
                "language": null,
                "attributes": null,
                "consent": null,
                "topics": null
              }
            ],
            "items": {
              "$ref": "#/components/schemas/UpsertContactRequestDto"
            }
          }
        }
      },
      "ApiEnvelopeOfObject": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "ApiEnvelopeOfCatalogItemDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/CatalogItemDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "CatalogItemDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "source": {
            "type": "string"
          },
          "storeId": {
            "type": "string",
            "format": "guid",
            "nullable": true
          },
          "externalId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "imageUrl": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "comparePrice": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "inStock": {
            "type": "boolean"
          },
          "stockQuantity": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {}
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "CatalogItemRequestDto": {
        "type": "object",
        "example": {
          "id": "plan-pro",
          "kind": "plan",
          "name": "Pro plan",
          "description": "Unlimited projects and priority support.",
          "url": "https://example.com/pricing#pro",
          "imageUrl": "https://example.com/img/pro.png",
          "price": 49,
          "comparePrice": 59,
          "currency": "EUR",
          "inStock": true,
          "stockQuantity": null,
          "categories": [
            "plans"
          ],
          "attributes": {
            "billing": "monthly",
            "seats": 5
          },
          "active": true
        },
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "example": "plan-pro"
          },
          "kind": {
            "type": "string",
            "nullable": true,
            "example": "plan"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Pro plan"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "example": "Unlimited projects and priority support."
          },
          "url": {
            "type": "string",
            "nullable": true,
            "example": "https://example.com/pricing#pro"
          },
          "imageUrl": {
            "type": "string",
            "nullable": true,
            "example": "https://example.com/img/pro.png"
          },
          "price": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "example": 49
          },
          "comparePrice": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "example": 59
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "example": "EUR"
          },
          "inStock": {
            "type": "boolean",
            "nullable": true,
            "example": true
          },
          "stockQuantity": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "example": null
          },
          "categories": {
            "type": "array",
            "nullable": true,
            "example": [
              "plans"
            ],
            "items": {
              "type": "string"
            }
          },
          "attributes": {
            "type": "object",
            "nullable": true,
            "example": {
              "billing": "monthly",
              "seats": 5
            },
            "additionalProperties": {}
          },
          "active": {
            "type": "boolean",
            "nullable": true,
            "example": true
          }
        }
      },
      "ApiEnvelopeOfCatalogItemsBatchResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/CatalogItemsBatchResponseDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "CatalogItemsBatchResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "updated": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogBatchItemResultDto"
            }
          }
        }
      },
      "CatalogBatchItemResultDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "guid",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/CatalogBatchItemErrorDto"
            }
          }
        }
      },
      "CatalogBatchItemErrorDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string",
            "nullable": true
          },
          "params": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {}
          }
        }
      },
      "CatalogItemsBatchRequestDto": {
        "type": "object",
        "example": {
          "items": [
            {
              "id": "plan-pro",
              "kind": "plan",
              "name": "Pro plan",
              "description": "Unlimited projects and priority support.",
              "url": "https://example.com/pricing#pro",
              "imageUrl": "https://example.com/img/pro.png",
              "price": 49,
              "comparePrice": 59,
              "currency": "EUR",
              "inStock": true,
              "stockQuantity": null,
              "categories": [
                "plans"
              ],
              "attributes": {
                "billing": "monthly",
                "seats": 5
              },
              "active": true
            }
          ]
        },
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "nullable": true,
            "example": [
              {
                "id": "plan-pro",
                "kind": "plan",
                "name": "Pro plan",
                "description": "Unlimited projects and priority support.",
                "url": "https://example.com/pricing#pro",
                "imageUrl": "https://example.com/img/pro.png",
                "price": 49,
                "comparePrice": 59,
                "currency": "EUR",
                "inStock": true,
                "stockQuantity": null,
                "categories": [
                  "plans"
                ],
                "attributes": {
                  "billing": "monthly",
                  "seats": 5
                },
                "active": true
              }
            ],
            "items": {
              "$ref": "#/components/schemas/CatalogItemRequestDto"
            }
          }
        }
      },
      "ApiEnvelopeOfOrderPageDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderPageDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "OrderPageDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderDto"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrderDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "storeId": {
            "type": "string",
            "format": "guid"
          },
          "number": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "total": {
            "type": "number",
            "format": "decimal"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "nullable": true
          },
          "placedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "paidAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lineCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrderStatus": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Pending",
          "Paid",
          "Completed",
          "Cancelled",
          "Refunded",
          "Failed",
          "Draft"
        ],
        "enum": [
          "Pending",
          "Paid",
          "Completed",
          "Cancelled",
          "Refunded",
          "Failed",
          "Draft"
        ]
      },
      "GetOrdersRequestDto": {
        "type": "object",
        "additionalProperties": false
      },
      "OrderView": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "All",
          "Paid",
          "Pending",
          "Abandoned",
          "Refunded"
        ],
        "enum": [
          "All",
          "Paid",
          "Pending",
          "Abandoned",
          "Refunded"
        ]
      },
      "ApiEnvelopeOfTrackEventsResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TrackEventsResponseDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "TrackEventsResponseDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "type": "integer",
            "format": "int32"
          },
          "duplicates": {
            "type": "integer",
            "format": "int32"
          },
          "rejected": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackEventRejectionDto"
            }
          }
        }
      },
      "TrackEventRejectionDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackEventErrorDto"
            }
          }
        }
      },
      "TrackEventErrorDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {}
          }
        }
      },
      "TrackEventsRequestDto": {
        "type": "object",
        "example": {
          "events": [
            {
              "id": "evt_7f3c2a",
              "name": "user.signed_up",
              "occurredAt": "2026-10-05T09:30:00+00:00",
              "contact": {
                "externalId": "user_123",
                "email": "ana@example.com"
              },
              "properties": {
                "plan": "trial",
                "source": "landing-page"
              }
            }
          ]
        },
        "additionalProperties": false,
        "required": [
          "events"
        ],
        "properties": {
          "events": {
            "type": "array",
            "minLength": 1,
            "nullable": false,
            "example": [
              {
                "id": "evt_7f3c2a",
                "name": "user.signed_up",
                "occurredAt": "2026-10-05T09:30:00+00:00",
                "contact": {
                  "externalId": "user_123",
                  "email": "ana@example.com"
                },
                "properties": {
                  "plan": "trial",
                  "source": "landing-page"
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/TrackEventDto"
            }
          }
        }
      },
      "TrackEventDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "example": "evt_7f3c2a"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "user.signed_up"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-10-05T09:30:00+00:00"
          },
          "contact": {
            "nullable": true,
            "example": {
              "externalId": "user_123",
              "email": "ana@example.com"
            }
          },
          "properties": {
            "nullable": true,
            "example": {
              "plan": "trial",
              "source": "landing-page"
            }
          }
        }
      },
      "ApiEnvelopeOfQueuedEmailDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "value": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/QueuedEmailDto"
              }
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          },
          "fieldErrors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiError"
              }
            }
          }
        }
      },
      "QueuedEmailDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "guid"
          },
          "status": {
            "$ref": "#/components/schemas/EmailDeliveryStatus"
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "EmailDeliveryStatus": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Queued",
          "Sent",
          "Failed",
          "Suppressed",
          "Delivered",
          "Bounced",
          "HandingOff",
          "Accepted",
          "Unknown"
        ],
        "enum": [
          "Queued",
          "Sent",
          "Failed",
          "Suppressed",
          "Delivered",
          "Bounced",
          "HandingOff",
          "Accepted",
          "Unknown"
        ]
      },
      "SendTransactionalEmailRequestDto": {
        "type": "object",
        "example": {
          "to": "ana@example.com",
          "subject": "Your order 1042 is confirmed",
          "html": "<p>Hi Ana,</p><p>Thank you for your order 1042. We will let you know when it ships.</p>",
          "idempotencyKey": null
        },
        "additionalProperties": false,
        "required": [
          "to",
          "subject",
          "html"
        ],
        "properties": {
          "to": {
            "type": "string",
            "format": "email",
            "maxLength": 320,
            "minLength": 0,
            "pattern": "^[^@]+@[^@]+$",
            "nullable": false,
            "example": "ana@example.com"
          },
          "subject": {
            "type": "string",
            "maxLength": 300,
            "minLength": 0,
            "nullable": false,
            "example": "Your order 1042 is confirmed"
          },
          "html": {
            "type": "string",
            "maxLength": 500000,
            "minLength": 0,
            "nullable": false,
            "example": "<p>Hi Ana,</p><p>Thank you for your order 1042. We will let you know when it ships.</p>"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "description": "An API key from Settings › API keys, sent as a bearer token.",
        "scheme": "bearer",
        "bearerFormat": "azm_live_…"
      }
    }
  }
}