{"openapi":"3.1.0","info":{"title":"Gnotus Auth","version":"0.1.0"},"paths":{"/auth/login":{"post":{"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Login"}}},"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"}}}}}}},"/auth/switch-org":{"post":{"summary":"Switch Org","operationId":"switch_org_auth_switch_org_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchOrg"}}}},"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"}}}}}}},"/auth/me":{"get":{"summary":"Me","operationId":"me_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/organizations/upsert":{"post":{"summary":"Upsert Organization","description":"Idempotent org upsert so Dream/Atlas can push control-plane org ids.","operationId":"upsert_organization_internal_organizations_upsert_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Organization Internal Organizations Upsert Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/memberships/ensure":{"post":{"summary":"Ensure Membership","operationId":"ensure_membership_internal_memberships_ensure_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipEnsure"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ensure Membership Internal Memberships Ensure Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/users/upsert":{"post":{"summary":"Upsert User","operationId":"upsert_user_internal_users_upsert_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/users/batch":{"post":{"summary":"Users Batch","operationId":"users_batch_internal_users_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersBatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Users Batch Internal Users Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Login":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"Login"},"MembershipEnsure":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","required":["user_id","org_id"],"title":"MembershipEnsure"},"OrgMembershipRead":{"properties":{"org_id":{"type":"string","title":"Org Id"},"org_slug":{"type":"string","title":"Org Slug"},"org_name":{"type":"string","title":"Org Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status","default":"active"}},"type":"object","required":["org_id","org_slug","org_name","role"],"title":"OrgMembershipRead"},"OrgUpsert":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name","default":""},"status":{"type":"string","title":"Status","default":"active"}},"type":"object","required":["id","slug"],"title":"OrgUpsert","description":"Ensure Auth organization exists (same id as Dream control-plane)."},"SwitchOrg":{"properties":{"org_id":{"type":"string","format":"uuid","title":"Org Id"}},"type":"object","required":["org_id"],"title":"SwitchOrg"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"},"org_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Org Id"},"memberships":{"items":{"$ref":"#/components/schemas/OrgMembershipRead"},"type":"array","title":"Memberships"}},"type":"object","required":["access_token"],"title":"Token"},"UserRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"phone":{"type":"string","title":"Phone","default":""},"locale":{"type":"string","title":"Locale","default":"pt"},"avatar_url":{"type":"string","title":"Avatar Url","default":""},"active":{"type":"boolean","title":"Active"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"memberships":{"items":{"$ref":"#/components/schemas/OrgMembershipRead"},"type":"array","title":"Memberships"}},"type":"object","required":["id","org_id","email","name","active"],"title":"UserRead"},"UserUpsert":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"email":{"type":"string","format":"email","title":"Email"},"password_hash":{"type":"string","title":"Password Hash"},"name":{"type":"string","title":"Name","default":""},"phone":{"type":"string","title":"Phone","default":""},"locale":{"type":"string","title":"Locale","default":"pt"},"avatar_url":{"type":"string","title":"Avatar Url","default":""},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["id","org_id","email","password_hash"],"title":"UserUpsert","description":"Atlas/Dream syncs a user after local org register / password change."},"UsersBatchRequest":{"properties":{"ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":200,"title":"Ids"}},"type":"object","required":["ids"],"title":"UsersBatchRequest"},"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"}}}}