Skip to content

Rank the teams for a deal's work

GET
/deals/{id}/staffing-preview
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/deals/example/staffing-preview \
--header 'Authorization: Bearer <token>'

Ranks the teams for a deal’s work with the score a won deal’s assignment proposal uses: the team with the lowest share of its hours already taken over the coming weeks first, among teams with someone who can lead a project and logs time. Works before the deal is won; when it already has a kickoff project, that project’s assignment proposal is the one to approve. Read-only; nothing is proposed. Requires deals.view and projects.manage.

id
required

Deal identifier (CUID2).

string
>= 1 characters

Deal identifier (CUID2).

The teams ranked for the deal.

Media typeapplication/json
object
data
required
object
deal
required
object
companyName
required
string
id
required
string
outcome
required
string
Allowed values: OPEN WON LOST
title
required
string | null
horizonWeeks
required

The weeks ahead the workload is weighed.

integer
>= -9007199254740991 <= 9007199254740991
kickoffProject
required

The deal’s kickoff project once it has one; its own assignment proposal is then the one to approve.

Any of:
object
id
required
string
name
required
string
teams
required

The teams with the most room first, as a won deal’s proposal ranks them.

Array<object>
object
freeHours
required
integer
>= -9007199254740991 <= 9007199254740991
freePercent
required
integer
>= -9007199254740991 <= 9007199254740991
leads
required

People on the team who can lead a project and whose workload is measured.

integer
>= -9007199254740991 <= 9007199254740991
name
required
string
netHours
required
integer
>= -9007199254740991 <= 9007199254740991
teamId
required
string
unrankedTeams
required

Teams left out because nobody on them who can lead a project has a measured workload.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"data": {
"deal": {
"outcome": "OPEN"
}
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.