---
updatedAt: 2026-05-27T05:24:21.000Z
agentTools:
  projectIndex: https://developers.toriihq.com/llms.txt
---

# 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](https://app.toriihq.com/team/settings/contractDetails) 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>

# OpenAPI definition

````json
{
  "servers": [
    {
      "url": "https://api.toriihq.com/v1.0"
    }
  ],
  "info": {
    "title": "Torii API Documentation",
    "version": "v1.0",
    "description": "The Torii API provides an easy way to integrate your data in Torii with any external system. The API closely follows REST semantics, uses JSON to encode objects, and relies on standard HTTP codes to signal operation outcomes. Torii APIs consist of both proprietary and SCIM 2.0 APIs."
  },
  "x-readme": {
    "explorer-enabled": true
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Contracts"
    }
  ],
  "openapi": "3.0.0",
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    },
    "schemas": {
      "Contract": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier",
            "example": 1000,
            "minimum": 1
          },
          "name": {
            "type": "string",
            "example": "Salesforce contract"
          },
          "status": {
            "type": "string",
            "description": "Contract status",
            "example": "pipeline"
          }
        }
      },
      "Contracts": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Contract"
        }
      },
      "Model15": {
        "type": "object",
        "description": "Contracts",
        "properties": {
          "contracts": {
            "$ref": "#/components/schemas/Contracts"
          },
          "aggregations": {
            "x-meta": {
              "className": "aggregations"
            },
            "nullable": true,
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AggregationBucket"
                }
              }
            ]
          },
          "count": {
            "type": "integer",
            "description": "The number of results returned in this response",
            "example": 100
          },
          "total": {
            "type": "integer",
            "description": "The total number of results",
            "example": 1000
          },
          "nextCursor": {
            "type": "string",
            "description": "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",
            "example": "WzE0NjM1Mzg4NTcsIjY1NDMyMyJd"
          }
        }
      },
      "AggregationBucket": {
        "type": "object",
        "properties": {
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "value": {
            "type": "number",
            "nullable": true
          },
          "groupCount": {
            "type": "integer"
          },
          "aggregations": {
            "type": "string",
            "description": "Nested aggregations with the same structure as the parent"
          }
        },
        "required": [
          "key"
        ]
      }
    }
  },
  "paths": {
    "/contracts": {
      "get": {
        "summary": "List contracts",
        "operationId": "getContracts",
        "description": "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](https://app.toriihq.com/team/settings/contractDetails) 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/>\n<p><ul><li>Rate limit: 100 requests per minute</li></ul></p>",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "API version header (e.g., 1.0, 1.1)",
              "enum": [
                "1.0",
                "1.1"
              ]
            },
            "description": "API version header (e.g., 1.0, 1.1)"
          },
          {
            "name": "fields",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "List of fields to return for each contract.<br>Allowed fields: `id`, `idApp`, `name`, `owner`, `status`, `createdBy` and all fields from `/contracts/fields`",
              "example": "id,name,idApp,owner,status",
              "default": "id,name,idApp,owner"
            },
            "description": "List of fields to return for each contract.<br>Allowed fields: `id`, `idApp`, `name`, `owner`, `status`, `createdBy` and all fields from `/contracts/fields`"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "The query to search"
            },
            "description": "The query to search"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "A comma-separated list of fields to sort by, with a postfix with either ':asc' or ':desc'. Fields can either be general, or custom to your organization",
              "example": "name:asc"
            },
            "description": "A comma-separated list of fields to sort by, with a postfix with either ':asc' or ':desc'. Fields can either be general, or custom to your organization"
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "description": "The max amount of results to return",
              "example": 1000,
              "minimum": 1,
              "maximum": 1000
            },
            "description": "The max amount of results to return"
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "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",
              "example": "WzE0NjM1Mzg4NTcsIjY1NDMyMyJd"
            },
            "description": "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"
          },
          {
            "name": "aggs",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "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.",
              "example": "{\"field\":\"status\",\"aggregationType\":\"groupBy\",\"options\":{\"sort\":{\"order\":\"desc\",\"aggFunc\":\"total\"},\"size\":5}}",
              "x-meta": {
                "className": "aggs"
              }
            },
            "description": "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."
          },
          {
            "name": "filters",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "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.",
              "example": "[{\"key\":\"idApp\",\"op\":\"equals\",\"value\":1000}]"
            },
            "description": "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."
          }
        ],
        "tags": [
          "Contracts"
        ],
        "responses": {
          "200": {
            "description": "Contracts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Model15"
                }
              }
            }
          }
        }
      }
    }
  }
}
````