Create a new contract for the authenticated tenant
POST/contracts
Creates a new Contract record and returns the persisted object with server-assigned identifiers.
What it does: Registers a new contract for the tenant identified by the tenant-id header. The server assigns id (a UUID); any id supplied in the request body is ignored and discarded before the request reaches storage. createdBy and updatedBy are always set from the authenticated caller's user ID - any values supplied in the body are ignored.
When to use: Use this endpoint to introduce a net-new contract. To modify an existing contract, use PUT /contracts/{id} instead.
Preconditions: Requires the CREATE_CONTRACT permission. documentId, networkId, and planId are required top-level identifiers (caller-supplied, not server-generated). Within generalInfo, contractId, contractName, contractType, and contractStatus are required; all other fields and sections are optional.
Response: Returns 201 Created with the full Contract object, including the server-assigned id. No async jobs, webhooks, or downstream events are triggered by this operation as of this writing.
Request
Responses
- 201
- 400
- 401
- 403
The newly created Contract, including its server-assigned id.
The request body failed validation - for example, a required field such as documentId/networkId/planId, or generalInfo.contractId/contractName/contractType/contractStatus, was missing, or an enum field was set to a value outside its allowed set.
Unauthorized - Authentication required
Forbidden - Insufficient permissions