API Documentation

Everything you need to integrate with the WoodenDollars platform.

API Overview

The WoodenDollars API is a RESTful service that powers the platform. All endpoints return JSON and use standard HTTP methods and status codes. Explore the interactive Swagger documentation for a complete list of endpoints, request schemas, and response examples.

Base URL

All API requests should be made to the following base URL:

https://www.woodendollars.com/api/v1

Authentication

The API supports two authentication methods: cookie-based session authentication for browser clients and API key authentication for programmatic access.

Session Authentication

Send a POST request to /auth/login with your credentials. The server will set an HTTP-only session cookie. Include credentials in all subsequent requests.

POST /auth/login
{
  "email": "user@example.com",
  "password": "your-password",
  "tenant_short_name": "your-company"
}

Set credentials: 'include' in your fetch/XHR requests to ensure the session cookie is sent.

API Key Authentication

API keys can be created from the Tenant Administration panel. Include the key in the Authorization header as a Bearer token.

Authorization: Bearer <your-api-key>

Request Headers

Include the following headers with every request:

Content-Type: application/json
Accept: application/json

HTTP Response Codes

200 OK — The request was successful.
201 Created — The resource was created successfully.
400 Bad Request — The request was invalid or missing required fields.
401 Unauthorized — Authentication is required or the session has expired.
403 Forbidden — You do not have permission to access this resource.
404 Not Found — The requested resource does not exist.
409 Conflict — The request conflicts with the current state (e.g. duplicate email).
500 Internal Server Error — Something went wrong on our end.

Error Format

When an error occurs, the response body contains a JSON object with a code and message:

{
  "code": "VALIDATION_ERROR",
  "message": "email is required"
}

Rate Limiting

API requests are subject to rate limiting to ensure platform stability. If you exceed the limit, you will receive a 429 Too Many Requests response. Contact support if you need higher limits.

Data API

Enterprise

The Data API allows data engineers to extract tenant data from the WoodenDollars platform for use in external pipelines, data warehouses, and reporting tools. It is available exclusively on the Enterprise plan. Access is via API key with the data_engineer scope, issued by your tenant administrator.

Endpoints

MethodPathDescription
GET/v1/data/extractDiscover available tables
GET/v1/data/extract/{table}Incremental window extraction
GET/v1/data/extract/{table}/currentPoint-in-time snapshot extraction
POST/v1/data/extract/{table}/resetReset the extraction cursor
GET/v1/data/executionsList extraction history (session auth)

Authentication

All data extraction endpoints require an API key with the data_engineer scope. API keys are created by your tenant administrator via Admin → User Management. Pass the key as a Bearer token:

Authorization: Bearer wd_live_xxxxxxxxxxxxxxxxxxxx

The GET /v1/data/extract (discovery) endpoint also accepts session authentication for tenant admins and platform admins.

Discover Available Tables

Returns the list of tables you can extract data from. Only tables with a corresponding base table in the platform are listed — denied tables and internal infrastructure tables are excluded.

GET /v1/data/extract

Response

{
  "tables": [
    { "table_name": "account",     "description": "" },
    { "table_name": "transaction", "description": "" }
  ]
}

Window Extraction

Extracts rows modified since the last completed or reset extraction for this user and table. The extraction window is modified_at >= start_at AND modified_at < end_at. By default the cursor advances automatically — start_at picks up from the previous run and end_at is set to now − 5 s to avoid edge-of-window data loss.

GET /v1/data/extract/{table}?row_count=1000&page_number=1

Query Parameters

ParameterDefaultDescription
row_count1000Rows per page. Maximum 10 000.
page_number11-based page index.
data_extraction_execution_idRequired for page 2+. Returned on page 1. Ensures all pages share the same time window.
start_atauto-cursorOverride window start. RFC3339 or Unix epoch seconds. Disables safety lag.
end_atnow − 5sOverride window end. RFC3339 or Unix epoch seconds. Disables safety lag.

Current Extraction

Returns a point-in-time snapshot of the table: start_at and end_at are both set to now at execution time. Limited to 2 extractions per user per table per calendar day.

GET /v1/data/extract/{table}/current?row_count=1000&page_number=1

Accepts the same row_count, page_number, and data_extraction_execution_id parameters as the window endpoint. Returns 429 once the daily limit is reached.

Reset Extraction Cursor

Inserts a reset sentinel row that becomes the new cursor position for subsequent window extractions.

POST /v1/data/extract/{table}/reset?timestamp=2024-01-01T00%3A00%3A00Z

Response — 201 Created

{
  "data_extraction_execution_id": "0194f9aa-...",
  "table_name": "account",
  "end_at": "2024-01-01T00:00:00Z"
}

DJSON Output Format

Extraction responses use a columnar DJSON format. Use the columns array as the authoritative field index. Timestamps are UTC ISO 8601 strings. NULL values become JSON null.

{
  "data_extraction_execution_id": "0194f9aa-3c12-7abc-8def-000000000001",
  "columns": ["account_log_id", "account_id", "tenant_id", "balance", "modified_at", "modified_by"],
  "rows": [
    ["0194f9aa-...", "0194f9ab-...", "0194f9ac-...", 5000, "2024-01-15T10:30:00.000000Z", "0194f9ad-..."]
  ]
}

Pagination

  1. Request page 1 — note the data_extraction_execution_id from the response.
  2. If len(rows) == row_count, request the next page with the same execution ID and incremented page number.
  3. When len(rows) < row_count, this is the final page.
Edge case: When the total row count is an exact multiple of row_count, the last data page will be full. Request one further page (returns zero rows) to trigger the completed status transition.

Execution Status Lifecycle

StatusWhen set
pendingOn first request (page 1).
startedAfter page 1 response is sent.
completedWhen a response contains fewer rows than row_count.
resetInserted by the reset endpoint; acts as the new cursor.

Support

If you have questions or need help with the API, please contact our support team.