Skip to main content

API Reference

Three REST endpoints for fetching your event catalog, downloading generated code, and reporting codebase usage. All endpoints require a Bearer token.

Authentication

Authenticate with Authorization: Bearer YOUR_TOKEN. Create tokens in Settings → Tokens inside your workspace.

Tokens are workspace-scoped. Each token has access to a single workspace's data.

Endpoints

GET

Event Catalog

Fetch the list of event names defined in Ordaze. Used by the CLI scanner to know what to search for.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://app.ordaze.com/api/v1/catalog"

Parameters

ParameterDescription
sourceSource slug (e.g. ios, android, backend). Alias: platform (legacy)
versionVersion to fetch: draft, latest, or a version name

Response

{
  "protocolVersion": "1",
  "events": [
    {
      "name": "app_launched",
      "camelCase": "appLaunched",
      "pascalCase": "AppLaunched",
      "status": "active",
      "properties": ["user_id", "device_type"],
      "fields": { "team": "mobile" }
    }
  ],
  "excludeFiles": ["**/*.test.*"],
  "version": "2.1.0"
}
GET

Code Generation

Download a generated Swift or Kotlin event file for your workspace. The file is rendered from the workspace's Handlebars template.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://app.ordaze.com/api/v1/codegen?source=ios" \
  -o AnalyticsEvents.swift

Parameters

ParameterDescription
sourceSource slug (e.g. ios, android). Alias: platform (legacy)
versionlatest, draft, or a version name
POST

Report Codebase Usage

Report which events are used in your codebase. Called automatically by the CLI scanner, or use directly for custom integrations.

curl -X POST \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "backend",
    "version": "2.1.0",
    "repo": "my-api",
    "append": true,
    "events": [
      { "name": "payout_completed", "filePath": "PayoutPaid.php" },
      { "name": "survey_completed", "filePath": "SurveyCompleted.php" }
    ]
  }' \
  "https://app.ordaze.com/api/v1/usage"

Body Parameters

ParameterDescription
sourceSource slug (e.g. ios, android, backend). Alias: platform (legacy)
versionApp version string
repoRepository name (shown in coverage view)
appendtrue = merge with existing results, false = full replace
eventsArray of { name, filePath } objects

Response

{
  "matched": 2,
  "unmatched": ["unknown_event"],
  "missing": ["checkout_started", "signup_completed"],
  "total": 42
}
FieldDescription
matchedCount of events found in both code and Ordaze
unmatchedEvent names in code but not in Ordaze
missingEvent names in Ordaze but not in code
totalTotal number of events in the workspace

Rate Limiting

API requests are rate-limited to 30 requests per minute per token.

HeaderDescription
Retry-AfterSeconds to wait before retrying (429 responses only)
X-RateLimit-ResetISO 8601 timestamp when the window resets (429 responses only)

If you receive a 429 Too Many Requests response, wait until the reset time before retrying.