{"openapi":"3.1.0","info":{"description":"API to provision various organisation roles for staff & judicial users based on the service specific mapping rules.","title":"AM Organisational Role Mapping Service"},"externalDocs":{"description":"README","url":"https://github.com/hmcts/am-org-role-mapping-service#readme"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"paths":{"/am/role-mapping/judicial/refresh":{"post":{"operationId":"judicialRefresh","parameters":[{"in":"header","name":"x-correlation-id","required":false,"schema":{"type":"string"}},{"description":"Keyword `Bearer` followed by a valid IDAM user token","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudicialRefreshRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.uk.gov.hmcts.am-org-role-mapping-service.map-judicial-assignments+json;charset=UTF-8;version=1.0":{"schema":{"type":"string"}}},"description":"Successful"},"400":{"description":"Request is not valid as per validation rule"},"422":{"description":"Unprocessable entity as request has been rejected"}},"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"summary":"refreshes judicial role assignments","tags":["refresh-controller"]}},"/am/role-mapping/professional/refresh":{"post":{"operationId":"professionalRefresh","parameters":[{"in":"query","name":"userId","required":true,"schema":{"type":"string"}},{"description":"Keyword `Bearer` followed by a valid IDAM user token","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.uk.gov.hmcts.am-org-role-mapping-service.map-professional-assignments+json;charset=UTF-8;version=1.0":{"schema":{"type":"string"}}},"description":"Successful"},"400":{"description":"Request is not valid as per validation rule"},"404":{"description":"Resource not found User with ID %s not found in PRD"}},"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"summary":"refreshes professional role assignments","tags":["refresh-controller"]}},"/am/role-mapping/refresh":{"post":{"description":"operation can only be executed by services that are authorised to call the refresh controller otherwise an unauthorized service error will be returned","operationId":"refresh","parameters":[{"in":"query","name":"jobId","required":true,"schema":{"type":"integer","format":"int64"}},{"description":"Keyword `Bearer` followed by a valid IDAM user token","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRequest"}}}},"responses":{"202":{"content":{"application/vnd.uk.gov.hmcts.am-org-role-mapping-service.map-assignments+json;charset=UTF-8;version=1.0":{"schema":{"type":"string"}}},"description":"Accepted"},"400":{"description":"Request is not valid as per validation rule"},"403":{"description":"Invoking service is not permitted to call the Refresh API"},"422":{"description":"Unprocessable entity as request has been rejected"}},"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"summary":"refreshes caseworker role assignments","tags":["refresh-controller"]}}},"components":{"schemas":{"JudicialRefreshRequest":{"type":"object","properties":{"refreshRequest":{"$ref":"#/components/schemas/UserRequest"}}},"UserRequest":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}}}}},"securitySchemes":{"Authorization":{"bearerFormat":"JWT","description":"Valid IDAM user token, (Bearer keyword is added automatically)","name":"Authorization","scheme":"bearer","type":"http"},"ServiceAuthorization":{"bearerFormat":"JWT","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","scheme":"bearer","type":"apiKey"}}}}
