Quickstart
This guide takes you from zero to your first response in about five minutes.
-
Activate the API in COMMITLY. Sign in to app.commitly.com, open Add-ons and click Connect on the COMMITLY Public API tile. COMMITLY shows your Client ID and Client secret right there. The API is included from the Business Edition.
-
Request an access token. Send your credentials to the token endpoint. The token is valid for 5 minutes.
Terminal window curl -X POST https://app.commitly.com/api/auth/token/ \-d grant_type=client_credentials \-d client_id="$COMMITLY_CLIENT_ID" \-d client_secret="$COMMITLY_CLIENT_SECRET"const res = await fetch("https://app.commitly.com/api/auth/token/", {method: "POST",body: new URLSearchParams({grant_type: "client_credentials",client_id: process.env.COMMITLY_CLIENT_ID,client_secret: process.env.COMMITLY_CLIENT_SECRET,}),});const { access_token } = await res.json();import os, requestsres = requests.post("https://app.commitly.com/api/auth/token/",data={"grant_type": "client_credentials","client_id": os.environ["COMMITLY_CLIENT_ID"],"client_secret": os.environ["COMMITLY_CLIENT_SECRET"],},)access_token = res.json()["access_token"] -
Make your first call. List the categories of your company. Send the token in the
Authorizationheader with theBearerprefix.Terminal window curl https://app.commitly.com/api/categories/ \-H "Authorization: Bearer $ACCESS_TOKEN"const categories = await fetch("https://app.commitly.com/api/categories/", {headers: { Authorization: `Bearer ${access_token}` },}).then((r) => r.json());categories = requests.get("https://app.commitly.com/api/categories/",headers={"Authorization": f"Bearer {access_token}"},).json()The response lists every category with its
id. You need these IDs whenever you create invoices or budgets.
Next steps
Section titled “Next steps”- Authentication: token lifetime, renewal and errors.
- Data model: how categories, plans, scenarios and the forecast fit together.
- Testing: what to know before you write to a live account.

