{"openapi":"3.0.3","info":{"title":"Dativery Peppol API","version":"1.0.0","description":"Multi-tenant Peppol document exchange service. Most endpoints require Bearer token authentication.\n\nDomain model:\n- A tenant is the top-level customer workspace or organization account. Users, billing, API keys, logs, reports, and configuration are scoped to a tenant.\n- A participant is a concrete business entity managed inside a tenant. Participants represent the legal or operational sender/receiver on the Peppol network and hold business identity, verification state, and Peppol registration.\n- One tenant can manage multiple participants. Most document exchange happens for a specific participant, while tenant endpoints manage the shared container around them."},"servers":[{"url":"/api","description":"Current server"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"parameters":{"PaginationLimit":{"name":"limit","in":"query","description":"Maximum number of items to return.","schema":{"type":"integer","default":50,"minimum":0}},"PaginationOffset":{"name":"offset","in":"query","description":"Zero-based offset into the result set.","schema":{"type":"integer","default":0,"minimum":0}},"PaginationPageToken":{"name":"pageToken","in":"query","description":"Alias of `offset`. It has the same meaning as `offset`.","schema":{"type":"string","example":"0"}},"PeppolParticipantIdHeader":{"name":"X-Peppol-Participant-Id","in":"header","required":false,"description":"Alternative participant selector in the form `ICD:value` (for example `0245:1234567890`). When the endpoint also accepts `participantId`, both values must resolve to the same participant.","schema":{"type":"string","example":"0245:1234567890"}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"ErrorResponseEnvelope":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/SAPIError"}}},"TokenResponse":{"type":"object","required":["access_token","token_type","expires_in"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"],"example":"Bearer"},"expires_in":{"type":"integer","example":900},"scope":{"type":"string","example":"document:send document:receive"}}},"TokenStatus":{"type":"object","properties":{"valid":{"type":"boolean","example":true},"token_type":{"type":"string","enum":["access"],"example":"access"},"client_id":{"type":"string"},"issued_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"expires_in_seconds":{"type":"integer","example":542},"should_refresh":{"type":"boolean","example":false},"refresh_recommended_at":{"type":"string","format":"date-time"}}},"UserProfile":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"language":{"type":"string","enum":["en","cs","sk","de"]},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format"},"jobTitle":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true,"description":"Avatar image as a base64 data URL"},"createdAt":{"type":"string","format":"date-time"},"otpEnabled":{"type":"boolean"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/UserProfileParticipant"}}},"required":["id","email","firstName","lastName","language","phone","jobTitle","company","avatar","createdAt","otpEnabled","participants"]},"UpdateUserProfileRequest":{"type":"object","properties":{"firstName":{"type":"string","maxLength":100,"description":"First name"},"lastName":{"type":"string","maxLength":100,"description":"Last name"},"language":{"type":"string","enum":["en","cs","sk","de"],"description":"Preferred application language"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format; send null or an empty string to clear it"},"jobTitle":{"type":"string","nullable":true,"maxLength":150,"description":"Job title; send null or an empty string to clear it"},"company":{"type":"string","nullable":true,"maxLength":200,"description":"Company name; send null or an empty string to clear it"},"avatar":{"type":"string","nullable":true,"description":"Avatar image as a base64 data URL or raw base64 image string; send null or an empty string to clear it"}}},"Tenant":{"type":"object","description":"Top-level customer workspace or organization account. A tenant groups users, participants, API keys, reports, logs, and shared configuration. One tenant can own multiple participants.","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"rateLimit":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","nullable":true},"deletedAt":{"type":"string","format":"date-time","nullable":true},"role":{"type":"string","nullable":true}},"required":["id","name","isActive","createdAt"]},"Participant":{"type":"object","description":"Concrete business entity managed inside a tenant. A participant is the sender or receiver on the Peppol network and carries company identity, verification state, and Peppol registration data.","properties":{"id":{"type":"string"},"tenantId":{"type":"string","description":"Owning tenant. The tenant is the parent workspace or organization account that manages this participant."},"name":{"type":"string"},"code":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"euVatId":{"type":"string","nullable":true},"streetWithNo":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"postCode":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"telephone":{"type":"string","nullable":true},"contactPhone":{"type":"string","nullable":true},"contactEmail":{"type":"string","format":"email","nullable":true},"website":{"type":"string","nullable":true},"logoUrl":{"type":"string","nullable":true},"language":{"type":"string"},"isVerified":{"type":"boolean"},"blocked":{"type":"boolean"},"blockedReason":{"type":"string","nullable":true},"rateLimit":{"type":"string","nullable":true},"verifiedRegistrationNumber":{"type":"string","nullable":true},"verifiedTaxId":{"type":"string","nullable":true},"verifiedEuVatId":{"type":"string","nullable":true},"emailVerified":{"type":"boolean"},"emailVerifiedAt":{"type":"string","format":"date-time","nullable":true},"registrationVerified":{"type":"boolean"},"registrationVerifiedAt":{"type":"string","format":"date-time","nullable":true},"bankAccountVerified":{"type":"boolean"},"bankAccountVerifiedAt":{"type":"string","format":"date-time","nullable":true},"authorizedPersonVerified":{"type":"boolean"},"authorizedPersonVerifiedAt":{"type":"string","format":"date-time","nullable":true},"phoneVerified":{"type":"boolean"},"phoneVerifiedAt":{"type":"string","format":"date-time","nullable":true},"peppolRegistered":{"type":"boolean","nullable":true},"isLegalPerson":{"type":"boolean","nullable":true},"adissrBankAccounts":{"type":"array","items":{"type":"object"},"nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","tenantId","name","language","isVerified","blocked","emailVerified","registrationVerified","bankAccountVerified","authorizedPersonVerified","phoneVerified","createdAt","updatedAt"]},"Document":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string","nullable":true},"senderId":{"type":"string","nullable":true},"receiverId":{"type":"string","nullable":true},"senderPeppolId":{"type":"string","nullable":true},"receiverPeppolId":{"type":"string","nullable":true},"documentTypeIdentifier":{"type":"string","nullable":true},"documentType":{"type":"string"},"documentNumber":{"type":"string","nullable":true},"originalFormat":{"type":"string","nullable":true},"status":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"isRead":{"type":"boolean"},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"readAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","documentType","status","direction","isRead","createdAt","updatedAt"]},"ParticipantVerificationStatus":{"type":"object","properties":{"status":{"type":"string"},"verification":{"anyOf":[{"$ref":"#/components/schemas/ParticipantVerificationRecord"},{"type":"null"}]}},"required":["status","verification"]},"EventLog":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"eventType":{"type":"string"},"severity":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","eventType","severity","message","createdAt"]},"PeppolReport":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"reportType":{"type":"string","enum":["eusr","tsr"]},"reporterId":{"type":"string"},"periodStart":{"type":"string","format":"date"},"periodEnd":{"type":"string","format":"date"},"reportXml":{"type":"string","nullable":true},"status":{"type":"string","enum":["generated","submitted","failed"]},"transmissionId":{"type":"string","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","tenantId","reportType","reporterId","periodStart","periodEnd","status","createdAt","updatedAt"]},"PeppolLog":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"tenantId":{"type":"string","format":"uuid","nullable":true},"participantId":{"type":"string","format":"uuid","nullable":true},"messageId":{"type":"string","nullable":true},"transmissionId":{"type":"string","nullable":true},"senderPeppolId":{"type":"string","nullable":true},"receiverPeppolId":{"type":"string","nullable":true},"documentTypeIdentifier":{"type":"string","nullable":true},"protocol":{"type":"string","nullable":true},"status":{"type":"string"},"errorMessage":{"type":"string","nullable":true},"documentId":{"type":"string","format":"uuid","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt"]},"PeppolLogListResponse":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/PeppolLog"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["logs","total","limit","offset"]},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"token":{"type":"string"},"tenantId":{"type":"string","nullable":true},"participantId":{"type":"string","nullable":true},"invitedBy":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"acceptedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","email","token","invitedBy","role","status","createdAt","expiresAt"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"tenantId":{"type":"string","nullable":true},"participantId":{"type":"string","nullable":true},"scope":{"type":"string"},"permissions":{"type":"string"},"rateLimit":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time","nullable":true},"lastUsedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","clientId","name","scope","permissions","isActive"]},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"participantId":{"type":"string","nullable":true},"type":{"type":"string","enum":["url","email","sms"]},"url":{"type":"string","nullable":true},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","tenantId","participantId","type","events","isActive","createdAt"]},"WebhookWithSecret":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"participantId":{"type":"string","nullable":true},"type":{"type":"string","enum":["url","email","sms"]},"url":{"type":"string","nullable":true},"email":{"type":"string","format":"email","nullable":true},"phone":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","tenantId","participantId","type","events","secret","isActive","createdAt"]},"UpdateParticipantRequest":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"registrationNumber":{"type":"string"},"taxId":{"type":"string"},"euVatId":{"type":"string"},"streetWithNo":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postCode":{"type":"string"},"countryCode":{"type":"string"},"telephone":{"type":"string"},"contactPhone":{"type":"string"},"contactEmail":{"type":"string","format":"email"},"website":{"type":"string"},"logoUrl":{"type":"string"},"language":{"type":"string","minLength":2,"maxLength":2},"isVerified":{"type":"boolean"},"blocked":{"type":"boolean"},"blockedReason":{"type":"string"},"rateLimit":{"type":"string"}}},"CreateWebhookRequest":{"type":"object","properties":{"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["url","email","sms"]},"url":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"events":{"type":"array","items":{"type":"string"},"minItems":1,"example":["document.received","document.sent"]}},"required":["type","events"]},"UpdateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"events":{"type":"array","items":{"type":"string"},"minItems":1},"isActive":{"type":"boolean"}}},"AllowedEmail":{"description":"An allowed sender email address for a participant. Incoming emails from this address containing ISDOC (or PDF.ISDOC) attachments will be delivered to the Peppol network on behalf of the participant.","type":"object","properties":{"id":{"type":"string","format":"uuid"},"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email","nullable":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","tenantId","participantId","isActive","createdAt","updatedAt"]},"CreateAllowedEmailRequest":{"description":"Request body for creating a new allowed email entry.","type":"object","properties":{"email":{"type":"string","format":"email","maxLength":255}},"required":["email"]},"UpdateAllowedEmailRequest":{"description":"Request body for updating an allowed email entry.","type":"object","properties":{"isActive":{"type":"boolean"}}},"Notification":{"description":"A notification channel configured for a participant. Notifications are sent when relevant events occur (e.g. a document is received). Supported types: email, whatsapp, sms.","type":"object","properties":{"id":{"type":"string","format":"uuid"},"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["email","whatsapp","sms"],"nullable":true},"address":{"type":"string","nullable":true,"description":"Destination address — email address, phone number, or WhatsApp number depending on the type."},"isActive":{"type":"boolean"},"sendReceivedInvoices":{"type":"boolean","description":"Whether received invoices and credit notes should trigger this notification. Defaults to true."},"sendDeliveryStatus":{"type":"boolean","description":"Whether sent/failed delivery status updates should trigger this notification. Defaults to true."},"sendOtherDocumentTypes":{"type":"boolean","description":"Whether other received document types such as orders should trigger this notification. Defaults to true."},"attachmentType":{"type":"string","enum":["none","original","pdf","isdoc"],"description":"Attachment variant used for email notifications. Ignored for SMS and WhatsApp.","default":"original"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","tenantId","participantId","isActive","sendReceivedInvoices","sendDeliveryStatus","sendOtherDocumentTypes","attachmentType","createdAt","updatedAt"]},"CreateNotificationRequest":{"description":"Request body for creating a notification channel.","type":"object","properties":{"type":{"type":"string","enum":["email","whatsapp","sms"]},"address":{"type":"string","maxLength":255},"sendReceivedInvoices":{"type":"boolean","default":true},"sendDeliveryStatus":{"type":"boolean","default":true},"sendOtherDocumentTypes":{"type":"boolean","default":true},"attachmentType":{"type":"string","enum":["none","original","pdf","isdoc"],"default":"original","description":"Attachment variant used for email notifications. Ignored for SMS and WhatsApp."}},"required":["type"]},"UpdateNotificationRequest":{"description":"Request body for updating a notification channel.","type":"object","properties":{"type":{"type":"string","enum":["email","whatsapp","sms"]},"address":{"type":"string","maxLength":255},"isActive":{"type":"boolean"},"sendReceivedInvoices":{"type":"boolean"},"sendDeliveryStatus":{"type":"boolean"},"sendOtherDocumentTypes":{"type":"boolean"},"attachmentType":{"type":"string","enum":["none","original","pdf","isdoc"]}}},"NotificationLog":{"description":"A read-only log entry representing a queued or delivered participant notification.","type":"object","properties":{"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date-time"},"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["email","whatsapp","sms"]},"address":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["to-send","sent","rejected","failed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","date","tenantId","participantId","documentId","type","address","subject","body","status","createdAt","updatedAt"]},"NotificationLogListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/NotificationLog"}}},"required":["success","data"]},"LookupResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PeppolLookupResult"}},"required":["success","data"]},"LookupBatchResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PeppolLookupResult"}}},"required":["success","data"]},"CreateTenantRequest":{"type":"object","properties":{"name":{"type":"string"},"NotificationLog":{"description":"A read-only log entry representing a queued or delivered participant notification.","type":"object","properties":{"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date-time"},"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["email","whatsapp","sms"]},"address":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["to-send","sent","rejected","failed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","date","tenantId","participantId","documentId","type","address","subject","body","status","createdAt","updatedAt"]},"NotificationLogListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/NotificationLog"}}},"required":["success","data"]},"language":{"type":"string","minLength":2,"maxLength":2}},"required":["name"]},"UpdateTenantRequest":{"type":"object","properties":{"name":{"type":"string"},"language":{"type":"string","minLength":2,"maxLength":2},"isActive":{"type":"boolean"}}},"AddTenantUserRequest":{"type":"object","properties":{"userId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","member","viewer"]}},"required":["userId"]},"UpdateTenantUserRoleRequest":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member","viewer"]}},"required":["role"]},"CreateParticipantRequest":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"registrationNumber":{"type":"string"},"taxId":{"type":"string"},"euVatId":{"type":"string"},"streetWithNo":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postCode":{"type":"string"},"countryCode":{"type":"string"},"telephone":{"type":"string"},"contactPhone":{"type":"string"},"contactEmail":{"type":"string"},"website":{"type":"string"},"logoUrl":{"type":"string"},"language":{"type":"string","minLength":2,"maxLength":2}},"required":["name"]},"ApiKeyCreateResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/ApiKeyWithSecret"}},"required":["success","data"]},"ParticipantDocumentStatus":{"type":"object","properties":{"documentId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"format":{"type":"string","nullable":true},"documentType":{"type":"string"},"senderPeppolId":{"type":"string","nullable":true},"receiverPeppolId":{"type":"string","nullable":true},"status":{"type":"string"},"isRead":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantDocumentStatusMessage"}}},"required":["documentId","direction","documentType","status","isRead","createdAt","updatedAt","messages"]},"TenantListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"tenants":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},"count":{"type":"integer","minimum":0,"example":0}},"required":["tenants","count"]}},"required":["success","data"]},"TenantUserListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/TenantUser"}}},"required":["success","data"]},"ParticipantListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"count":{"type":"integer","minimum":0,"example":0}},"required":["participants","count"]}},"required":["success","data"]},"EventLogListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/EventLog"}}},"required":["success","data"]},"PeppolReportListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/PeppolReport"}},"total":{"type":"integer","minimum":0,"example":0},"limit":{"type":"integer","minimum":0,"example":50},"offset":{"type":"integer","minimum":0,"example":0}},"required":["reports","total","limit","offset"]}},"required":["success","data"]},"InvitationListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}},"required":["success","data"]},"ApiKeyListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["success","data"]},"WebhookListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["webhooks"]}},"required":["success","data"]},"DocumentListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"total":{"type":"integer","minimum":0,"example":0},"limit":{"type":"integer","minimum":0,"example":50},"offset":{"type":"integer","minimum":0,"example":0}},"required":["documents","total","limit","offset"]}},"required":["success","data"]},"ParticipantInboxDocumentListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantInboxDocument"}},"unreadCount":{"type":"integer","minimum":0,"example":0}},"required":["documents","unreadCount"]}},"required":["success","data"]}},"responses":{"Unauthorized":{"description":"Unauthorized – missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotImplemented":{"description":"Not implemented – feature or service is not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad gateway – upstream conversion service returned an error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"security":[{"bearerAuth":[]}],"tags":[{"name":"Health","description":"Service health check"},{"name":"Auth","description":"Authentication and account management"},{"name":"Users","description":"User profile and user management"},{"name":"Lookup","description":"Peppol network participant lookup"},{"name":"Tenants","description":"Tenant management. A tenant is the top-level customer workspace or organization account that contains users, participants, API keys, logs, reports, and shared settings."},{"name":"Participants","description":"Participant management within a tenant. A participant is a concrete business entity under a tenant that sends or receives Peppol documents and has its own identity, verification state, and Peppol registration."},{"name":"Documents","description":"Document listing, delivery, conversion, and acknowledgement"},{"name":"API Keys","description":"API key management across root, tenant, and participant scopes"},{"name":"Event Logs","description":"Audit and event log access"},{"name":"Reports","description":"Peppol reporting endpoints"},{"name":"Peppol Logs","description":"Peppol transmission log access"},{"name":"Webhooks","description":"Webhook subscriptions"},{"name":"Allowed Emails","description":"Per-participant allowlist of sender email addresses whose ISDOC/PDF.ISDOC attachments are delivered to the Peppol network."},{"name":"Notifications","description":"Per-participant notification channels (email, WhatsApp, SMS) for delivery events."},{"name":"Notification Logs","description":"Read-only log of queued and delivered participant notifications."},{"name":"Invitations","description":"User invitations"}],"paths":{"/health":{"get":{"tags":["Health"],"summary":"Service health check","security":[],"responses":{"200":{"description":"Health status or degraded state","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"status":{"type":"string","example":"healthy"},"version":{"type":"string","example":"1.0.0"},"timestamp":{"type":"string","format":"date-time"},"checks":{"type":"object","properties":{"database":{"type":"boolean"},"peppolDatabase":{"type":"boolean"},"redis":{"type":"boolean"},"nats":{"type":"boolean"}},"required":["database","peppolDatabase","redis","nats"]}},"required":["status","version","timestamp","checks"]}},"required":["success","data"]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}}}},"/auth/token":{"post":{"tags":["Auth"],"summary":"Obtain access token","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["client_id","client_secret","grant_type"],"properties":{"client_id":{"type":"string","example":"demo_swagger_client"},"client_secret":{"type":"string","example":"demo_secret_swagger_12345"},"grant_type":{"type":"string","enum":["client_credentials"],"example":"client_credentials"},"scope":{"type":"string","example":"document:send document:receive"}}}}}},"responses":{"200":{"description":"Token issued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"401":{"description":"Invalid credentials or client not approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseEnvelope"}}}},"403":{"description":"IP address not allowed for this client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseEnvelope"}}}},"423":{"description":"Account temporarily locked due to too many failed attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseEnvelope"}}}}}}},"/auth/token/status":{"get":{"tags":["Auth"],"summary":"Check token validity and expiration","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Token status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenStatus"}}}},"401":{"description":"Token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseEnvelope"}}}}}}},"/auth/renew":{"post":{"tags":["Auth"],"summary":"Renew tokens using refresh token","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["refresh_token"],"properties":{"refresh_token":{"type":"string"}}}}}},"responses":{"200":{"description":"New tokens issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"401":{"description":"Refresh token is invalid, expired, or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseEnvelope"}}}}}}},"/auth/revoke":{"post":{"tags":["Auth"],"summary":"Revoke refresh tokens","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The refresh token to revoke"},"token_type_hint":{"type":"string","enum":["refresh_token"],"default":"refresh_token"}}}}}},"responses":{"200":{"description":"Token revoked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Token revoked successfully"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/users/me":{"get":{"tags":["Users"],"summary":"Get current user profile","responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"patch":{"tags":["Users"],"summary":"Update current user profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileRequest"}}}},"responses":{"200":{"description":"Profile updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/UserProfile"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/users":{"get":{"tags":["Users"],"summary":"List users sharing a tenant with the caller","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"}],"responses":{"200":{"description":"List of users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/users/{userId}":{"get":{"tags":["Users"],"summary":"Get a user profile by ID","security":[{"bearerAuth":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/users/{userId}/participants":{"get":{"tags":["Users"],"summary":"List participants assigned to a user","security":[{"bearerAuth":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Participant list","content":{"application/json":{"schema":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"tenantId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","member","viewer"]}}}},"count":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/users/{userId}/tenants":{"get":{"tags":["Users"],"summary":"List tenants a user belongs to","security":[{"bearerAuth":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Tenant list","content":{"application/json":{"schema":{"type":"object","properties":{"tenants":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},"count":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/lookup/vat/{vatId}":{"get":{"tags":["Lookup"],"summary":"Lookup by VAT ID","security":[],"parameters":[{"name":"vatId","in":"path","required":true,"schema":{"type":"string"},"example":"CZ12345678"},{"name":"documentType","in":"query","schema":{"type":"string","default":"invoices"}}],"responses":{"200":{"description":"Lookup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}}}}},"/lookup/peppol/{peppolId}":{"get":{"tags":["Lookup"],"summary":"Lookup by Peppol ID","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"peppolId","in":"path","required":true,"schema":{"type":"string"},"example":"0192:12345678"},{"name":"documentType","in":"query","schema":{"type":"string","default":"invoices"}}],"responses":{"200":{"description":"Lookup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/lookup/batch":{"post":{"tags":["Lookup"],"summary":"Batch lookup (up to 50 identifiers)","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identifiers"],"properties":{"identifiers":{"type":"array","items":{"type":"string"},"maxItems":50,"example":["CZ12345678","0192:87654321"]},"documentType":{"type":"string","default":"invoices"}}}}}},"responses":{"200":{"description":"Batch results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupBatchResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants":{"get":{"tags":["Tenants"],"summary":"List tenants for the current user","parameters":[{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Tenant list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Tenants"],"summary":"Create a new tenant","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}}},"responses":{"201":{"description":"Tenant created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Tenant"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}":{"get":{"tags":["Tenants"],"summary":"Get tenant details","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tenant details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Tenants"],"summary":"Update tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantRequest"}}}},"responses":{"200":{"description":"Tenant updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"tags":["Tenants"],"summary":"Delete tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tenant deleted"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}/users":{"get":{"tags":["Tenants"],"summary":"List users in a tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"User list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Tenants"],"summary":"Add a user to tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTenantUserRequest"}}}},"responses":{"201":{"description":"User added","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}/users/{userId}":{"patch":{"tags":["Tenants"],"summary":"Update user role in tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantUserRoleRequest"}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"tags":["Tenants"],"summary":"Remove a user from tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}/participants":{"get":{"tags":["Participants"],"summary":"List participants","description":"When `X-Peppol-Participant-Id` is provided, the server resolves the participant from the Peppol identifier within the tenant and returns only the matching accessible participant.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Participant list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Participants"],"summary":"Create a participant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParticipantRequest"}}}},"responses":{"201":{"description":"Participant created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}":{"get":{"tags":["Participants"],"summary":"Get participant details","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"responses":{"200":{"description":"Participant details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]},"patch":{"tags":["Participants"],"summary":"Update participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateParticipantRequest"}}}},"responses":{"200":{"description":"Participant updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]},"delete":{"tags":["Participants"],"summary":"Delete participant (admin only)","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"responses":{"200":{"description":"Participant deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/participants/{participantId}/peppol/register":{"post":{"tags":["Participants"],"summary":"Register participant to Peppol","description":"Registers a fully-verified participant to Peppol. All 5 verification steps must be completed (email, registration, bankAccount, authorizedPerson, phone). Creates a peppolIds record (iso6523-actorid-upis::{ICD}:{registrationNumber}) and SMP service metadata for the standard BIS 3.0 document types: Invoice V3, Credit Note V3, Order, Order Cancellation, and Order Change. Sets participant.peppolRegistered = true. Requires PEPPOL_AP_ENDPOINT_URL environment variable to be set.","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"201":{"description":"Participant registered to Peppol","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"peppolId":{"type":"string","example":"iso6523-actorid-upis::0154:12345678","description":"The Peppol participant identifier that was registered"}}}}}}}},"400":{"description":"Validation error – verification incomplete or already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notVerified":{"value":{"success":false,"error":{"code":"PEPPOL_REGISTRATION_NOT_VERIFIED","message":"All verification steps must be completed before registering to Peppol"}}},"alreadyRegistered":{"value":{"success":false,"error":{"code":"PEPPOL_ALREADY_REGISTERED","message":"Participant is already registered to Peppol"}}},"unsupportedCountry":{"value":{"success":false,"error":{"code":"UNSUPPORTED_COUNTRY","message":"Unsupported country code"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Participant not found"},"500":{"description":"Server configuration error – PEPPOL_AP_ENDPOINT_URL not set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notConfigured":{"value":{"success":false,"error":{"code":"PEPPOL_AP_ENDPOINT_NOT_CONFIGURED","message":"Peppol AP endpoint URL is not configured (PEPPOL_AP_ENDPOINT_URL)"}}}}}}}}},"delete":{"tags":["Participants"],"summary":"Unregister participant from Peppol","description":"Removes the participant's Peppol registration. Deactivates all peppolIds records, deletes SMP service metadata, and sets participant.peppolRegistered = false.","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Participant unregistered from Peppol","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"unregistered":{"type":"boolean","example":true}}}}}}}},"400":{"description":"Participant is not registered to Peppol","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notRegistered":{"value":{"success":false,"error":{"code":"PEPPOL_NOT_REGISTERED","message":"Participant is not registered to Peppol"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Participant not found"}}}},"/participants/{participantId}/verify/initiate":{"post":{"tags":["Participants"],"summary":"Initiate participant company verification wizard","description":"Multi-step verification flow: (1) email verified, (2a) business identity via ARES/ADISSPR, (2b) bank payment 25 CZK from ADISSPR-registered account, (3+) authorized person, phone, PEPPOL. Returns current stage with per-stage issues and optional QR code HTML for payment step.","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["cs","en","sk"],"default":"cs"},"description":"Language for email notifications and error messages"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Verification status with staged summary","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"currentStage":{"type":"string","enum":["EMAIL","REGISTRATION","BANK_ACCOUNT","AUTHORIZED_PERSON","PHONE","PEPPOL"],"description":"The first incomplete verification stage"},"stages":{"type":"object","description":"Summary of each verification stage","additionalProperties":{"type":"object","properties":{"completed":{"type":"boolean"},"completedAt":{"type":"string","format":"date-time","nullable":true},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","example":"ARES_DIC_MISMATCH"},"message":{"type":"string","description":"Human-readable error message"}}}}}}},"verification":{"nullable":true,"type":"object","description":"Present only when BANK_ACCOUNT stage is active and a pending payment verification exists","properties":{"verificationId":{"type":"string","format":"uuid"},"variableSymbol":{"type":"string","example":"9987654321","description":"10-digit payment variable symbol starting with 99"},"amount":{"type":"number","example":25},"currency":{"type":"string","example":"CZK"},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["pending","verified","expired","refunded","pending_review"]},"qrCodeDataUrl":{"type":"string","description":"Base64 PNG data URL of SPAYD ePlatby QR code"},"qrCodeHtml":{"type":"string","description":"Ready-to-embed HTML img tag for the QR code"}}}}}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"emailNotVerified":{"value":{"success":false,"error":{"code":"EMAIL_NOT_VERIFIED","message":"User email must be verified before initiating company verification"}}},"missingRegistrationId":{"value":{"success":false,"error":{"code":"MISSING_REGISTRATION_ID","message":"Participant must have a registrationNumber or taxId set"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Participant not found"}}}},"/participants/{participantId}/verify/status":{"get":{"tags":["Participants"],"summary":"Get participant verification status","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verification status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantVerificationStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/event-logs":{"get":{"tags":["Event Logs"],"summary":"List tenant-level audit/event logs across accessible tenants","description":"Returns tenant-scoped audit/event logs. For participant-scoped logs, use `/participants/{participantId}/event-logs`.","parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Event log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/event-logs/{eventLogId}":{"get":{"tags":["Event Logs"],"summary":"Get an event log by ID","parameters":[{"name":"eventLogId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Event log detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLog"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/allowed-emails":{"get":{"tags":["Allowed Emails"],"summary":"List allowed emails across accessible tenants","description":"Returns allowed-email entries. Filter by participantId and optionally tenantId.","security":[{"bearerAuth":[]}],"parameters":[{"name":"tenantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional participant filter. Required for participant-scoped users."},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Allowed email list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedEmail"}}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Allowed Emails"],"summary":"Create an allowed email","description":"Creates an allowed-email entry for a participant accessible to the authenticated tenant user.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAllowedEmailRequest"}}}},"responses":{"201":{"description":"Allowed email created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/AllowedEmail"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications across accessible tenants","description":"Returns notification channels. Filter by participantId and optionally tenantId.","security":[{"bearerAuth":[]}],"parameters":[{"name":"tenantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional participant filter. Required for participant-scoped users."},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Notification channel list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Notifications"],"summary":"Create a notification channel","description":"Creates a notification channel for a participant accessible to the authenticated tenant user.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationRequest"}}}},"responses":{"201":{"description":"Notification channel created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Notification"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/notification-logs":{"get":{"tags":["Notification Logs"],"summary":"List notification logs across accessible tenants","description":"Returns notification log entries. Filter by participantId and optionally tenantId.","parameters":[{"name":"tenantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Optional participant filter. Required for participant-scoped users."},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Notification log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/notification-logs/{notificationLogId}":{"get":{"tags":["Notification Logs"],"summary":"Get a notification log by ID","parameters":[{"name":"notificationLogId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Notification log detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationLog"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tenants/{tenantId}/event-logs":{"get":{"tags":["Event Logs"],"summary":"List tenant-level audit/event logs for a tenant","description":"Returns tenant-scoped audit/event logs for the selected tenant. For participant-scoped logs, use `/participants/{participantId}/event-logs`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Event log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}/notification-logs":{"get":{"tags":["Notification Logs"],"summary":"List notification logs for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Notification log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/event-logs":{"get":{"tags":["Event Logs"],"summary":"List audit/event logs for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Event log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/reports":{"get":{"tags":["Reports"],"summary":"List Peppol reports across accessible tenants","parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"reportType","in":"query","schema":{"type":"string","enum":["eusr","tsr"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["generated","submitted","failed"]}},{"name":"year","in":"query","schema":{"type":"integer"},"description":"Reporting period year. Must be used together with `month`."},{"name":"month","in":"query","schema":{"type":"integer","minimum":1,"maximum":12},"description":"Reporting period month (1-12). Must be used together with `year`."},{"name":"createdSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter reports created after this ISO 8601 timestamp."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter by participant (resolves to the participant's tenant)."}],"responses":{"200":{"description":"Paginated report list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolReportListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/tenants/{tenantId}/reports":{"get":{"tags":["Reports"],"summary":"List Peppol reports for a tenant","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"reportType","in":"query","schema":{"type":"string","enum":["eusr","tsr"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["generated","submitted","failed"]}},{"name":"year","in":"query","schema":{"type":"integer"},"description":"Reporting period year. Must be used together with `month`."},{"name":"month","in":"query","schema":{"type":"integer","minimum":1,"maximum":12},"description":"Reporting period month (1-12). Must be used together with `year`."},{"name":"createdSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter reports created after this ISO 8601 timestamp."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Reserved for future filtering by participant."}],"responses":{"200":{"description":"Paginated report list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolReportListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/reports":{"get":{"tags":["Reports"],"summary":"List Peppol reports for a participant's tenant","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"name":"createdSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter reports created after this ISO 8601 timestamp."}],"responses":{"200":{"description":"Paginated report list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolReportListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/reports/{reportId}":{"get":{"tags":["Reports"],"summary":"Get a Peppol report by ID","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Report detail including XML payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolReport"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/peppol-logs":{"get":{"tags":["Peppol Logs"],"summary":"List Peppol transmission logs across accessible tenants","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"name":"tenantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter by tenant ID."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter by participant ID."},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"name":"createdSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter logs created after this ISO 8601 timestamp."}],"responses":{"200":{"description":"Paginated peppol log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/peppol-logs/{logId}":{"get":{"tags":["Peppol Logs"],"summary":"Get a Peppol log entry by ID","security":[{"bearerAuth":[]}],"parameters":[{"name":"logId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Peppol log detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolLog"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tenants/{tenantId}/peppol-logs":{"get":{"tags":["Peppol Logs"],"summary":"List Peppol transmission logs for a tenant","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier within the tenant.","security":[{"bearerAuth":[]}],"parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter by participant ID."},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"responses":{"200":{"description":"Paginated peppol log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/peppol-logs":{"get":{"tags":["Peppol Logs"],"summary":"List Peppol transmission logs for a participant","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"name":"createdSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter logs created after this ISO 8601 timestamp."}],"responses":{"200":{"description":"Paginated peppol log list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/tenants/{tenantId}/invitations":{"get":{"tags":["Invitations"],"summary":"List invitations for a tenant","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Invitation list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Invitations"],"summary":"Create an invitation for a tenant (admin only)","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"participantId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","member","viewer"]}}}}}},"responses":{"201":{"description":"Invitation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api-keys":{"get":{"tags":["API Keys"],"summary":"List API keys across accessible tenants","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier.","parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"API key list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["API Keys"],"summary":"Create an API key","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` in the request body. If both are provided, they must identify the same participant.","parameters":[{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","permissions"],"properties":{"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"name":{"type":"string"},"scope":{"type":"string","enum":["tenant","participant"]},"permissions":{"type":"array","items":{"type":"string","enum":["send","receive","lookup","manage"]}},"rateLimit":{"type":"string"},"isActive":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api-keys/{apiKeyId}":{"get":{"tags":["API Keys"],"summary":"Get an API key by ID","parameters":[{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["API Keys"],"summary":"Update an API key","parameters":[{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"participantId":{"type":"string","format":"uuid","nullable":true},"scope":{"type":"string","enum":["tenant","participant"]},"permissions":{"type":"array","items":{"type":"string","enum":["send","receive","lookup","manage"]}},"rateLimit":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","nullable":true}}}}}},"responses":{"200":{"description":"API key updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"tags":["API Keys"],"summary":"Delete an API key","parameters":[{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key deleted"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}/api-keys":{"get":{"tags":["API Keys"],"summary":"List API keys for a tenant","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier within the tenant.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"responses":{"200":{"description":"API key list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["API Keys"],"summary":"Create an API key","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","permissions"],"properties":{"name":{"type":"string"},"participantId":{"type":"string","format":"uuid"},"scope":{"type":"string","enum":["tenant","participant"]},"permissions":{"type":"array","items":{"type":"string","enum":["send","receive","lookup","manage"]}},"rateLimit":{"type":"string"},"isActive":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}/api-keys":{"get":{"tags":["API Keys"],"summary":"List API keys for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"API key list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["API Keys"],"summary":"Create an API key for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","permissions"],"properties":{"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["send","receive","lookup","manage"]}},"rateLimit":{"type":"string"},"isActive":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier.","parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Webhook list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Webhooks"],"summary":"Register a webhook","parameters":[{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/tenants/{tenantId}/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks for a tenant","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier within the tenant.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Webhook list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Webhooks"],"summary":"Register a webhook for a tenant","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Webhook list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Webhooks"],"summary":"Register a webhook for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/webhooks/{webhookId}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook by ID","parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Webhooks"],"summary":"Update a webhook","parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"responses":{"200":{"description":"Webhook updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}/allowed-emails":{"get":{"tags":["Allowed Emails"],"summary":"List allowed emails for a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of allowed emails","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedEmail"}}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Allowed Emails"],"summary":"Add an allowed email for a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAllowedEmailRequest"}}}},"responses":{"201":{"description":"Allowed email created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/AllowedEmail"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/allowed-emails/{allowedEmailId}":{"patch":{"tags":["Allowed Emails"],"summary":"Update an allowed email","security":[{"bearerAuth":[]}],"parameters":[{"name":"allowedEmailId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAllowedEmailRequest"}}}},"responses":{"200":{"description":"Allowed email updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/AllowedEmail"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Allowed Emails"],"summary":"Delete an allowed email","security":[{"bearerAuth":[]}],"parameters":[{"name":"allowedEmailId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Allowed email deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/participants/{participantId}/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications for a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of notification channels","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Notifications"],"summary":"Add a notification channel for a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationRequest"}}}},"responses":{"201":{"description":"Notification channel created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Notification"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/notifications/{notificationId}":{"patch":{"tags":["Notifications"],"summary":"Update a notification channel","security":[{"bearerAuth":[]}],"parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationRequest"}}}},"responses":{"200":{"description":"Notification channel updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Notification"}},"required":["success","data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Notifications"],"summary":"Delete a notification channel","security":[{"bearerAuth":[]}],"parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Notification channel deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/notifications/{notificationId}/notification-logs":{"get":{"tags":["Notification Logs"],"summary":"List notification logs for a notification channel","security":[{"bearerAuth":[]}],"parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Notification log list for the notification channel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationLogListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/invitations":{"post":{"tags":["Invitations"],"summary":"Create an invitation","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` in the request body. If both are provided, they must identify the same participant.","parameters":[{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"tenantId":{"type":"string","format":"uuid"},"participantId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","member","viewer"]}}}}}},"responses":{"201":{"description":"Invitation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"get":{"tags":["Invitations"],"summary":"List invitations across accessible tenants and participants","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier.","security":[{"bearerAuth":[]}],"parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Invitation list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/invitations/{invitationId}":{"get":{"tags":["Invitations"],"summary":"Get an invitation by ID","parameters":[{"name":"invitationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Invitations"],"summary":"Revoke an invitation","parameters":[{"name":"invitationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation revoked"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/participants/{participantId}/users":{"get":{"tags":["Participants"],"summary":"List users assigned to a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"responses":{"200":{"description":"User list","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"role":{"type":"string","enum":["admin","member","sender","reader","viewer"]}}}},"count":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Participants"],"summary":"Assign a user to a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","member","sender","reader","viewer"],"default":"reader"}}}}}},"responses":{"201":{"description":"User assigned to participant"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/users/{userId}":{"patch":{"tags":["Participants"],"summary":"Update a participant user's role","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"name":"userId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["admin","member","sender","reader","viewer"]}}}}}},"responses":{"200":{"description":"Participant user updated"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Participants"],"summary":"Remove a user from a participant","security":[{"bearerAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"name":"userId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User removed from participant"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/participants/{participantId}/invitations":{"get":{"tags":["Invitations"],"summary":"List invitations for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Invitation list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Invitations"],"summary":"Create an invitation for a participant","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["admin","member","viewer"]}}}}}},"responses":{"201":{"description":"Invitation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/lookup/{country}/{ico}":{"get":{"tags":["Lookup"],"summary":"Look up Peppol participant by country and ICO","security":[],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"},"description":"Country code (e.g. cz, sk)"},{"name":"ico","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentType","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lookup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}},"404":{"description":"Not found"}}}},"/participants":{"get":{"tags":["Participants"],"summary":"List participants available to the authenticated user","description":"API-key variant of participant listing. When `X-Peppol-Participant-Id` is provided, the server resolves the participant from the Peppol identifier and returns the matching accessible participant.","security":[{"apiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"}],"responses":{"200":{"description":"Participant list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents":{"get":{"tags":["Documents"],"summary":"List documents across accessible tenants and participants","description":"`X-Peppol-Participant-Id` can be used instead of `participantId` to resolve the participant from a Peppol identifier.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"tenantId","in":"query","schema":{"type":"string"},"description":"Optional tenant filter."},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PeppolParticipantIdHeader"},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"direction","in":"query","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"documentType","in":"query","schema":{"type":"string"}},{"name":"documentNumber","in":"query","schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string"}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"order","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Document list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/tenants/{tenantId}/documents":{"get":{"tags":["Documents"],"summary":"List documents for a tenant","security":[{"bearerAuth":[]}],"parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"participantId","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"direction","in":"query","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"documentType","in":"query","schema":{"type":"string"}},{"name":"documentNumber","in":"query","schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string"}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"order","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Document list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/documents":{"get":{"tags":["Documents"],"summary":"List documents for a participant","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/PaginationPageToken"},{"name":"direction","in":"query","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"documentType","in":"query","schema":{"type":"string"}},{"name":"documentNumber","in":"query","schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string"}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"order","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Document list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/documents/inbox":{"get":{"tags":["Documents"],"summary":"Get unread inbound documents for a participant","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/PaginationLimit"}],"responses":{"200":{"description":"List of unread inbound documents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantInboxDocumentListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/participants/{participantId}/documents/send":{"post":{"tags":["Documents"],"summary":"Send a UBL document via Peppol","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["receiverPeppolId","documentTypeIdentifier","content"],"properties":{"receiverPeppolId":{"type":"string","example":"0192:87654321"},"documentTypeIdentifier":{"type":"string","example":"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"},"processIdentifier":{"type":"string","example":"urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"},"content":{"type":"string","description":"UBL XML content"},"metadata":{"type":"object"}}}}}},"responses":{"201":{"description":"Document queued for sending"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/participants/{participantId}/documents/send/isdoc":{"post":{"tags":["Documents"],"summary":"Send an ISDOC document (auto-converted to UBL)","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["receiverPeppolId","content"],"properties":{"receiverPeppolId":{"type":"string","example":"0192:87654321"},"processIdentifier":{"type":"string"},"content":{"type":"string","description":"ISDOC XML content"},"metadata":{"type":"object"}}}}}},"responses":{"201":{"description":"Document queued for sending"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/participants/{participantId}/documents/send/pohoda":{"post":{"tags":["Documents"],"summary":"Send a Pohoda XML document (auto-converted to UBL)","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["receiverPeppolId","content"],"properties":{"receiverPeppolId":{"type":"string","example":"0192:87654321"},"processIdentifier":{"type":"string"},"content":{"type":"string","description":"Pohoda XML content"},"metadata":{"type":"object"}}}}}},"responses":{"201":{"description":"Document queued for sending"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}/status":{"get":{"tags":["Documents"],"summary":"Get document delivery status","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantDocumentStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}/download":{"get":{"tags":["Documents"],"summary":"Download document in its original format","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Original document content","content":{"application/xml":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}/download/isdoc":{"get":{"tags":["Documents"],"summary":"Download document converted to ISDOC","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ISDOC XML","content":{"application/xml":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}/download/pohoda":{"get":{"tags":["Documents"],"summary":"Download document converted to Pohoda XML","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pohoda XML","content":{"application/xml":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}/download/pdf":{"get":{"tags":["Documents"],"summary":"Download document converted to PDF","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"PDF document","content":{"application/pdf":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"501":{"$ref":"#/components/responses/NotImplemented"},"502":{"$ref":"#/components/responses/BadGateway"}}}},"/documents/{documentId}/acknowledge":{"post":{"tags":["Documents"],"summary":"Acknowledge a document","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document acknowledged"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/documents/{documentId}":{"get":{"tags":["Documents"],"summary":"Get a document","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Document not found"}}},"patch":{"tags":["Documents"],"summary":"Update a document","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentNumber":{"type":"string"},"documentType":{"type":"string"},"status":{"type":"string"},"metadata":{"type":"object"}}}}}},"responses":{"200":{"description":"Updated document"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Document not found"}}},"delete":{"tags":["Documents"],"summary":"Delete a document","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted successfully"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Document not found"}}}}}}