{"openapi":"3.1.0","info":{"title":"Avanan API","description":"Modern FastAPI implementation of Avanan API","version":"2.0.0"},"paths":{"/auth/token":{"post":{"tags":["authentication"],"summary":"Get Token","description":"Get a new access token and refresh token\n\nAfter calling this route once, it's preferable to call /auth/refresh_token \ninstead of sending the client id and secret every time","operationId":"get_token_auth_token_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["authentication"],"summary":"Get Token Get","description":"GET version of token endpoint for backward compatibility","operationId":"get_token_get_auth_token_get","parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},{"name":"client_secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh_token":{"post":{"tags":["authentication"],"summary":"Refresh Token Endpoint","description":"Refresh the access token using the refresh token\n\nThis route refreshes the access token by using the refresh token.\nIt's different from the /auth/token route because it does not require \nthe reseller's id and secret.","operationId":"refresh_token_endpoint_auth_refresh_token_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["authentication"],"summary":"Refresh Token Get","description":"GET version of refresh token endpoint for backward compatibility","operationId":"refresh_token_get_auth_refresh_token_get","parameters":[{"name":"refresh_token","in":"query","required":true,"schema":{"type":"string","title":"Refresh Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers/":{"get":{"tags":["customers"],"summary":"Get Customers","description":"Return a list of customers for this reseller (new wrapped format)","operationId":"get_customers_customers__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/customers/customer/{customer}/status":{"get":{"tags":["customers","customer-specific"],"summary":"Get Customer Status","description":"Get customer status","operationId":"get_customer_status_customers_customer__customer__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["customers","customer-specific"],"summary":"Update Customer Status Endpoint","description":"Update customer status","operationId":"update_customer_status_endpoint_customers_customer__customer__status_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Customer Status Endpoint Customers Customer  Customer  Status Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers/customer/{customer}/license":{"get":{"tags":["customers","customer-specific"],"summary":"Get Customer License Endpoint","description":"Get customer license information","operationId":"get_customer_license_endpoint_customers_customer__customer__license_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLicense"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["customers","customer-specific"],"summary":"Update Customer License Endpoint","description":"Update customer license information","operationId":"update_customer_license_endpoint_customers_customer__customer__license_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLicenseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Customer License Endpoint Customers Customer  Customer  License Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["customers","customer-specific"],"summary":"Update Customer License Put Endpoint","description":"Update customer license information (PUT method for backward compatibility)\nThe difference between PUT and POST is that PUT traditionally uses duration in days,\nwhile POST uses expiration_date. Both are now supported in either method.","operationId":"update_customer_license_put_endpoint_customers_customer__customer__license_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLicenseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Customer License Put Endpoint Customers Customer  Customer  License Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers/customer/{customer}/statistics":{"get":{"tags":["customers","customer-specific"],"summary":"Get Customer Statistics Endpoint","description":"Get customer statistics for a time period","operationId":"get_customer_statistics_endpoint_customers_customer__customer__statistics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}},{"name":"time_period","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Time Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStatistics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers/all_customer_statistics":{"get":{"tags":["customers"],"summary":"Get All Customer Statistics","description":"Get statistics for all customers","operationId":"get_all_customer_statistics_customers_all_customer_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/customers/internal_all_customer_statistics":{"get":{"tags":["customers"],"summary":"Get Internal All Customer Statistics","description":"Get internal statistics for all customers","operationId":"get_internal_all_customer_statistics_customers_internal_all_customer_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/customer/{customer}/status":{"get":{"summary":"Customer Status Legacy","description":"Legacy customer status endpoint","operationId":"customer_status_legacy_customer__customer__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Customer Status Update Legacy","description":"Legacy customer status update endpoint","operationId":"customer_status_update_legacy_customer__customer__status_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customer/{customer}/license":{"get":{"summary":"Customer License Legacy","description":"Legacy customer license endpoint","operationId":"customer_license_legacy_customer__customer__license_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Customer License Update Legacy","description":"Legacy customer license update endpoint","operationId":"customer_license_update_legacy_customer__customer__license_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLicenseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customer/{customer}/statistics":{"get":{"summary":"Customer Statistics Legacy","description":"Legacy customer statistics endpoint","operationId":"customer_statistics_legacy_customer__customer__statistics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}},{"name":"time_period","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Time Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customer/{customer}/statistics_old":{"get":{"summary":"Customer Statistics Old Legacy","description":"Legacy customer statistics_old endpoint","operationId":"customer_statistics_old_legacy_customer__customer__statistics_old_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","title":"Customer"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/all_customer_statistics":{"get":{"summary":"Get All Customer Statistics Legacy","description":"Backward compatibility endpoint for all customer statistics at root level","operationId":"get_all_customer_statistics_legacy_all_customer_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/internal_all_customer_statistics":{"get":{"summary":"Get Internal All Customer Statistics Legacy","description":"Backward compatibility endpoint for internal all customer statistics at root level","operationId":"get_internal_all_customer_statistics_legacy_internal_all_customer_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/customers":{"get":{"summary":"Get Customers Legacy","description":"Backward compatibility endpoint for v1.0 API - returns direct array","operationId":"get_customers_legacy_customers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/health_check":{"get":{"summary":"Health Check","description":"Health check endpoint with memory info","operationId":"health_check_health_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gc":{"get":{"summary":"Force Gc","description":"Force garbage collection - debugging endpoint","operationId":"force_gc_gc_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ping":{"get":{"summary":"Ping","description":"Basic ping endpoint with optional reseller info for backward compatibility","operationId":"ping_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"CustomerLicense":{"properties":{"mode":{"anyOf":[{"$ref":"#/components/schemas/CustomerMode"},{"type":"null"}]},"deployment_expires":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployment Expires"},"data":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Data"},"quota":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Quota"},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days"},"success":{"type":"boolean","title":"Success","default":true}},"type":"object","title":"CustomerLicense","description":"Customer license information"},"CustomerLicenseUpdate":{"properties":{"mode":{"anyOf":[{"$ref":"#/components/schemas/CustomerMode"},{"type":"null"}]},"data":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Data"},"expiration_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiration Date"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"}},"type":"object","title":"CustomerLicenseUpdate","description":"Customer license update request"},"CustomerListResponse":{"properties":{"customers":{"items":{"type":"string"},"type":"array","title":"Customers"},"success":{"type":"boolean","title":"Success","default":true}},"type":"object","required":["customers"],"title":"CustomerListResponse","description":"Response for customer list"},"CustomerMode":{"type":"string","enum":["paid","poc","demo"],"title":"CustomerMode","description":"Customer deployment mode"},"CustomerStatistics":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"info":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Info"},"active_sectools":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Active Sectools","default":[]},"admins":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Admins","default":[]},"events":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Events","default":{}},"last_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login"},"policies":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Policies","default":[]},"users":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Users","default":{}}},"additionalProperties":true,"type":"object","title":"CustomerStatistics","description":"Customer statistics response - Production compatible format"},"CustomerStatus":{"type":"string","enum":["active","disabled","pending-deletion","error"],"title":"CustomerStatus","description":"Customer status enumeration"},"CustomerStatusResponse":{"properties":{"status":{"$ref":"#/components/schemas/CustomerStatus"},"success":{"type":"boolean","title":"Success","default":true}},"type":"object","required":["status"],"title":"CustomerStatusResponse","description":"Customer status response"},"CustomerStatusUpdate":{"properties":{"status":{"$ref":"#/components/schemas/CustomerStatus"}},"type":"object","required":["status"],"title":"CustomerStatusUpdate","description":"Customer status update request"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RefreshTokenRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshTokenRequest","description":"Request model for token refresh"},"TokenRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["client_id"],"title":"TokenRequest","description":"Request model for token generation"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"expires_in":{"type":"string","format":"date-time","title":"Expires In"},"refresh_token":{"type":"string","title":"Refresh Token"},"refresh_token_expires_in":{"type":"string","format":"date-time","title":"Refresh Token Expires In"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"}},"type":"object","required":["access_token","expires_in","refresh_token","refresh_token_expires_in"],"title":"TokenResponse","description":"Response model for token generation"},"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":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}