Create an AWR alert rule
const url = 'https://api2.recruso.co.uk/v1/awr-alert-rules';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"weekThreshold":1,"isActive":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api2.recruso.co.uk/v1/awr-alert-rules \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "weekThreshold": 1, "isActive": true }'Creates an AWR alert rule for your agency. Under the Agency Workers Regulations a worker reaches parity in week 12, and these rules decide which of the weeks up to that point your agency is alerted in — a single week, or every week until parity is reached.
The name must not already be in use by another of your agency’s records; a clash returns 400 rather than creating a duplicate.
Returns 201 with the created record.
You only ever see and change your own agency’s records; there is no owner id on the request, and an id belonging to another agency returns 404 rather than 403 so that its existence is never disclosed.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "weekThreshold": 1, "isActive": true}Responses
Section titled “Responses”Created
object
Examplegenerated
{ "alertId": 1, "weekThreshold": 1, "isActive": true}Bad Request
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
