{"openapi":"3.1.0","info":{"title":"User Profile API","description":"API to store and retrieve user profile data.","version":"v0.0.1"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/users":{"get":{"tags":["user-profile-controller"],"summary":"Get User Profiles","description":"Optional filtering of results via \"jurisdiction\" request parameter","operationId":"getUserProfiles","parameters":[{"name":"Jurisdiction ID","in":"query","required":false,"schema":{"type":"string"}},{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"responses":{"200":{"description":"Found User Profiles","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserProfileLight"}}}}}}},"put":{"tags":["user-profile-controller"],"summary":"Update a new User Profile","description":"A User Profile or Jurisdiction is created if it does not exist","operationId":"populateUserProfiles","parameters":[{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserProfile"}}}},"required":true},"responses":{"200":{"description":"Updated User Profile defaults"}}},"delete":{"tags":["user-profile-controller"],"summary":"Delete the association to a Jurisdiction from a User Profile","description":"Deletes the Jurisdiction unless it matches the user's Workbasket default Jurisdiction AND the user currently belongs to more than one Jurisdiction. If the Jurisdiction being deleted is the user's sole Jurisdiction, removal is permitted. In addition, their Workbasket defaults are set to null, since they no longer belong to any Jurisdictions","operationId":"deleteJurisdictionFromUserProfile","parameters":[{"name":"User Profile ID","in":"query","required":true,"schema":{"type":"string"}},{"name":"Jurisdiction ID","in":"query","required":true,"schema":{"type":"string"}},{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"responses":{"204":{"description":"Deleted Jurisdiction from User Profile"},"400":{"description":"User Profile does not exist, user is not a member of specified Jurisdiction, or user's Workbasket defaults are for the Jurisdiction being removed"}}}},"/users/save":{"put":{"tags":["user-profile-controller"],"summary":"Save a User Profile","description":"A User Profile and/or Jurisdiction is created if it does not exist.Behaves exactly the same as the `PUT` /users endpoint, except that an HTTP 400 Bad Request is returned if the user already belongs to the given Jurisdiction","operationId":"saveUserProfile","parameters":[{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}},"required":true},"responses":{"200":{"description":"Saved User Profile","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"User Profile does not exist, or user already belongs to given Jurisdiction","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}}}}},"/user-profile/users":{"get":{"tags":["user-profile-endpoint"],"summary":"Get a user profile","operationId":"getUserProfiles_1","parameters":[{"name":"uid","in":"query","required":false,"schema":{"type":"string"}},{"name":"email-ids-users-to-find","in":"header","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"responses":{"200":{"description":"Found user profile(s) default settings","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Bad request - Email Id(s) not valid","content":{"*/*":{"schema":{"type":"object"}}}}}},"put":{"tags":["user-profile-endpoint"],"summary":"Update a new User Profile","description":"a user profile or jurisdiction is created if it does not exist","operationId":"populateUserProfiles_1","parameters":[{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserProfile"}}}},"required":true},"responses":{"201":{"description":"Updated User Profile defaults"},"200":{"description":"OK"}}},"post":{"tags":["user-profile-endpoint"],"summary":"Create a new User Profile","operationId":"createUserProfile","parameters":[{"name":"actionedBy","in":"header","required":false,"schema":{"type":"string","default":"<UNKNOWN>"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}},"required":true},"responses":{"201":{"description":"Created User Profile","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Unable to create User Profile","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}}}}}},"components":{"schemas":{"Jurisdiction":{"type":"object","properties":{"id":{"type":"string"}}},"UserProfile":{"type":"object","properties":{"id":{"type":"string"},"jurisdictions":{"type":"array","items":{"$ref":"#/components/schemas/Jurisdiction"}},"work_basket_default_jurisdiction":{"type":"string"},"work_basket_default_case_type":{"type":"string"},"work_basket_default_state":{"type":"string"}}},"UserProfileLight":{"type":"object","properties":{"id":{"type":"string"},"work_basket_default_jurisdiction":{"type":"string"},"work_basket_default_case_type":{"type":"string"},"work_basket_default_state":{"type":"string"}}}}}}
