applyBidTemplate
Requires permission biddesk:bid:update.
Lays out a bid's stages from a template, counted back in working days from the bid's due date in the organization's time zone; replaces the current plan (stages the template drops are removed). Refused with BID_PLAN_STARTED once a stage is complete, BID_CLOSED on a closed bid and VERSION_CONFLICT when the bid changed. Requires Bid Desk and permission to update bids.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation ApplyBidTemplate($input: ApplyBidTemplateInput!) {
applyBidTemplate(input: $input) {
bidDueOn
bidId
bidVersion
stages {
id
bidId
completedAt
dueOn
position
stageKey
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ApplyBidTemplate($input: ApplyBidTemplateInput!) {\n applyBidTemplate(input: $input) {\n bidDueOn\n bidId\n bidVersion\n stages {\n id\n bidId\n completedAt\n dueOn\n position\n stageKey\n }\n }\n}",
"variables": {
"input": {
"bidId": "id",
"expectedVersion": 0,
"templateId": "id"
}
}
}
EOF
Variables:
{
"input": {
"bidId": "id",
"expectedVersion": 0,
"templateId": "id"
}
}
Response:
{
"data": {
"applyBidTemplate": {
"bidDueOn": "string",
"bidId": "id",
"bidVersion": 0,
"stages": [
{
"id": "id",
"bidId": "id",
"completedAt": "2025-01-15T00:00:00Z",
"dueOn": "string",
"position": 0,
"stageKey": "APPROVAL"
}
]
}
}
}
applyBidTemplate(
input: ApplyBidTemplateInput!
): BidStagePlan!
Arguments
applyBidTemplate.input ● ApplyBidTemplateInput! non-null input
The bid, its version and the template.
Type
BidStagePlan object
A bid's stage plan: its stages in order with their deadlines.