### Upsales API - General Information Source: https://api.upsales.com/index General information about the Upsales API, including introduction, rate limits, authentication, error handling, pagination, and filtering. ```APIDOC ## Upsales API Welcome to the Upsales API! You can use this API to access all our API endpoints, such as the CRM API to look up sales data, or the Marketing Automation API to create leads into Upsales. The API is organized around REST. All requests should be made over SSL. All request and response bodies, including errors, are encoded in JSON. ### Rate Limits Upsales supplies a free API service for up to 99,999 API calls per day. A custom using more than this daily will be subject to a tier-based fee. (More usage equals higher cost). As an app developer, we ask you to please optimise your API traffic in order for your customers to not perceive your service as a larger expense than it has to be. ### Authentication Authenticate your account by including your secret key in API requests. You can manage your API keys in under settings in Upsales as a admin users. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth. ### Format Always include `content-type: application/json` as a header. ### Errors Our API returns standard HTTP success or error status codes. For errors, we will also include extra information about what went wrong encoded in the response as JSON. | Http Code | Description | |---|---| | 200 - OK | Everything worked as expected | | 400 - Bad Request | The request was unacceptable, often due to missing a required parameter. | | 401 - Unauthorized | No valid API key provided. | | 404 - Not Found | The requested resource doesn't exist or you don't have access to the resource | | 429 - To Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. | ### Pagination Our list endpoints implements pagination. The limit of entries is set using the `limit` parameter in the query-string. The default limit is set to 1000 and the maximum limit is 2000. To retreieve the next page you use the `offset`-parameter in the query-string. It's value is the number of entries that you want to skip. To be 100% sure you get all entities you need sort on ID when you do the pagination. For example if you want to fetch all companies, `https://integration.upsales.com/api/v2/accounts?sort=id&limit=1000&id=gt:LAST_ID_OF_PREV_BATCH` ### Filtering We allow for filtering on most fields on our entities. The filter format is the following * For standard attributes: `attribute=comparisontype:value` * For custom fields: `custom=comparisontype:fieldId:value` * If you don't provide a comparisontype then it defaults to equals `attribute=value` * Multiple values: `attribute=comparisontype:1,2,3,4,7` You can search on related entities when using filters. Example find all contacts with value true in custom field with id 4 on the company; example: `.../contacts?client.custom=eq:4:1` #### Comparison Types | Type | Name | Description | |---|---|---| | `eq` | Equals | Exact matches | | `ne` | Not equals | Exact non-matches | | `gt` | Greater than | Value greater than | | `gte` | Greater than equals | Value greater than/or equals | | `lt` | Less than | Value less than | | `lte` | Less than equals | Value less than/or equals | #### Examples Get account where user.id not equals 1 `https://integration.upsales.com/api/v2/accounts?user.id=ne:1` Get orders where order value is greater than 100 000 and date is greater than or equals 2016-01-01 `https://integration.upsales.com/api/v2/order?value=gt:100000&date=gte:2016-01-01` Get contacts where customfield with id 1 is greater than 2016-03-05 `https://integration.upsales.com/api/v2/contacts?custom=gte:1:2016-01-01` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.