Skip to content

Link a cost centre to a site

POST
/v1/clients/{clientId}/sites/{siteId}/cost-centres
curl --request POST \
--url https://api2.recruso.co.uk/v1/clients/1/sites/1/cost-centres \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "costCentreId": 19 }'

Links one of your agency’s cost centres to a site, so work at that site can be booked against it. The link is the whole record — there is nothing to update, only add and remove.

The cost centre must belong to the same branch as the site. Cost centres are branch-scoped, and a cross-branch link returns 400. A site with no branch assigned cannot be linked to any cost centre, which also returns 400.

A cost centre already linked to the site returns 400 rather than creating a duplicate, and a cost centre that does not exist returns 400.

The site must belong to the client named in the route, otherwise 404. On success the Location header points at ListSiteCostCentres, since a single link has no endpoint of its own.

Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.

clientId
required
integer format: int32

The clientId path parameter

siteId
required
integer format: int32

The siteId path parameter

Media typeapplication/json

The cost centre to link to the site.

object
costCentreId

The cost centre being linked. Must belong to the same branch as the site.

integer format: int16
Example
19

Created

Media typeapplication/json

A newly created site cost centre link.

object
siteCostCenterId

The link’s own identifier. This is what RemoveSiteCostCentre takes, not the cost centre id.

integer format: int32
siteId

The site the cost centre is linked to.

integer format: int32
costCentreId

The cost centre being linked. Must belong to the same branch as the site.

integer format: int16
Example
{
"siteCostCenterId": 631,
"siteId": 512,
"costCentreId": 19
}

Bad Request

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Unauthorized

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Forbidden

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Not Found

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}