{"openapi":"3.1.0","info":{"title":"Marketplace API","version":"2.0.0"},"servers":[{"url":"https://portal.domotz.com","description":"Production"}],"paths":{"/marketplace-api/v2/account":{"get":{"tags":["v2"],"summary":"Retrieve Accounts","description":"Retrieve all the accounts","operationId":"get_account_list_v2","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountReadAll"}}}}}},"post":{"tags":["v2"],"summary":"Create Account","description":"Creates an account on the Domotz system","operationId":"create_account_v2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeviceModeCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreateResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v2/account/{email}":{"get":{"tags":["v2"],"summary":"Retrieve Account","description":"This endpoint allows retrieving the specific account.\n\nDetails:\n\n- **DEVICE Model:**\n  You can retrieve the following limits:\n  - `TEAM_MEMBERS`\n  - `MANAGED_DEVICES`\n\n- **LOCATION Model:**\n  You can retrieve the following limits:\n  - `TEAM_MEMBERS`\n  - `AGENTS`","operationId":"get_account_v2","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v2/account/{email}/status":{"put":{"tags":["v2"],"summary":"Update Account Status","description":"Updates an existing account status with the given values","operationId":"update_account_status_v2","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateStatus"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v2/account/{email}/products":{"put":{"tags":["v2"],"summary":"Update Account Products","description":"This endpoint allows updating the account products with the provided values.\n\nDetails:\n\n- **DEVICE Model:**\n  You can update the following limits:\n  - `TEAM_MEMBERS`\n  - `MANAGED_DEVICES`\n\n- **LOCATION Model:**\n  You can update the following limits:\n  - `TEAM_MEMBERS`\n  - `AGENTS`\n\nRequired Parameters:\n- Specify the values to be updated based on the user's model (DEVICE or LOCATION).\n\nNote:\nEnsure to provide valid values for the specified account model, otherwise the operation will fail.","operationId":"update_account_products_v2","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeviceModeUpdateProducts"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v2/agreements":{"get":{"tags":["v2"],"summary":"Get Privacy Policy And Terms And Conditions","description":"Returns the latest Privacy Policy and Terms and Conditions","operationId":"get_privacy_policy_v2","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyPolicyResponse"}}}}}}},"/marketplace-api/v2/billing-report/{year}/{month}":{"get":{"tags":["v2"],"summary":"Products Usage Report","description":"Returns a report of the customers' product usage for the given month","operationId":"get_billing_report_v2","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"path","required":true,"schema":{"type":"integer","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v1/account":{"get":{"tags":["v1 (deprecated)"],"summary":"Retrieve Accounts","description":"Retrieve all the accounts","operationId":"get_account_list","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountReadAll"}}}}}},"post":{"tags":["v1 (deprecated)"],"summary":"Create Account","description":"Creates an account on the Domotz system","operationId":"create_account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreateResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v1/account/{email}":{"get":{"tags":["v1 (deprecated)"],"summary":"Retrieve Account","description":"Retrieve the specific account","operationId":"get_account","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v1/account/{email}/status":{"put":{"tags":["v1 (deprecated)"],"summary":"Update Account Status","description":"Updates an existing account status with the given values","operationId":"update_account_status","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateStatus"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v1/account/{email}/products":{"put":{"tags":["v1 (deprecated)"],"summary":"Update Account Products","description":"Updates the account products with the given values","operationId":"update_account_products","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateProducts"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace-api/v1/agreements":{"get":{"tags":["v1 (deprecated)"],"summary":"Get Privacy Policy And Terms And Conditions","description":"Returns the latest Privacy Policy and Terms and Conditions","operationId":"get_privacy_policy","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyPolicyResponse"}}}}}}},"/marketplace-api/v1/billing-report/{year}/{month}":{"get":{"tags":["v1 (deprecated)"],"summary":"Products Usage Report","description":"Returns a report of the customers' product usage for the given month","operationId":"get_billing_report","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"path","required":true,"schema":{"type":"integer","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/backend-api/v1/status":{"get":{"tags":["operations"],"summary":"Application Status","description":"Get the status of the application and of all its modules","operationId":"get_status","parameters":[{"name":"check_backend_services","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Check Backend Services"}},{"name":"check_modules","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Check Modules"}},{"name":"get_dependencies","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Get Dependencies"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountCreate":{"properties":{"email":{"type":"string","title":"Email"},"country":{"type":"string","maxLength":2,"title":"The user's country","description":"The ISO-3166 Alpha-2 code (e.g. US)"},"products":{"$ref":"#/components/schemas/ProductWriteObject","description":"Defines the products configuration. If a product is not specified, the quantity for that product will be set to 0"},"account_status":{"$ref":"#/components/schemas/AccountStatus"},"privacy_policy":{"type":"string","title":"Privacy Policy"},"terms_and_conditions":{"type":"string","title":"Terms And Conditions"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"type":"object","required":["email","country","products","account_status","privacy_policy","terms_and_conditions"],"title":"AccountCreate"},"AccountCreateResult":{"properties":{"access_url":{"type":"string","title":"Access Url"}},"type":"object","required":["access_url"],"title":"AccountCreateResult"},"AccountDeviceModeCreate":{"properties":{"email":{"type":"string","title":"Email"},"country":{"type":"string","maxLength":2,"title":"The user's country","description":"The ISO-3166 Alpha-2 code (e.g. US)"},"products":{"$ref":"#/components/schemas/ProductDeviceWriteObject","description":"Defines the products configuration. If a product is not specified, the quantity for that product will be set to 0"},"account_status":{"$ref":"#/components/schemas/AccountStatus"},"privacy_policy":{"type":"string","title":"Privacy Policy"},"terms_and_conditions":{"type":"string","title":"Terms And Conditions"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"type":"object","required":["email","country","products","account_status","privacy_policy","terms_and_conditions"],"title":"AccountDeviceModeCreate"},"AccountDeviceModeUpdateProducts":{"properties":{"products":{"$ref":"#/components/schemas/AllProductWriteObject","description":"Describes the products configuration. If a product is not specified, its quantity will not be changed"}},"type":"object","required":["products"],"title":"AccountDeviceModeUpdateProducts","example":{"products":{"AGENTS":{"quantity":8},"MANAGED_DEVICES":{"quantity":8},"TEAM_MEMBERS":{"quantity":10}}}},"AccountMinimal":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"AccountMinimal"},"AccountRead":{"additionalProperties":true,"type":"object"},"AccountReadAll":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AccountMinimal"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"AccountReadAll"},"AccountStatus":{"type":"string","enum":["TRIAL","ACTIVE","SUSPENDED","TRIAL_EXPIRED"],"title":"AccountStatus"},"AccountUpdateProducts":{"properties":{"products":{"$ref":"#/components/schemas/ProductWriteObject","description":"Describes the products configuration. If a product is not specified, its quantity will not be changed"}},"type":"object","required":["products"],"title":"AccountUpdateProducts","example":{"products":{"AGENTS":{"quantity":8},"MSP_INTEGRATIONS":{"quantity":100},"TEAM_MEMBERS":{"quantity":10}}}},"AccountUpdateStatus":{"properties":{"account_status":{"$ref":"#/components/schemas/AccountStatus"}},"type":"object","required":["account_status"],"title":"AccountUpdateStatus","example":{"account_status":"SUSPENDED"}},"AllProductWriteObject":{"properties":{"TEAM_MEMBERS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]},"AGENTS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]},"MANAGED_DEVICES":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]}},"type":"object","title":"AllProductWriteObject"},"Contract":{"properties":{"version":{"type":"string","title":"Version"},"url":{"type":"string","title":"Url","description":"The URL of Privacy Policy or Terms and Conditions"}},"type":"object","required":["version","url"],"title":"Contract"},"CustomerReport":{"properties":{"email":{"type":"string","title":"Email"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"country":{"type":"string","maxLength":2,"title":"The user's country","description":"The ISO-3166 Alpha-2 code (e.g. US)"},"creation_time":{"type":"string","format":"date-time","title":"Creation Time"},"end_of_trial_time":{"type":"string","format":"date-time","title":"End Of Trial Time"},"last_status_change":{"type":"string","format":"date-time","title":"Last Status Change"},"account_status":{"type":"string","title":"Account Status"},"products":{"$ref":"#/components/schemas/ProductsUsage","description":"The maximum number of billable items of this productin the billing period"}},"type":"object","required":["email","first_name","last_name","country","creation_time","end_of_trial_time","last_status_change","account_status","products"],"title":"CustomerReport"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MarketplaceAccountMode":{"type":"string","enum":["LOCATION","DEVICE"],"title":"MarketplaceAccountMode"},"ModuleDTO":{"properties":{"status":{"type":"string","enum":["ok","fail"],"title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["status"],"title":"ModuleDTO"},"PrivacyPolicyResponse":{"properties":{"privacy_policy":{"$ref":"#/components/schemas/Contract"},"terms_and_conditions":{"$ref":"#/components/schemas/Contract"}},"type":"object","required":["privacy_policy","terms_and_conditions"],"title":"PrivacyPolicyResponse","example":{"privacy_policy":{"url":"<vendor API Url>/content/us/pp_2.0.0.html","version":"2.0.0-20180525-US"},"terms_and_conditions":{"url":"<vendor API Url>/content/us/tc_2.0.0.html","version":"2.0.0-20180525-US"}}},"ProductDeviceWriteObject":{"properties":{"TEAM_MEMBERS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]},"MANAGED_DEVICES":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]}},"type":"object","title":"ProductDeviceWriteObject"},"ProductReadConfiguration":{"properties":{"quantity":{"type":"integer","minimum":0.0,"title":"Quantity"},"used":{"type":"integer","minimum":0.0,"title":"Used"}},"type":"object","required":["quantity","used"],"title":"ProductReadConfiguration"},"ProductReadObject":{"additionalProperties":true,"type":"object"},"ProductUsage":{"properties":{"billed_items":{"type":"integer","minimum":0.0,"title":"Billed Items"}},"type":"object","required":["billed_items"],"title":"ProductUsage"},"ProductWriteConfiguration":{"properties":{"quantity":{"type":"integer","minimum":0.0,"title":"Quantity"}},"type":"object","required":["quantity"],"title":"ProductWriteConfiguration"},"ProductWriteObject":{"properties":{"TEAM_MEMBERS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]},"AGENTS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]},"MSP_INTEGRATIONS":{"anyOf":[{"$ref":"#/components/schemas/ProductWriteConfiguration"},{"type":"null"}]}},"type":"object","title":"ProductWriteObject"},"ProductsUsage":{"properties":{"TEAM_MEMBERS":{"$ref":"#/components/schemas/ProductUsage"},"AGENTS":{"$ref":"#/components/schemas/ProductUsage"},"MSP_INTEGRATIONS":{"$ref":"#/components/schemas/ProductUsage"},"MANAGED_DEVICES":{"$ref":"#/components/schemas/ProductUsage"}},"type":"object","required":["TEAM_MEMBERS","AGENTS","MSP_INTEGRATIONS","MANAGED_DEVICES"],"title":"ProductsUsage"},"RuntimeDTO":{"properties":{"python_version":{"type":"string","title":"Python Version"},"environment":{"type":"string","title":"Environment"},"is_docker":{"type":"boolean","title":"Is Docker"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"}},"type":"object","required":["python_version","environment","is_docker"],"title":"RuntimeDTO"},"StatusDTO":{"properties":{"package":{"type":"string","title":"Package"},"listening_port":{"type":"integer","title":"Listening Port"},"status":{"type":"string","title":"Status"},"time":{"type":"string","format":"date-time","title":"Time"},"modules":{"additionalProperties":{"$ref":"#/components/schemas/ModuleDTO"},"type":"object","title":"Modules"},"runtime":{"$ref":"#/components/schemas/RuntimeDTO"},"backend_services":{"additionalProperties":true,"type":"object","title":"Backend Services"},"python_dependencies":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Python Dependencies"}},"type":"object","required":["package","listening_port","status","time","modules","runtime","backend_services"],"title":"StatusDTO"},"TimePeriod":{"properties":{"from":{"type":"string","format":"date-time","title":"From"},"to":{"type":"string","format":"date-time","title":"To"}},"type":"object","required":["from","to"],"title":"TimePeriod"},"UsageReport":{"properties":{"metadata":{"$ref":"#/components/schemas/UsageReportMetadata"},"customers":{"items":{"$ref":"#/components/schemas/CustomerReport"},"type":"array","title":"Customers"},"summary":{"$ref":"#/components/schemas/UsageReportSummary"}},"type":"object","required":["metadata","customers","summary"],"title":"UsageReport"},"UsageReportMetadata":{"properties":{"billing_period":{"$ref":"#/components/schemas/TimePeriod"},"creation_time":{"type":"string","format":"date-time","title":"Creation Time"},"marketplace":{"type":"string","title":"Marketplace"},"version":{"type":"string","const":"1.0","title":"Version"}},"type":"object","required":["billing_period","creation_time","marketplace","version"],"title":"UsageReportMetadata"},"UsageReportSummary":{"properties":{"products":{"$ref":"#/components/schemas/ProductsUsage"}},"type":"object","required":["products"],"title":"UsageReportSummary"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"security":[{"ApiKey":[]}]}