list-contracts
dci list-contracts <customerID>
Lists the contracts held by the specified customer. Callable by a T1/T2 PartnerOps principal for its own tenant or any descendant tenant. Read access requires contractsReadOnly, contractsViewer, or a write-capable role (without contractsReadOnly). User API tokens must include the matching permission in their scope.
customerID— The customer (tenant) whose contracts are requested.
Examples
# All contracts held by a customer.
dci list-contracts <customer-id>
# Only rows mentioning `active` anywhere in their text fields (client-side match, e.g. on `status`).
dci list-contracts <customer-id> --search active
# Name, status, and term only.
dci list-contracts <customer-id> -C name,status,startDate,endDate
# Everything as JSON, for scripts.
dci list-contracts <customer-id> --output json
Output
OK - The request succeeded.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
[].id | string | The unique identifier of the contract. |
[].customerId | string | The customer (tenant) that holds the contract. |
[].type | string | The immutable contract type. |
[].status | string | The contract status. One of: "draft", "scheduled", "active", "cancelled", "expired", "superseded". |
[].name | string | The contract name. |
[].startDate | string (date-time) | The contract start date. |
[].endDate | string (date-time) | The contract end date. |
[].renewalPolicy | string | The renewal policy. One of: "auto", "manual", "fixed". |
[].doitInvoicingEnabled | boolean | Whether DoiT generates invoices for this contract. |
[].currentVersionNumber | integer | The current version number of the contract. |
[].timeCreated | string (date-time) | When the contract was created. |
Raw JSON schema
{
"type": "array",
"items": {
"type": "object",
"description": "External view of a contract. DoiT-internal fields are not exposed.",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the contract."
},
"customerId": {
"type": "string",
"description": "The customer (tenant) that holds the contract."
},
"type": {
"type": "string",
"description": "The immutable contract type."
},
"status": {
"type": "string",
"description": "The contract status.",
"enum": [
"draft",
"scheduled",
"active",
"cancelled",
"expired",
"superseded"
]
},
"name": {
"type": "string",
"description": "The contract name."
},
"startDate": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The contract start date."
},
"endDate": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The contract end date."
},
"renewalPolicy": {
"type": "string",
"description": "The renewal policy.",
"enum": [
"auto",
"manual",
"fixed"
]
},
"doitInvoicingEnabled": {
"type": "boolean",
"description": "Whether DoiT generates invoices for this contract."
},
"currentVersionNumber": {
"type": "integer",
"nullable": true,
"description": "The current version number of the contract."
},
"timeCreated": {
"type": "string",
"format": "date-time",
"description": "When the contract was created."
}
}
}
}
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 status | Exit code | Error code | Meaning |
|---|---|---|---|
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
Related
- get-contract — Retrieve a contract
- create-contract — Create contract
- activate-contract — Activate contract
- update-contract — Update contract
- cancel-contract — Cancel contract
- API reference: GET /customers/{customerID}/contracts
Aliases: listcontracts