This API is currently in closed beta and not publicly available

Core Concepts

Authentication

The One Tribe Carbon Offset Projects API uses API key-based authentication for all endpoints. Every request must include your API key in the headers.


Authentication Header

Header NameFormatExample
AuthorisationAPI-Key YOUR_API_KEY_HEREAuthorisation: API-Key abc123def456

Example Request

Using curl

curl "https://api.onetribe.com/v1/projects/offset" \
  -H "Authorisation: API-Key YOUR_API_KEY_HERE"

Using TypeScript

class OneTribeClient {
  private baseUrl = 'https://api.onetribe.com/v1'
  private headers: HeadersInit

  constructor(apiKey: string) {
    this.headers = {
      Authorisation: `API-Key ${apiKey}`,
      'Content-Type': 'application/json',
    }
  }

  async fetch<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
    const response = await fetch(`${this.baseUrl}${endpoint}`, {
      ...options,
      headers: {
        ...this.headers,
        ...options.headers,
      },
    })

    if (!response.ok) {
      throw new Error(`API error: ${response.status} ${response.statusText}`)
    }

    return response.json()
  }
}

// Example usage
const client = new OneTribeClient('YOUR_API_KEY_HERE')

// Making authenticated requests
try {
  const projects = await client.fetch('/projects/offset')
  console.log('Projects:', projects)
} catch (error) {
  console.error('Authentication error:', error)
}

Note: Never share your API key publicly or commit it to version control.

Error Responses

Status CodeError CodeDescription
401UnauthorizedMissing API key or invalid API key format
403ForbiddenValid API key format but the key is invalid or has been revoked
429TooManyRequestsRate limit exceeded - please wait before making more requests

Please see our rate limiting docs for more details.

Security Guidelines

GuidelineDescription
StorageNever store API keys in public repositories or client-side code
Environment VariablesUse environment variables or secure secret management systems
Access ControlRestrict API key access to only the necessary team members
Regular RotationRotate API keys periodically and immediately if compromised

Previous
Getting started