メインコンテンツへスキップ

update-contract

dci update-contract <customerID> <contractID> [body]

Creates a new version of the contract. The contract type is immutable and cannot be changed by an update.

  • customerID — Identifier of the resource.
  • contractID — Identifier of the resource.

Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.

Confirmation required

update-contract alters a financial contract, so the CLI classifies it as destructive: it refuses to run without --yes (or an interactive confirmation) and exits with code 30 otherwise. Each call creates a whole new version, so name, renewalPolicy, and startDate are required every time; the contract type cannot change.

Examples

# Preview the new version locally without sending it.
dci update-contract <customer-id> <contract-id> --dry-run < contract.json
# Create the new version, confirmed for scripts.
dci update-contract <customer-id> <contract-id> --yes < contract.json
# contract.json
{"name": "Acme AWS resale FY27", "renewalPolicy": "fixed",
"startDate": "2026-10-01T00:00:00Z", "endDate": "2027-09-30T00:00:00Z",
"invoicesEmail": "[email protected]", "contractUpdatesEmail": "[email protected]"}
# A small inline change; the response's `version` is the new version number.
dci update-contract <customer-id> <contract-id> name: "Acme AWS resale FY27 (amended)", renewalPolicy: fixed, startDate: "2026-10-01T00:00:00Z" --yes --output json

Request

Content-Type: application/json

FieldTypeRequiredDescription
namestringyes
startDatestring (date-time)yes
endDatestring (date-time)
renewalPolicystringyesOne of: "auto", "manual", "fixed".
doitInvoicingEnabledbooleanWhether DoiT generates invoices for this contract. Disabling suppresses invoice generation from that point forward while billing calculations and pipeline outputs continue. Omitting the field leaves invoicing enabled. Default: true.
invoicesEmailstring (email)Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise.
contractUpdatesEmailstring (email)Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise.
billingProfileobjectThe billing profile (name, country, state, city, address, zip). Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise.
managementAccountsarray of string
billingRulesarray of object
priceBooksarray of object
customLineItemsarray of object
Raw JSON schema
{
"type": "object",
"description": "Contract create/update payload. Full field-level validation is applied server-side.",
"required": [
"name",
"startDate",
"renewalPolicy"
],
"properties": {
"name": {
"type": "string"
},
"startDate": {
"type": "string",
"format": "date-time"
},
"endDate": {
"type": "string",
"format": "date-time",
"nullable": true
},
"renewalPolicy": {
"type": "string",
"enum": [
"auto",
"manual",
"fixed"
]
},
"doitInvoicingEnabled": {
"type": "boolean",
"default": true,
"description": "Whether DoiT generates invoices for this contract. Disabling suppresses invoice generation from that point forward while billing calculations and pipeline outputs continue. Omitting the field leaves invoicing enabled."
},
"invoicesEmail": {
"type": "string",
"format": "email",
"description": "Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise."
},
"contractUpdatesEmail": {
"type": "string",
"format": "email",
"description": "Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise."
},
"billingProfile": {
"type": "object",
"description": "The billing profile (name, country, state, city, address, zip). Required for an end-customer contract with doitInvoicingEnabled set to true; optional otherwise."
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"billingRules": {
"type": "array",
"items": {
"type": "object"
}
},
"priceBooks": {
"type": "array",
"items": {
"type": "object"
}
},
"customLineItems": {
"type": "array",
"items": {
"type": "object"
}
}
}
}

Output

OK - New contract version created.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
contractIdstring
versioninteger
statusstring
messagestring
timestampstring (date-time)
Raw JSON schema
{
"type": "object",
"description": "The result of creating a contract or contract version.",
"properties": {
"contractId": {
"type": "string"
},
"version": {
"type": "integer"
},
"status": {
"type": "string"
},
"message": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}

Errors

On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.

HTTP status to exit code mapping
HTTP statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.

Aliases: updatecontract