Quickstart

Make your first Treedis API call in a few minutes.

1. Base URL

All requests go to one of:

  • Production: https://api.treedis.com
  • Staging: https://stage-api.treedis.com

All endpoints live under the /v1/api path.

2. Authenticate

The API uses OAuth2. Exchange your client credentials for an access token, then send it as a Bearer token.

# Exchange credentials for an access token
curl -X POST "https://api.treedis.com/v1/api/oauth2/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "password",
    "client_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "client_secret": "1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4"
  }'

The response contains an access_token. Use it on every request:

curl -X GET "https://api.treedis.com/v1/api/tours" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Authentication Full OAuth2 flow, scopes, refresh tokens, and the legacy API key.

Don't have client credentials yet? Treedis provisions them for your integration — ask your Treedis contact. See the Authentication guide.

3. Your first calls

Search for projects:

curl -X POST "https://api.treedis.com/v1/api/projects/search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-access-token" \
  -d '{ "page": 0, "limit": 20 }'

List tours:

curl -X GET "https://api.treedis.com/v1/api/tours" \
  -H "Authorization: Bearer your-access-token"

4. Response format

Successful responses use a consistent envelope:

{
  "status": 200,
  "message": "Success",
  "timestamp": 1716146262053,
  "data": { }
}

Errors return a non‑2xx status with a message describing the problem (for example 401 for an expired token, 403 for insufficient scope, 422 for validation errors, 429 when rate limited).

5. Common endpoints

Explore them all in the API Reference. A few to start with:

Authentication

  • POST /v1/api/oauth2/token — obtain or refresh an access token
  • POST /v1/api/auth/user/login — authenticate a user with email + password

Projects

  • POST /v1/api/projects/search — search projects
  • GET /v1/api/projects/{id} — get a project
  • POST /v1/api/projects — create or update a project
  • DELETE /v1/api/projects/{id} — delete a project

Tours

  • GET /v1/api/tours — list tours
  • POST /v1/api/tours/create — create a tour
  • GET /v1/api/tours/{slug} — get a tour by slug

Users

  • GET /v1/api/users — list users
  • POST /v1/api/users/upsert — create or update a user
  • GET /v1/api/users/{id} — get a user

Next steps