Treefort’s API allows you to automate any task that can be accomplished through the admin dashboard. This is a developer tool and requires technical skill to setup.
Authentication
To use the Treefort API, you'll first need to create an API token in your dashboard. When creating the token, assign whatever permissions you need to access the API endpoints you want to call (these permissions are listed in the API documentation for the endpoint, under the "Authorizations" section).
After you create the token, copy the value and put it into an Authorization: Bearer <your-token> header on each request. Example:
curl 'https://<YOUR-TREEFORT-DOMAIN-HERE>/api/v1/content/counts' \
-H 'Authorization: Bearer <YOUR-API-TOKEN-HERE>'
Optional X-Treefort-Version header
We create new API versions any time we make a breaking change to an existing endpoint. That way, your existing integrations keep working without requiring you to update them to the latest API version all the time. We recommend using the latest Treefort API version whenever feasible, but if for some reason you need to use a specific older version, there are two ways to do that:
Set the desired version on the API token itself. (This is the "API Version" dropdown when creating a token in your dashboard; the version specified here will be the default used by any request using that token.)
Set an
X-Treefort-Version: <desired-version>header on your request.
The API version that is set on a token can be updated at any time, even after the token is created and is in use.
Host and endpoints
Your base API endpoint URL is displayed on the API Tokens page of your dashboard, along with a link to your tenant-specific API documentation and an example curl request showing how to call our API.
General API endpoint documentation is here: https://api.treefortsystems.com/v1/docs/latest
Rate limits
We hope that our API allows you to accomplish more than ever with Treefort, but we do ask that you use this resource responsibly. Our goal is to maintain a reliable and efficient service for you and your users. To help us achieve this, requests to our API are limited at the following rates:
PUT/POST/PATCH/DELETE /api/* - 10 requests / 5 seconds
GET /api/v1/users, GET /api/v1/content - 20 requests / 10 seconds
GET /api/* - 200 requests / 10 seconds
POST /oauth2/token - 10 requests / 10 seconds
Rate limits aside, please be mindful of your usage and avoid unnecessary API calls. If we detect that your usage causes an undue burden on the system we may restrict your access and reach out to help you accomplish your goals with fewer API calls. We appreciate your cooperation in helping us provide a stable service!
