{"openapi":"3.1.0","info":{"description":"Opal User Service","license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"title":"Opal User Service","version":"v0.0.1"},"externalDocs":{"description":"README","url":"https://github.com/hmcts/opal-user-service"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"operationId":"welcome","responses":{"200":{"content":{"*/*":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Root Controller"]}},"/internal-user/handle-oauth-code":{"post":{"operationId":"handleOauthCode","parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/SecurityToken"}}},"description":"OK"}},"summary":"Handles Oauth code for the front end API calls","tags":["Authentication Controller - Internal Users"]}},"/testing-support/launchdarkly/bool/{featureKey}":{"get":{"operationId":"isFeatureEnabled","parameters":[{"in":"path","name":"featureKey","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"type":"boolean"}}},"description":"OK"}},"tags":["Testing Support Controller"]}},"/testing-support/launchdarkly/string/{featureKey}":{"get":{"operationId":"getFeatureValue","parameters":[{"in":"path","name":"featureKey","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Testing Support Controller"]}},"/testing-support/token/parse":{"get":{"operationId":"parseToken","parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Testing Support Controller"]}},"/testing-support/token/test-user":{"get":{"operationId":"getToken","responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestingSupportTokenResponse"}}},"description":"OK"}},"summary":"Retrieves the token for default test user","tags":["Testing Support Controller"]}},"/testing-support/token/user":{"get":{"operationId":"getTokenForUser","parameters":[{"in":"header","name":"X-User-Email","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestingSupportTokenResponse"}}},"description":"OK"}},"summary":"Retrieves the token for a given user","tags":["Testing Support Controller"]}},"/testing-support/users/{userId}":{"patch":{"operationId":"activateUser","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateUserRequest"}}},"required":true},"responses":{"200":{"description":"OK"}},"tags":["Testing Support Controller"]}},"/testing-support/users/{userId}/roles/{roleId}":{"delete":{"operationId":"deleteRoleFromUser","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}},{"in":"path","name":"roleId","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}},"summary":"Testing-support-only endpoint to remove a role from a user","tags":["Testing Support Controller"]},"put":{"operationId":"addOrReplaceRoleInformationOnUser","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}},{"in":"path","name":"roleId","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"integer","format":"int32"},"uniqueItems":true}}},"required":true},"responses":{"200":{"description":"OK"}},"summary":"Testing-support-only endpoint to add or replace role assignments for a user","tags":["Testing Support Controller"]}},"/users":{"post":{"operationId":"addUser","parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDto"}}},"description":"OK"}},"tags":["user-permissions-controller"]},"put":{"operationId":"updateUser","parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDto"}}},"description":"OK"}},"tags":["user-permissions-controller"]}},"/users/state":{"get":{"deprecated":true,"operationId":"getUserState_1","parameters":[{"in":"header","name":"X-New-Login","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserStateDto"}}},"description":"OK"}},"tags":["user-permissions-controller"]}},"/users/{userId}":{"put":{"operationId":"updateUser_1","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDto"}}},"description":"OK"}},"tags":["user-permissions-controller"]}},"/users/{userId}/state":{"get":{"deprecated":true,"operationId":"getUserState","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}},{"in":"header","name":"X-New-Login","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserStateDto"}}},"description":"OK"}},"tags":["user-permissions-controller"]}},"/v2/users/{userId}/state":{"get":{"operationId":"getUserStateV2","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"integer","format":"int64"}},{"in":"header","name":"X-New-Login","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserStateV2Dto"}}},"description":"OK"}},"tags":["user-permissions-v-2-controller"]}}},"components":{"schemas":{"ActivateUserRequest":{"type":"object","properties":{"activationDate":{"type":"string","format":"date-time"}}},"BusinessUnitUser":{"type":"object","properties":{"business_unit_id":{"type":"integer","format":"int32"},"business_unit_user_id":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/Permission"},"uniqueItems":true}}},"BusinessUnitUserDto":{"type":"object","properties":{"business_unit_id":{"type":"integer","format":"int32"},"business_unit_user_id":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionDto"}}}},"DomainDto":{"type":"object","properties":{"business_unit_users":{"type":"array","items":{"$ref":"#/components/schemas/BusinessUnitUserDto"}}}},"Permission":{"type":"object","properties":{"permission_id":{"type":"integer","format":"int64"},"permission_name":{"type":"string"}}},"PermissionDto":{"type":"object","properties":{"permission_id":{"type":"integer","format":"int64"},"permission_name":{"type":"string"}}},"SecurityToken":{"type":"object","properties":{"access_token":{"type":"string"},"user_state":{"$ref":"#/components/schemas/UserState"}}},"TestingSupportTokenResponse":{"type":"object","properties":{"access_token":{"type":"string"}}},"UserDto":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"subject":{"type":"string"},"user_id":{"type":"integer","format":"int64"},"username":{"type":"string"},"version":{"type":"integer"}}},"UserState":{"type":"object","properties":{"business_unit_user":{"type":"array","items":{"$ref":"#/components/schemas/BusinessUnitUser"},"uniqueItems":true},"user_id":{"type":"integer","format":"int64"},"user_name":{"type":"string"}}},"UserStateDto":{"type":"object","properties":{"business_unit_users":{"type":"array","items":{"$ref":"#/components/schemas/BusinessUnitUserDto"}},"name":{"type":"string"},"status":{"type":"string"},"user_id":{"type":"integer","format":"int64"},"username":{"type":"string"},"version":{"type":"integer"}}},"UserStateV2Dto":{"type":"object","properties":{"cache_name":{"type":"string"},"domains":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DomainDto"}},"name":{"type":"string"},"status":{"type":"string"},"user_id":{"type":"integer","format":"int64"},"username":{"type":"string"},"version":{"type":"integer"}}}}}}
