{"openapi":"3.1.0","info":{"title":"Instant Classification API","version":"0.1.0"},"servers":[{"url":"https://instant-classification-api.thedatacity.com","description":"Production"}],"paths":{"/api/v1/login/access-token":{"post":{"tags":["login"],"summary":"Login Access Token","description":"OAuth2 compatible token login, get an access token for future requests","operationId":"login-login_access_token","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login-login_access_token"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/login/test-token":{"post":{"tags":["login"],"summary":"Test Token","description":"Test access token","operationId":"login-test_token","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/password-recovery/{email}":{"post":{"tags":["login"],"summary":"Recover Password","description":"Password Recovery","operationId":"login-recover_password","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reset-password/":{"post":{"tags":["login"],"summary":"Reset Password","description":"Reset password","operationId":"login-reset_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPassword"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/":{"get":{"tags":["users"],"summary":"Read Users","description":"Retrieve users.","operationId":"users-read_users","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["users"],"summary":"Create User","description":"Create new user.","operationId":"users-create_user","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/me":{"get":{"tags":["users"],"summary":"Read User Me","description":"Get current user.","operationId":"users-read_user_me","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["users"],"summary":"Delete User Me","description":"Delete own user.","operationId":"users-delete_user_me","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["users"],"summary":"Update User Me","description":"Update own user.","operationId":"users-update_user_me","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateMe"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/users/me/password":{"patch":{"tags":["users"],"summary":"Update Password Me","description":"Update own password.","operationId":"users-update_password_me","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePassword"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/users/signup":{"post":{"tags":["users"],"summary":"Register User","description":"Create new user without the need to be logged in.","operationId":"users-register_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegister"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}":{"get":{"tags":["users"],"summary":"Read User By Id","description":"Get a specific user by id.","operationId":"users-read_user_by_id","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["users"],"summary":"Update User","description":"Update a user.","operationId":"users-update_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Delete User","description":"Delete a user.","operationId":"users-delete_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/utils/public-config":{"get":{"tags":["utils"],"summary":"Read Public Config","description":"Return non-sensitive settings needed by the public frontend.","operationId":"utils-read_public_config","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicConfig"}}}}}}},"/api/v1/instantClassification":{"post":{"tags":["classification"],"summary":"Instant Classification","description":"Classify a company using the instant classification service.\n\nThis endpoint requires authentication. The user must be logged in with a valid JWT token.","operationId":"classification-instant_classification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstantClassificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstantClassificationResponse"}}}},"400":{"description":"Invalid request, or the account is inactive."},"401":{"description":"No Authorization header, or the token is expired, malformed or no longer identifies an account. Get a new token."},"402":{"description":"Free-tier usage quota exhausted."},"429":{"description":"Rate limit exceeded. Body uses an `error` key rather than `detail`."},"500":{"description":"Unexpected server error."},"502":{"description":"The upstream classification engine returned an error."},"503":{"description":"Classification engine unreachable or timed out after server-side retries. Timeouts surface here rather than as 504."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}}},"components":{"schemas":{"Body_login-login_access_token":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login-login_access_token"},"ClassificationResult":{"properties":{"Code":{"type":"string","title":"Code"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"Score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"WordsMatched":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wordsmatched"}},"type":"object","required":["Code"],"title":"ClassificationResult"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InstantClassificationRequest":{"properties":{"Text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Text","description":"Company description to classify. Send either Text or Website, not both."},"Website":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Website","description":"Company website URL to classify. Send either Website or Text, not both."}},"type":"object","title":"InstantClassificationRequest","description":"Request model for instant company classification.","examples":[{"Text":"Software development and consulting services"},{"Website":"https://example.com"}]},"InstantClassificationResponse":{"properties":{"RTICs":{"anyOf":[{"items":{"$ref":"#/components/schemas/ClassificationResult"},"type":"array"},{"type":"null"}],"title":"Rtics","description":"Real Time Industry Classification codes","default":[]},"SimilarCompanies":{"anyOf":[{"items":{"$ref":"#/components/schemas/SimilarCompany"},"type":"array"},{"type":"null"}],"title":"Similarcompanies","description":"Companies with similar business activities","default":[]},"RSICs":{"anyOf":[{"items":{"$ref":"#/components/schemas/RSIC"},"type":"array"},{"type":"null"}],"title":"Rsics","description":"Recommended Standard Industrial Classification codes","default":[]},"RNAICs":{"anyOf":[{"items":{"$ref":"#/components/schemas/RNAIC"},"type":"array"},{"type":"null"}],"title":"Rnaics","description":"Recommended North American Industry Classification codes","default":[]},"SICs":{"anyOf":[{"items":{"$ref":"#/components/schemas/SIC"},"type":"array"},{"type":"null"}],"title":"Sics","description":"Standard Industrial Classification codes","default":[]},"TotalWordsProcessed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Totalwordsprocessed","description":"Total number of words processed during classification"},"ProcessingTimeMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processingtimems","description":"Processing time in milliseconds"},"Website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"Company website if provided"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Company description text that was classified"}},"type":"object","title":"InstantClassificationResponse","description":"Response model for instant company classification results."},"Message":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"Message"},"NewPassword":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"NewPassword"},"PublicConfig":{"properties":{"free_quota_limit":{"type":"integer","title":"Free Quota Limit"},"free_quota_scope":{"type":"string","const":"lifetime","title":"Free Quota Scope"}},"type":"object","required":["free_quota_limit","free_quota_scope"],"title":"PublicConfig"},"RNAIC":{"properties":{"Code":{"type":"string","title":"Code"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"Score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"type":"object","required":["Code"],"title":"RNAIC"},"RSIC":{"properties":{"Code":{"type":"string","title":"Code"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"Score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"type":"object","required":["Code"],"title":"RSIC"},"SIC":{"properties":{"Code":{"type":"string","title":"Code"},"Description":{"type":"string","title":"Description"}},"type":"object","required":["Code","Description"],"title":"SIC"},"SimilarCompany":{"properties":{"CompanyNumber":{"type":"string","title":"Companynumber"},"CompanyName":{"type":"string","title":"Companyname"},"Website":{"type":"string","title":"Website"},"Similarity":{"type":"number","title":"Similarity"}},"type":"object","required":["CompanyNumber","CompanyName","Website","Similarity"],"title":"SimilarCompany"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"Token"},"UpdatePassword":{"properties":{"current_password":{"type":"string","maxLength":128,"minLength":8,"title":"Current Password"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"UpdatePassword"},"UserCreate":{"properties":{"email":{"type":"string","maxLength":255,"format":"email","title":"Email"},"is_active":{"type":"boolean","title":"Is Active","default":true},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"is_paid":{"type":"boolean","title":"Is Paid","default":false},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole","description":"Role controls non-admin account policies","default":"standard"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"}},"type":"object","required":["email","password"],"title":"UserCreate"},"UserPublic":{"properties":{"email":{"type":"string","maxLength":255,"format":"email","title":"Email"},"is_active":{"type":"boolean","title":"Is Active","default":true},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"is_paid":{"type":"boolean","title":"Is Paid","default":false},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole","description":"Role controls non-admin account policies","default":"standard"},"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["email","id"],"title":"UserPublic"},"UserRegister":{"properties":{"email":{"type":"string","maxLength":255,"format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"accept_terms":{"type":"boolean","title":"Accept Terms","description":"User accepted Terms & Conditions","default":false}},"type":"object","required":["email","password"],"title":"UserRegister"},"UserRole":{"type":"string","enum":["standard","sandbox"],"title":"UserRole"},"UserUpdate":{"properties":{"email":{"anyOf":[{"type":"string","maxLength":255,"format":"email"},{"type":"null"}],"title":"Email"},"is_active":{"type":"boolean","title":"Is Active","default":true},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"is_paid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Paid"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole","description":"Role controls non-admin account policies","default":"standard"},"password":{"anyOf":[{"type":"string","maxLength":128,"minLength":8},{"type":"null"}],"title":"Password"}},"type":"object","title":"UserUpdate"},"UserUpdateMe":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string","maxLength":255,"format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","title":"UserUpdateMe"},"UsersPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/UserPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"UsersPublic"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}}}}