List a site's cost centres
const url = 'https://api2.recruso.co.uk/v1/clients/1/sites/1/cost-centres';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api2.recruso.co.uk/v1/clients/1/sites/1/cost-centres \ --header 'Authorization: <Authorization>'Returns every cost centre linked to one of your own agency’s sites.
This list is not paged and takes no filters — a site’s cost centre links come back in full. Each entry carries the link’s own id, which is what RemoveSiteCostCentre takes, not the cost centre id.
The list carries ids only. Read the cost centres themselves through the branch’s cost centre endpoints for their names and details.
The site must belong to the client named in the route, otherwise 404.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The clientId path parameter
The siteId path parameter
Responses
Section titled “Responses”OK
Every cost centre linked to the site. Not paged.
object
The cost centres linked to this site, as link records.
One cost centre linked to the site.
object
The link’s own identifier. This is what RemoveSiteCostCentre takes, not the cost centre id.
The site the cost centre is linked to.
The cost centre being linked. Must belong to the same branch as the site.
Example
{ "costCenters": [ { "siteCostCentreId": 631, "siteId": 512, "costCentreId": 19 } ]}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"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
