Skip to content

Set a won deal's kickoff project

POST
/deals/{id}/kickoff-project
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/deals/example/kickoff-project \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "orderName": "example", "projectId": "example" }'

Sets the project delivery works in: projectId, an active project of the deal’s company that the caller can reach, which the deal joins (several deals can share one), or a new project named name from the workspace’s onboarding project template or empty. A new project takes the deal’s company and project type and the hours of the hour-block order the win opened as its write-once original estimate; either way that order is linked. The won-deal steps that act on the project (tasks from the contract, team proposal, Discord channel, access tasks) then run behind their switches. With neither, the deal joins the company’s only active project and is refused (422) when the company has none or several: a new project always needs a confirmed name. orderName retitles the order the win opened with the short title confirmed, shown after its code. One per deal; repeating the same projectId returns it and creates nothing. When the hour block cannot be attached the project is still set and warning says why. Requires deals.manage and projects.create (and projects.manage when a template is set).

id
required

Deal identifier (CUID2).

string
>= 1 characters

Deal identifier (CUID2).

Media typeapplication/json
object
name

The confirmed name of a new kickoff project for the won deal; the plan offers the company’s name, numbered when one of its projects already has it.

string
>= 1 characters <= 200 characters
orderName

The short title of the order the won deal’s accepted estimate opens, shown after the order’s code. Left out when winning, the order opens named by the workspace’s order name template for an Hour block starting today; sent with the kickoff project, it retitles the order the win opened.

string
>= 1 characters <= 200 characters
projectId

An active project of the deal’s company, one the caller can reach, for the won deal to join; sent with a new project’s name, it wins.

string
>= 1 characters

Example generated

{
"name": "example",
"orderName": "example",
"projectId": "example"
}

The kickoff project.

Media typeapplication/json
object
data
required
object
estimatedHours
required

The write-once original estimate, from that order; null without one.

number | null
hourBlockOrderId
required

The hour-block order the win opened, linked to the project.

string | null
projectId
required
string
reused

True when the deal joined a project its company already had, false when one was created. Absent on an older server.

boolean
templateId
required
string | null
warning
required

Set when the project was created but the sold hour block could not be attached; hourBlockOrderId is then null and the same note is logged on the deal.

string | null

Example generated

{
"data": {
"estimatedHours": 1,
"hourBlockOrderId": "example",
"projectId": "example",
"reused": true,
"templateId": "example",
"warning": "example"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

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

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"
}
}

Invalid input.

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.