{"openapi":"3.0.0","paths":{"/auth/environments":{"get":{"operationId":"getEnvironments","parameters":[{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"List of environments for the authenticated end user's connected target system","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponseDto"},{"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponseDto"}}}}]}}}}},"tags":["auth"]}},"/auth/companies":{"get":{"operationId":"getCompanies","parameters":[{"name":"environmentName","required":false,"in":"query","description":"Environment name (required for multi-environment systems such as Business Central)","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"List of companies for the authenticated end user's connected target system","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponseDto"},{"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyResponseDto"}}}}]}}}}},"tags":["auth"]}},"/auth/companiesFlow":{"get":{"operationId":"getCompaniesFlow","x-speakeasy-ignore":true,"parameters":[{"name":"environmentName","required":false,"in":"query","description":"Environment name (required for multi-environment systems such as Business Central)","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"List of companies for the authenticated end user's connected target system","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponseDto"},{"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyResponseDto"}}}}]}}}}},"tags":["auth"]}},"/auth/submit":{"get":{"operationId":"getSubmitPage","x-speakeasy-ignore":true,"parameters":[{"name":"code","required":true,"in":"query","description":"Unique code identifying the tenant submission session","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Submission page rendered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}}}}}}},"tags":["auth"]}},"/auth/apiKeyConfirmation":{"post":{"operationId":"apiKeyConfirmation","x-speakeasy-ignore":true,"parameters":[{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"201":{"description":"API key confirmed and redirect URL returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}}},"tags":["auth"]}},"/auth/cancel":{"post":{"operationId":"cancel","x-speakeasy-ignore":true,"parameters":[{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"201":{"description":"Cancellation redirect URL returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}}},"tags":["auth"]}},"/auth/test":{"get":{"operationId":"test","x-speakeasy-ignore":true,"parameters":[{"name":"accountKey","required":true,"in":"query","description":"End user account key (X-ACCOUNT-KEY) to pre-fill the confirmation page","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"API key confirmation page rendered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"}}}}}}},"tags":["auth"]}},"/auth/longToken":{"get":{"operationId":"longToken","x-speakeasy-ignore":true,"parameters":[{"name":"targetSystem","required":true,"in":"query","description":"Identifier of the target system (e.g. exact, sevdesk, xero)","schema":{"type":"string"}},{"name":"companyId","required":true,"in":"query","description":"ID of the company (required for multi-company target systems)","schema":{"type":"string"}},{"name":"callbackUrl","required":false,"in":"query","description":"URL to redirect to after successful authentication","schema":{"type":"string"}},{"name":"include_signature","required":false,"in":"query","description":"When set to true, appends a signature as a query parameter to the redirect URL.","schema":{"type":"boolean"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Long-lived authentication token URL returned successfully","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["auth"]}},"/auth/selections":{"get":{"operationId":"getEnvironmentPage","x-speakeasy-ignore":true,"parameters":[{"name":"state","required":true,"in":"query","description":"Encoded state value containing tenant and user context, returned from the OAuth redirect","schema":{"type":"string"}},{"name":"targetSystem","required":true,"in":"query","description":"Identifier of the target system (e.g. exact, sevdesk, xero)","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Environment or company selection page rendered successfully","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["auth"]}},"/auth/setEndUserSelections":{"post":{"operationId":"setEndUserSelections","x-speakeasy-ignore":true,"parameters":[{"name":"accountKey","required":true,"in":"query","description":"End user account key (X-ACCOUNT-KEY) identifying the end user whose selections are being saved","schema":{"type":"string"}},{"name":"environmentName","required":true,"in":"query","description":"Environment name (required for multi-environment systems such as Business Central)","schema":{"type":"string"}},{"name":"companyId","required":true,"in":"query","description":"ID of the company (required for multi-company target systems)","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"201":{"description":"End user environment and company selections saved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"tags":["auth"]}},"/auth/{TARGET_SYSTEM}":{"get":{"operationId":"systemLoginUrl","parameters":[{"name":"TARGET_SYSTEM","required":true,"in":"path","schema":{"type":"string"}},{"name":"callbackUrl","required":false,"in":"query","description":"URL to redirect to after successful authentication","schema":{"type":"string"}},{"name":"cancelCallbackUrl","required":false,"in":"query","description":"URL to redirect to if the user cancels authentication","schema":{"type":"string"}},{"name":"companyId","required":false,"in":"query","description":"ID of the company (required for multi-company target systems)","schema":{"type":"string"}},{"name":"tenantId","required":false,"in":"query","description":"Tenant ID to scope the authentication request (used for self-hosted or on-premise systems)","schema":{"type":"string"}},{"name":"baseUrl","required":false,"in":"query","description":"Base URL of the target system instance (required for self-hosted systems)","schema":{"type":"string"}},{"name":"environmentSelection","required":false,"in":"query","description":"When true, redirects the user to an environment or company selection page before completing authentication","schema":{"type":"boolean"}},{"name":"include_signature","required":false,"in":"query","description":"When set to true, appends a signature as a query parameter to the redirect URL.","schema":{"type":"boolean"}},{"name":"locale","required":false,"in":"query","description":"BCP-47 language tag (for example de or de-DE) the authentication pages should be shown in. Falls back to the texts configured without a locale.","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Authentication URL for the requested target system returned successfully","content":{"text/html":{"schema":{"type":"string"}}}}},"tags":["auth"]},"post":{"operationId":"systemLoginUrlPostAuth","parameters":[{"name":"TARGET_SYSTEM","required":true,"in":"path","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAuthWebhookRequestDto"}}}},"responses":{"201":{"description":"Authentication URL for the requested target system returned successfully","content":{"text/html":{"schema":{"type":"string"}}}}},"tags":["auth"]}},"/auth/callback/{TARGET_SYSTEM}":{"get":{"operationId":"callback","x-speakeasy-ignore":true,"parameters":[{"name":"TARGET_SYSTEM","required":true,"in":"path","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","description":"OAuth state parameter returned by the target system, encoding tenant and user context","schema":{"type":"string"}},{"name":"code","required":false,"in":"query","description":"Authorization code returned by the target system after successful OAuth consent","schema":{"type":"string"}},{"name":"realmId","required":false,"in":"query","description":"Realm ID returned by QuickBooks Online after OAuth consent","schema":{"type":"string"}},{"name":"token","required":false,"in":"query","description":"Access token returned directly by some target systems that do not use an authorization code flow","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"OAuth callback processed and redirect URL returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}}},"tags":["auth"]},"post":{"operationId":"callbackPost","x-speakeasy-ignore":true,"parameters":[{"name":"TARGET_SYSTEM","required":true,"in":"path","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Callback payload received and logged successfully","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean"}}}}}}},"tags":["auth"]}},"/auth/accounts/{TARGET_SYSTEM}":{"post":{"operationId":"createEndUserAccount","parameters":[{"name":"TARGET_SYSTEM","required":true,"in":"path","schema":{"type":"string"}},{"name":"companyId","required":false,"in":"query","description":"Optional company id to store as the end user's company selection (e.g. a Tripletex accountant client company), so the account and its company are set up in one call.","schema":{"type":"string"}},{"name":"X-API-KEY","description":"API key","in":"header","schema":{"type":"string"}},{"name":"X-ACCOUNT-KEY","description":"Account key","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEndUserRequestDto"}}}},"responses":{"201":{"description":"End user account created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"accountKey":{"type":"string"}}}}}}},"tags":["auth"]}}},"info":{"title":"Maesn unified API Auth","description":"The Maesn unified API auth description","version":"1.0","contact":{}},"tags":[{"name":"maesn","description":""}],"servers":[],"components":{"schemas":{"EnvironmentResponseDto":{"type":"object","properties":{"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"tenantId":{"type":"string","nullable":true},"applicationFamily":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true}},"required":["name"]},"PaginationResponse":{"type":"object","properties":{"total":{"type":"number"},"perPage":{"type":"number"},"currentPage":{"type":"number"},"totalPages":{"type":"number"}},"required":["total","perPage","currentPage","totalPages"]},"MetaResponse":{"type":"object","properties":{"warnings":{"nullable":true,"type":"array","items":{"type":"string"}},"pagination":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PaginationResponse"}]}}},"BaseResponseDto":{"type":"object","properties":{"meta":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/MetaResponse"}]},"data":{"type":"object"},"errors":{"type":"object","nullable":true},"rawData":{"type":"object","nullable":true}},"required":["data","errors","rawData"]},"Subscription":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true}},"required":["id"]},"CompanyResponseDto":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"environmentId":{"type":"string","nullable":true},"client_number":{"type":"number","nullable":true},"consultant_number":{"type":"number","nullable":true},"subscription":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}},"required":["id"]},"CreateAuthWebhookRequestDto":{"type":"object","properties":{"baseUrl":{"type":"string"},"callBackUrl":{"type":"string"},"cancelCallbackUrl":{"type":"string"},"includeSignature":{"type":"boolean"},"tenantId":{"type":"string"},"webhookCallbackUrl":{"type":"string"},"locale":{"type":"string"}}},"CreateEndUserRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"baseUrl":{"type":"string"},"clientName":{"type":"string"},"clientSecret":{"type":"string"},"database":{"type":"string"},"mandant":{"type":"string"},"password":{"type":"string"},"tenantId":{"type":"string"},"url":{"type":"string"},"username":{"type":"string"}},"required":["apiKey","baseUrl","clientName","clientSecret","database","mandant","password","tenantId","url","username"]}}}}