List contracts
Returns a list of contracts in the organization.<br/><br/><hr />This endpoint has two versions: 1.0 and 1.1. The default version is 1.0 for API keys created before Aug 1st 2026 and 1.1 for keys created after Aug 1st 2026. You can specify the version via the X-API-Version header to override.<hr /><br/><br/><h3>Filtering</h3><br/><br/>Filter contracts by passing each field as its own query parameter. Multiple filters are combined with AND. Values are matched by exact equality — partial match, range, and comparator operators are not supported on this endpoint.<br/><br/>Supported filter fields: id, idApp, createdBy, status, and any custom contract field system key.<br/><br/>Example:<br/><br/>GET /contracts?fields=id,name,idApp,status,myCustomField&status=active&idApp=123&myCustomField=true<br/><br/>The above returns contracts where status=active AND idApp=123 AND myCustomField=true.<br/><br/><hr />Query params are different per version:<br/><br/><table><thead><tr><th>Query param</th><th>Supported in version</th><th>Description</th><th>Default value</th></tr></thead><tbody><tr><td>fields</td><td>v1.0, v1.1</td><td>List of fields to return for each contract</td><td>(no value)</td></tr><tr><td>q</td><td>v1.1 only</td><td>The query to search</td><td>(no value)</td></tr><tr><td>sort</td><td>v1.1 only</td><td>Sort order</td><td>(no value)</td></tr><tr><td>size</td><td>v1.1 only</td><td>Number of results to return (max: 1000)</td><td>1000</td></tr><tr><td>cursor</td><td>v1.1 only</td><td>Cursor for pagination</td><td>(no value)</td></tr><tr><td>aggs</td><td>v1.1 only</td><td>Aggregation configuration</td><td>(no value)</td></tr><tr><td>filters</td><td>v1.1 only</td><td>The filters to apply (JSON string)</td><td>(no value)</td></tr></tbody></table><br/><br/><h3>Multi-currency support</h3><br/><br/>All currency fields are returned in their original amounts based on the contract currency. To get the contract currency, add currency to fields.<br/><br/>Example:<br/><br/>GET /contracts?fields=id,name,amount,currency<br/><br/>
<p><ul><li>Rate limit: 100 requests per minute</li></ul></p>Request
- Base URLhttps://api.toriihq.com/v1.0
- AuthAPI key in header Authorization
Query parameters
List of fields to return for each contract.<br>Allowed fields: id, idApp, name, owner, status, createdBy and all fields from /contracts/fields
The query to search
A comma-seperated list of fields to sort by, with a postfix with either ':asc' or ':desc'. Fields can either be general, or custom to your organization
The max amount of results to return
A base64 string indicating the offset from which to start. <br>Pass the value of nextCursor returned from the previous call to get the next set of results
JSON string representing aggregation configuration. Structure: '{"field":"string","aggregationType":"metric|groupBy|date_range|date_histogram","options":{"size":"integer","sort":{"field":"string","order":"desc|asc","aggFunc":"total|sum|avg|max|min"},"metricFunction":"total|sum|avg|max|min","dateHistogramOptions":{"datePeriod":"hourly|daily|weekly|monthly|quarterly|yearly","hardBounds":{"min":"string","max":"string"},"extendedBounds":{"min":"string","max":"string"},"filterEmptyBuckets":"boolean"}},"aggs":{"field":"string","aggregationType":"metric|groupBy|date_range|date_histogram","options":{"metricFunction":"total|sum|avg|max|min"}}}'. metricFunction is REQUIRED when aggregationType is "metric". For aggregationType "date_histogram", options.dateHistogramOptions is REQUIRED and datePeriod, hardBounds, extendedBounds and filterEmptyBuckets all live INSIDE it — putting them directly on options is rejected with 400 "options.dateHistogramOptions" is required. The nested "aggs" is OPTIONAL and, when present, must be a JSON OBJECT with this same structure — never a JSON-encoded string.
Filters expression — accepts either shape: (1) Flat array of filter objects, AND-combined. Each item is {key, op, value}. (2) Array of filter groups, OR-combined. Each item is {id, filters} where filters is a flat array. See *_fields_metadata for valid keys and per-filterType operators. Omit value for isSet/isNotSet/relativeDateToday/exists/notExists. Use an array value for anyOf/allOf/noneOf/isExactly. Sent on the wire as a JSON-encoded string.
Headers
API version header (e.g., 1.0, 1.1)
Response
Contracts
Example response
{
"contracts": [
{
"id": 1000,
"name": "Salesforce contract",
"status": "pipeline"
}
],
"count": 100,
"total": 1000,
"nextCursor": "WzE0NjM1Mzg4NTcsIjY1NDMyMyJd"
}Changes
No recorded changes to this operation across all 1 revision of this API.