{"openapi":"3.1.0","info":{"title":"BidSearch API docs","description":"**Welcome to the BidSearch API docs.**\n\nYou will need an [API key](https://app.bidsearch.com/account/apiKeys) to use this API. All requests must send it in the `X-API-KEY` header and be prefixed with `https://api.bidsearch.com`.\n\nIf you have any questions or feedback please contact customer support.","version":"1.0"},"tags":[{"name":"Authentication"},{"name":"Search"},{"name":"Saved searches"},{"name":"Export credits"},{"name":"Spending"}],"paths":{"/token":{"post":{"tags":["Authentication"],"summary":"Get an access token for a user","operationId":"createToken","description":"Retrieves an access token for a user within your organization. The user making the request must be an organization admin. Once you have an access token you can redirect the user to `https://app.bidsearch.com/#access_token=[access token]`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"},"example":{"scope":"joe@myorganization.com"}}}},"responses":{"200":{"description":"JWT for the user with the scoped email address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"},"example":{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9..."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The user is not an organization admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Email address not found in your organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"APIKey":[]}]}},"/v1/search":{"post":{"tags":["Search"],"summary":"Search a dataset","operationId":"search","description":"Searches a dataset such as bids, contracts, or meetings. Requires the GovSpend API entitlement. A filter can have at most 100 conditions, 1000 values and 5 levels of nesting. Use **/v1/fields/{dataset}** to list the fields of a dataset. In `semantic` and `hybrid` modes, `evidence` adds the passages that best match the query to the first 10 results.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"},"examples":{"keyword":{"summary":"Keyword search","value":{"dataset":"bids","query":["road resurfacing","asphalt"],"filter":{"and":[{"field":"agency.stateCode","in":["TX","OK"]},{"field":"dueDate","gte":"2026-11-01"}]},"sort":[{"field":"dueDate","dir":"asc"}],"fields":["title","dueDate","agency.name"],"page":{"size":25}}},"evidence":{"summary":"Hybrid search with evidence","value":{"dataset":"bids","mode":"hybrid","query":"road resurfacing and asphalt paving","filter":{"field":"agency.stateCode","in":["TX","OK"]},"fields":["title","dueDate","agency.name"],"evidence":true,"page":{"size":10}}}}}}},"responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"},"examples":{"keyword":{"summary":"Keyword search","value":{"data":[{"id":"bid id","title":"Road Resurfacing","dueDate":"2026-11-15","agency":{"name":"City of Austin"}}],"page":{"size":25,"next":"cursor for page.after"},"total":{"value":1,"exact":true}}},"evidence":{"summary":"Hybrid search with evidence","value":{"data":[{"id":"bid id","title":"Road Resurfacing","dueDate":"2026-11-15","agency":{"name":"City of Austin"},"evidence":[{"field":"description","text":"Mill and overlay of residential streets with hot mix asphalt."},{"field":"title","text":"Road Resurfacing"},{"field":"documents","text":"The contractor shall resurface 4.2 lane miles and restore pavement markings.","fileName":"specifications.pdf","url":"file download url"}]}],"page":{"size":10,"next":null},"metadata":{"evidence":{"status":"included","resultsSearched":1}}}}}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Bad Request","status":400,"errors":[{"pointer":"#/dataset","code":"unknown_value","detail":"Unknown dataset 'bid'","received":"bid","allowed":["bids","contracts","meetings","spending","contacts","agencies","agencyDocuments"]}]}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Unauthorized","status":401,"detail":"Not authenticated"}}}},"403":{"description":"The user does not have the GovSpend API entitlement or cannot access the requested dataset","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Forbidden","status":403,"detail":"This account does not have access to the 'bids' dataset"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Too Many Requests","status":429,"detail":"Rate limit exceeded"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":0}}}}},"security":[{"APIKey":[]}]}},"/v1/fields/{dataset}":{"get":{"tags":["Search"],"summary":"List the fields of a dataset","operationId":"getFields","description":"Lists the fields of a dataset (e.g. bids, contracts, or meetings): type, filter operators, and whether it can be filtered or sorted. Requires the GovSpend API entitlement.","parameters":[{"in":"path","name":"dataset","description":"Dataset name","required":true,"schema":{"type":"string","enum":["bids","contracts","meetings","spending","contacts","agencies","agencyDocuments"]}}],"responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldsResponse"},"example":{"dataset":"bids","fields":[{"name":"dueDate","type":"date","operators":["gte","lte","between","exists"],"filterable":true,"sortable":true}]}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Unauthorized","status":401,"detail":"Not authenticated"}}}},"403":{"description":"The user does not have the GovSpend API entitlement","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Forbidden","status":403,"detail":"This account does not have access to the GovSpend API"}}}},"404":{"description":"Unknown dataset","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Not Found","status":404,"detail":"Unknown dataset 'bid'. Expected one of: bids, contracts, meetings, spending, contacts, agencies, agencyDocuments"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"title":"Too Many Requests","status":429,"detail":"Rate limit exceeded"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":0}}}}},"security":[{"APIKey":[]}]}},"/savedSearch":{"get":{"tags":["Saved searches"],"summary":"List saved searches","operationId":"listSavedSearches","description":"Returns the saved searches of the user making the request, sorted by name. Each result contains the **name** and the **id** (as `_id`) of a saved search.","responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedSearchList"},"example":{"total":2,"limit":500,"skip":0,"data":[{"_id":"5efgebf5866e1e002d831a12","name":"Search I"},{"_id":"5eklebf5866e1e002d831a87","name":"Search II"}]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"APIKey":[]}]}},"/runSavedSearch":{"post":{"tags":["Saved searches"],"summary":"Run a saved search","operationId":"runSavedSearch","description":"Runs a saved search by **id** and returns a page of up to 100 results. **Consumes one export credit per record returned.** Use **/savedSearch** to get the id of a saved search and **/exportCreditStats** to see how many credits it will consume.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSavedSearchRequest"},"example":{"id":"saved search id","page":1,"include":[],"sort":[{"field":"sort field","desc":true}]}}}},"responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSavedSearchResponse"},"example":{"page":1,"pageSize":100,"totalPages":1,"totalRecords":5,"exportCreditsUsed":5,"savedSearchType":"Spending","result":[{"field":"value"}]}}}},"400":{"description":"Invalid page number","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The search failed. No export credits were charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"APIKey":[]}]}},"/exportCreditStats":{"get":{"tags":["Export credits"],"summary":"Get export credits","operationId":"getExportCreditStats","description":"Returns the remaining export credits of the user making the request. With a **searchId**, also returns the number of results of that saved search (`totalRecords`) **without using export credits**.","parameters":[{"in":"query","name":"searchId","description":"Saved search id. Omit to get only the remaining export credits.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportCreditStats"},"example":{"hasSufficientCredits":true,"bulkCredits":0,"monthlyCredits":120,"monthlyAvailable":1000,"bulkAvailable":0,"totalAvailable":1000,"totalRecords":120}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"APIKey":[]}]}},"/spendingAggregation":{"get":{"tags":["Spending"],"summary":"Aggregate spending by agency or vendor","operationId":"getSpendingAggregation","description":"Returns total spend grouped by agency or vendor for a month-based timeframe. Results are ordered by total spend. Values are intended for reporting and may vary slightly from exact totals.","parameters":[{"in":"query","name":"groupBy","description":"Grouping type. Defaults to `agency`.","schema":{"type":"string","enum":["agency","vendor"],"default":"agency"}},{"in":"query","name":"months","description":"How many months to include in the aggregation window (for example `12` for last 12 months). Defaults to `60`.","schema":{"type":"integer","minimum":1,"default":60}},{"in":"query","name":"limit","description":"How many grouped results to return (top results by spend). Defaults to `1000`; maximum is `20000`.","schema":{"type":"integer","minimum":1,"maximum":20000,"default":1000}},{"in":"query","name":"id","description":"Optional ID filter. Accepts a single numeric value, repeated query values, or a comma-delimited list. Uses agency ID when `groupBy=agency` and vendor ID when `groupBy=vendor`.","schema":{"oneOf":[{"type":"integer"},{"type":"array","items":{"type":"integer"}}]}},{"in":"query","name":"sortDir","description":"Sort direction for total spend. Defaults to `desc` (highest spend first).","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"Success!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendingAggregationResponse"},"example":{"groupBy":"agency","sortDir":"desc","timeframe":{"months":12,"from":"2025-03-01T00:00:00.000Z","to":"2026-02-28T23:59:59.999Z"},"data":[{"id":12345,"name":"City of Austin, TX","totalSpend":48392012.11,"totalLineItems":10491}]}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendingAggregationError"},"example":{"name":"BadRequest","message":"Invalid query","code":400,"errors":{"months":["Month must be a number"]}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The user does not have access to spending data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"APIKey":[]}]}}},"components":{"schemas":{"Error":{"type":"object","properties":{"name":{"type":"string"},"message":{"type":"string"},"code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"description":"Validation errors, for invalid requests.","type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Dotted path of the invalid value, e.g. `filter.and.0`."},"message":{"type":"string"}},"required":["path","message"]}}},"required":["name","message","code"]},"TokenRequest":{"type":"object","properties":{"scope":{"type":"string","description":"Email address of a user in your organization."}},"required":["scope"]},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string","description":"JWT for the user."}},"required":["access_token"]},"Problem":{"type":"object","properties":{"title":{"type":"string","description":"HTTP status text."},"status":{"type":"integer","minimum":400,"maximum":599,"description":"HTTP status code."},"detail":{"description":"Explanation of the problem. Omitted when `errors` is present.","type":"string"},"errors":{"description":"Validation errors, for invalid requests.","type":"array","items":{"type":"object","properties":{"pointer":{"type":"string","description":"JSON Pointer to the invalid value, e.g. `#/filter/and/0/field`."},"code":{"type":"string","enum":["required","invalid_type","invalid_value","unknown_value","unknown_parameter","unknown_field","invalid_operator","too_small","too_large","not_supported","invalid_cursor"]},"detail":{"type":"string"},"received":{"description":"The rejected value, for `unknown_value`."},"allowed":{"description":"Accepted values, for `unknown_value`.","type":"array","items":{"type":"string"}}},"required":["pointer","code","detail"]}}},"required":["title","status"],"description":"Problem details (RFC 9457)."},"SearchFilter":{"anyOf":[{"type":"object","properties":{"and":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/SearchFilter"},"description":"Matches when every filter matches."}},"required":["and"],"additionalProperties":false},{"type":"object","properties":{"or":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/SearchFilter"},"description":"Matches when any filter matches."}},"required":["or"],"additionalProperties":false},{"type":"object","properties":{"not":{"$ref":"#/components/schemas/SearchFilter"}},"required":["not"],"additionalProperties":false},{"type":"object","properties":{"field":{"type":"string","maxLength":200,"description":"Filterable field name. See /v1/fields/{dataset} for the operators each field accepts."},"eq":{"description":"Equals. For string and boolean fields.","anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"}]},"in":{"description":"Matches any of the values. For string fields.","minItems":1,"maxItems":1000,"type":"array","items":{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"}]}},"notIn":{"description":"Matches none of the values. For string fields.","minItems":1,"maxItems":1000,"type":"array","items":{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"}]}},"gte":{"description":"Greater than or equal to. For number fields, or date fields as an ISO 8601 date or date-time. Can be combined with `lte`.","anyOf":[{"type":"string","maxLength":64},{"type":"number"}]},"lte":{"description":"Less than or equal to. A date without a time includes the whole day. Can be combined with `gte`.","anyOf":[{"type":"string","maxLength":64},{"type":"number"}]},"between":{"description":"Inclusive `[min, max]` range. Same as `gte` with `lte`.","type":"array","prefixItems":[{"anyOf":[{"type":"string","maxLength":64},{"type":"number"}]},{"anyOf":[{"type":"string","maxLength":64},{"type":"number"}]}]},"exists":{"description":"`true` matches results with a value, `false` without one.","type":"boolean"}},"required":["field"],"additionalProperties":false,"description":"A single condition: `field` plus exactly one operator, except `gte` and `lte`, which can be combined."}],"description":"A condition, or an `and`, `or` or `not` group of filters."},"SearchRequest":{"type":"object","properties":{"dataset":{"type":"string","enum":["bids","contracts","meetings","spending","contacts","agencies","agencyDocuments"],"description":"Dataset to search. `agencyDocuments` returns one result per document per agency; results for the same document share a `url`."},"query":{"description":"`lexical` mode: an array of keywords. A result matches any keyword, and the words of a multi-word keyword must be within 3 positions of each other. `semantic` and `hybrid` modes: a single string (required).","anyOf":[{"type":"string","minLength":1,"maxLength":1000},{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":1000}}]},"mode":{"default":"lexical","description":"`lexical` matches keywords and is paginated with `page.after`. `semantic` and `hybrid` rank by meaning, return at most one page, and do not support `exact`, `sort` or `page.after`. Only available for bids, contracts, meetings, agencyDocuments.","type":"string","enum":["lexical","semantic","hybrid"]},"exact":{"description":"`lexical` mode only. Turns off word variations (stemming and synonyms), for example to match part numbers.","type":"boolean"},"filter":{"$ref":"#/components/schemas/SearchFilter"},"sort":{"description":"`lexical` mode only. Defaults to relevance.","minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":200,"description":"Sortable field name."},"dir":{"default":"asc","type":"string","enum":["asc","desc"]}},"required":["field"],"additionalProperties":false}},"fields":{"description":"Fields to return, as field names or path prefixes: `agency` returns every `agency.*` field. Defaults to every field.","minItems":1,"maxItems":60,"type":"array","items":{"type":"string","maxLength":200}},"page":{"default":{"size":25},"type":"object","properties":{"size":{"default":25,"description":"Results per page. At most 100 in `semantic` and `hybrid` modes.","type":"integer","minimum":1,"maximum":100},"after":{"description":"`lexical` mode only. The `page.next` cursor from the previous response. Send the same request otherwise.","anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"additionalProperties":false},"evidence":{"description":"`semantic` and `hybrid` modes only. When `true`, adds `evidence` to each of the first 10 results: up to 3 passages from its own fields that best match the query, then up to 3 from its documents, each ranked the way the results are. Covers every evidence field of the dataset, whatever `fields` selects. `metadata.evidence` reports whether evidence was included.","type":"boolean"}},"required":["dataset"],"additionalProperties":false},"SearchResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The field the passage comes from. `bids` has `title`, `description`, and `documents`. `contracts` has `title`, `description`, and `documents`. `meetings` has `title`, `transcript`, and `documents`. `agencyDocuments` has `text`."},"text":{"type":"string"},"start":{"description":"`transcript` passages only. The second in the recording where the passage begins.","type":"number"},"fileName":{"description":"`documents` passages only. The file the passage comes from.","type":"string"},"url":{"description":"`documents` passages only.","type":"string"}},"required":["field","text"]},"description":"Only when `evidence` is `true`, for the first 10 results. Up to 3 passages from the result's own fields that best match the query, best first, then up to 3 from its documents, best first. The fields compete, so a field can have no passage. They are ranked the way the results are: by similarity in `semantic` mode, keeping passages with a similarity of at least 0.55, and by the hybrid ranking in `hybrid` mode, which applies the same floor to its similarity side and also brings in keyword matches. Weak passages are left out, so a result can have fewer passages, or none. A result without any passage has no `evidence`."}},"required":["id"],"additionalProperties":{},"description":"The requested fields. Dotted fields are nested, e.g. `agency.name` as `{ agency: { name } }`. Fields without a value (null, empty objects and empty arrays) are omitted."},"description":"Results in the requested order."},"page":{"type":"object","properties":{"size":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"next":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for `page.after`, or null on the last page and in `semantic` and `hybrid` modes."}},"required":["size","next"]},"total":{"description":"Matching results. Only on the first page in `lexical` mode.","type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"exact":{"type":"boolean","description":"`false` when `value` is a lower bound on the total."}},"required":["value","exact"]},"metadata":{"type":"object","properties":{"evidence":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"included"},"resultsSearched":{"type":"integer","minimum":0,"maximum":10,"description":"How many results, from the first, evidence was looked up for. At most 10. A result in this range without `evidence` had no matching passage."},"message":{"description":"Only when there are more than 10 results.","type":"string"}},"required":["status","resultsSearched"]},{"type":"object","properties":{"status":{"type":"string","const":"unavailable","description":"Evidence could not be retrieved, for example when it runs past its 3 second timeout."},"message":{"type":"string"},"reference":{"type":"string","description":"Include it when contacting support."}},"required":["status","message","reference"]}],"description":"Only when `evidence` is requested. The results are complete whatever the status."}}}},"required":["data","page"]},"FieldsResponse":{"type":"object","properties":{"dataset":{"type":"string","enum":["bids","contracts","meetings","spending","contacts","agencies","agencyDocuments"]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","date","boolean","geoPoint","documents"],"description":"`geoPoint` values are returned as `{ lat, lon }`."},"operators":{"type":"array","items":{"type":"string","enum":["eq","in","notIn","gte","lte","between","exists"]},"description":"Filter operators. Empty when the field is not filterable."},"filterable":{"type":"boolean"},"sortable":{"type":"boolean"},"values":{"description":"Allowed values, for fields limited to a fixed list. String filters with other values are rejected. Results may still have no value; use `exists` to filter on that.","type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["name","type","operators","filterable","sortable"]}}},"required":["dataset","fields"]},"SavedSearchList":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skip":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","description":"Saved search id."},"name":{"type":"string"}},"required":["_id","name"]}}},"required":["total","limit","skip","data"]},"RunSavedSearchRequest":{"type":"object","properties":{"id":{"type":"string","description":"Saved search id, from **/savedSearch**."},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"include":{"description":"Fields to return. Returns all fields when omitted.","type":"array","items":{"type":"string"}},"sort":{"description":"Sort fields, in order. Takes precedence over `sortField`.","type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"desc":{"type":"boolean"}},"required":["field"]}},"sortField":{"type":"string"},"sortDir":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["id"]},"RunSavedSearchResponse":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalRecords":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exportCreditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Export credits charged for this page."},"savedSearchType":{"type":"string"},"result":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["page","pageSize","totalPages","totalRecords","exportCreditsUsed","savedSearchType","result"]},"ExportCreditStats":{"type":"object","properties":{"hasSufficientCredits":{"type":"boolean","description":"Whether there are enough credits for `totalRecords`."},"bulkCredits":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"boolean","const":false}],"description":"`false` when there are not enough credits."},"monthlyCredits":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"boolean","const":false}],"description":"`false` when there are not enough credits."},"monthlyAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bulkAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalRecords":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of results of the saved search, or 0 without one."}},"required":["hasSufficientCredits","bulkCredits","monthlyCredits","monthlyAvailable","bulkAvailable","totalAvailable","totalRecords"]},"SpendingAggregationResponse":{"type":"object","properties":{"groupBy":{"type":"string","enum":["agency","vendor"]},"sortDir":{"type":"string","enum":["asc","desc"]},"timeframe":{"type":"object","properties":{"months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"from":{"type":"string"},"to":{"type":"string"}},"required":["months","from","to"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"name":{"type":"string"},"totalSpend":{"type":"number"},"totalLineItems":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","totalSpend","totalLineItems"]}}},"required":["groupBy","sortDir","timeframe","data"]},"SpendingAggregationError":{"type":"object","properties":{"name":{"type":"string"},"message":{"type":"string"},"code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"description":"Validation messages, keyed by query parameter.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["name","message","code"]}},"securitySchemes":{"APIKey":{"type":"apiKey","in":"header","name":"X-API-KEY"}}}}