Quickstart
Go from a new test key to listing renewals and approving a draft in about five minutes.
This guide takes you from a new API key to a list of your upcoming renewals, and then shows how to approve a draft. You’ll use a test key, so nothing is sent to a real vendor.
1. Get a test key
In the dashboard, open Settings → API keys and click Create test key. Test keys start with tl_test_. Copy the key, because the full value is only shown once.
export TRIMLINE_API_KEY="tl_test_4eC39HqLyjWDarjtT1zdp7dc"
Never commit API keys to source control or ship them in browser or mobile code. See Authentication for how to store them safely.
2. Make your first request
Check that the key works by fetching the account it belongs to.
curl https://api.trimline.tech/v1/account \
-H "Authorization: Bearer $TRIMLINE_API_KEY"
const res = await fetch("https://api.trimline.tech/v1/account", {
headers: { Authorization: `Bearer ${process.env.TRIMLINE_API_KEY}` },
});
console.log(await res.json());
import os, requests
res = requests.get(
"https://api.trimline.tech/v1/account",
headers={"Authorization": f"Bearer {os.environ['TRIMLINE_API_KEY']}"},
)
print(res.json())
Response
{
"id": "acct_7Hq2kLm9",
"object": "account",
"name": "Northwind Labs (test)",
"livemode": false,
"default_currency": "usd",
"created_at": "2026-10-02T14:11:08Z"
}
3. List upcoming renewals
Ask for the renewals whose notice deadline falls in the next 90 days, soonest first.
curl -G https://api.trimline.tech/v1/renewals \
-H "Authorization: Bearer $TRIMLINE_API_KEY" \
-d "notice_deadline[lte]=2027-02-07" \
-d "status=upcoming" \
-d "limit=5"
const params = new URLSearchParams({
"notice_deadline[lte]": "2027-02-07",
status: "upcoming",
limit: "5",
});
const res = await fetch(`https://api.trimline.tech/v1/renewals?${params}`, {
headers: { Authorization: `Bearer ${process.env.TRIMLINE_API_KEY}` },
});
const { data } = await res.json();
for (const r of data) console.log(r.vendor.name, r.notice_deadline);
res = requests.get(
"https://api.trimline.tech/v1/renewals",
headers={"Authorization": f"Bearer {os.environ['TRIMLINE_API_KEY']}"},
params={"notice_deadline[lte]": "2027-02-07", "status": "upcoming", "limit": 5},
)
for r in res.json()["data"]:
print(r["vendor"]["name"], r["notice_deadline"])
Response
{
"object": "list",
"data": [
{
"id": "ren_1Pq8sT2v",
"object": "renewal",
"vendor": { "id": "ven_9xKd02", "name": "Acme CRM" },
"contract": "ctr_4Lw7Yh",
"renews_on": "2027-02-01",
"notice_deadline": "2026-12-03",
"status": "upcoming",
"current_annual_value": { "amount": 3840000, "currency": "usd" }
}
],
"has_more": true,
"next_cursor": "ren_1Pq8sT2v"
}
4. Approve a draft
When a negotiation has an email ready for you, it shows up as a draft with status pending. Approving it sends it from your connected mailbox. In test mode, nothing is actually sent.
curl -X POST https://api.trimline.tech/v1/drafts/drf_3Nc81Ab/approve \
-H "Authorization: Bearer $TRIMLINE_API_KEY" \
-H "Idempotency-Key: 6f1c2a1e-approve-drf_3Nc81Ab"
Next steps
- Subscribe to
draft.createdso you know when an approval is waiting, instead of polling for it. - Read Errors and Idempotency before you go live.
- Switch to a live key once you’ve tested your integration against the sandbox.
Something unclear or missing? Email developers@trimline.tech.