curl --request GET \
--url https://app.trelica.com/api/contracts/v1 \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trelica.com/api/contracts/v1"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trelica.com/api/contracts/v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trelica.com/api/contracts/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trelica.com/api/contracts/v1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.trelica.com/api/contracts/v1")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/contracts/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next": "https://app.trelica.com/api/contracts/v1?after=eyJpZCI6IjY2MDk2ODJiZGIzY2Y2ZWM3MmI5NTgzOSJ9&limit=100",
"results": [
{
"id": "6609682bdb3cf6ec72b95839",
"externalId": "EXT1235",
"ref": "PO-12345-00",
"type": "PurchaseOrder",
"vendorName": "Github, Inc.",
"agreementDate": "2022-04-01T00:00:00Z",
"renewalDate": "2023-04-01T00:00:00Z",
"terminationNoticeDays": 90,
"isAutomaticRenewal": false,
"notes": "Annual Github renewal negotiated by Rachele in procurement",
"paymentMethod": "Invoice",
"businessOwnerEmail": "jane.doe@example.org",
"lineItems": [
{
"externalId": "1",
"description": "Github Enterprise annual",
"notes": "For source control",
"unitCount": 50,
"amount": 210,
"currency": "USD",
"baseAmount": 210,
"baseCurrency": "USD",
"startDate": "2022-04-06T00:00:00Z",
"endDate": "2023-04-06T00:00:00Z"
},
{
"externalId": "2",
"description": "Github Advanced Security",
"notes": "Secret scanning etc",
"unitCount": 10,
"amount": 250,
"currency": "USD",
"baseAmount": 250,
"baseCurrency": "USD",
"startDate": "2022-04-06T00:00:00Z",
"endDate": "2023-04-06T00:00:00Z"
}
],
"documents": [],
"createdBy": {
"userId": "110e3dd8077945c2a60d33770eb74b97",
"name": "Sam Procurement",
"email": "sam.procurement@example.org"
},
"createdDtm": "2024-03-31T13:42:03.608Z",
"lastModifiedBy": {
"userId": "110e3dd8077945c2a60d33770eb74b97",
"name": "Sam Procurement",
"email": "sam.procurement@example.org"
},
"lastModifiedDtm": "2024-03-31T13:42:03.608Z"
}
]
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}List contracts
Returns a paginated list of the contracts in your organization. Use filter and
q to narrow the results, and follow the next link (also provided in the
link response header) to page through large result sets.
Required scope: Contracts.Read (Read-only access to contracts)
curl --request GET \
--url https://app.trelica.com/api/contracts/v1 \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trelica.com/api/contracts/v1"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trelica.com/api/contracts/v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trelica.com/api/contracts/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trelica.com/api/contracts/v1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.trelica.com/api/contracts/v1")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/contracts/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next": "https://app.trelica.com/api/contracts/v1?after=eyJpZCI6IjY2MDk2ODJiZGIzY2Y2ZWM3MmI5NTgzOSJ9&limit=100",
"results": [
{
"id": "6609682bdb3cf6ec72b95839",
"externalId": "EXT1235",
"ref": "PO-12345-00",
"type": "PurchaseOrder",
"vendorName": "Github, Inc.",
"agreementDate": "2022-04-01T00:00:00Z",
"renewalDate": "2023-04-01T00:00:00Z",
"terminationNoticeDays": 90,
"isAutomaticRenewal": false,
"notes": "Annual Github renewal negotiated by Rachele in procurement",
"paymentMethod": "Invoice",
"businessOwnerEmail": "jane.doe@example.org",
"lineItems": [
{
"externalId": "1",
"description": "Github Enterprise annual",
"notes": "For source control",
"unitCount": 50,
"amount": 210,
"currency": "USD",
"baseAmount": 210,
"baseCurrency": "USD",
"startDate": "2022-04-06T00:00:00Z",
"endDate": "2023-04-06T00:00:00Z"
},
{
"externalId": "2",
"description": "Github Advanced Security",
"notes": "Secret scanning etc",
"unitCount": 10,
"amount": 250,
"currency": "USD",
"baseAmount": 250,
"baseCurrency": "USD",
"startDate": "2022-04-06T00:00:00Z",
"endDate": "2023-04-06T00:00:00Z"
}
],
"documents": [],
"createdBy": {
"userId": "110e3dd8077945c2a60d33770eb74b97",
"name": "Sam Procurement",
"email": "sam.procurement@example.org"
},
"createdDtm": "2024-03-31T13:42:03.608Z",
"lastModifiedBy": {
"userId": "110e3dd8077945c2a60d33770eb74b97",
"name": "Sam Procurement",
"email": "sam.procurement@example.org"
},
"lastModifiedDtm": "2024-03-31T13:42:03.608Z"
}
]
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}Authorizations
OAuth 2.0. Obtain an access token via the Client Credentials or Authorization Code flow, then send it as Authorization: Bearer <token>.
Query Parameters
A SCIM-style filter expression restricting the items returned. See the Filtering section of the introduction for the operators and syntax; the filterable fields are listed per resource.
Filterable fields
- string:
createdBy.email,createdBy.name,createdBy.userId,documents[description],documents[id],documents[linkUrl],externalId,id,lastModifiedBy.email,lastModifiedBy.name,lastModifiedBy.userId,lineItems[currency],lineItems[description],lineItems[externalId],lineItems[id],lineItems[notes],notes,paymentMethod,type,vendorName - number:
lineItems[amount],lineItems[unitCount],terminationNoticeDays - date:
agreementDate,createdDtm,lastModifiedDtm,lineItems[endDate],lineItems[startDate],renewalDate,startDate - boolean:
deleted,isAutomaticRenewal
Filter examples
vendorName eq "Agilebits Inc"— Contracts whose vendor is "Agilebits Inc"vendorName sw "Micros"— Contracts with vendors starting with "Micros", e.g. "Microsoft"lineItems[unitCount gt 100]— Contracts with a line item of more than 100 unitsisAutomaticRenewal eq true— Contracts that automatically renewagreementDate ge "2021-06-01"— Contracts with agreement dates on or after 1 Jun 2021
Free-text search across the resource's displayable fields.
Only return items modified at or after this ISO-8601 timestamp.
Only return items modified at or before this ISO-8601 timestamp.
Opaque pagination cursor supplied by SaaS Manager via the link response header and the next field.
Maximum number of items to return per page (default 100, maximum 1000).
1 <= x <= 1000Was this page helpful?