Adopture Docs
API Reference

Event Ingestion

Send analytics events to Adopture via the HTTP API.

The event ingestion endpoint accepts batches of analytics events and queues them for processing.

Endpoint

POST https://api.adopture.com/api/v1/events

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
Idempotency-KeyNoUUID for deduplication (300-second window)

Request Body

{
  "app_key": "ak_your_app_key_here",
  "sdk_version": "0.1.0",
  "events": [
    {
      "type": "track",
      "name": "button_clicked",
      "hashed_daily_id": "abc123...",
      "hashed_monthly_id": "def456...",
      "session_id": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:30:00.000Z",
      "context": {
        "os": "iOS",
        "os_version": "17.2",
        "app_version": "1.0.0",
        "locale": "en_US",
        "device_type": "iPhone 15",
        "screen_width": 1179,
        "screen_height": 2556
      },
      "properties": {
        "button_name": "checkout"
      }
    }
  ]
}

Top-Level Fields

FieldTypeRequiredDescription
app_keystringYesYour app key (starts with ak_)
sdk_versionstringNoSDK version sending the request
eventsarrayYesArray of event objects (max 100)

Event Object

FieldTypeRequiredDescription
typestringYestrack, screen, or revenue
namestringYesEvent name (1-200 characters)
hashed_daily_idstringYesDaily rotating hash (16-128 characters)
hashed_monthly_idstringYesMonthly rotating hash (16-128 characters)
hashed_retention_idstringNo90-day retention hash (16-128 characters)
session_idstringYesSession UUID (1-128 characters)
timestampstringYesISO 8601 datetime (within 72h past to 1h future)
contextobjectYesDevice context (see below)
propertiesobjectNoCustom key-value pairs (max 50 keys, values max 500 characters)
user_idstringNoUser identifier (1-256 characters)
revenueobjectNoRevenue data (required when type is revenue)

Event Types

TypeDescription
trackCustom event (button click, signup, etc.)
screenScreen view
revenuePurchase or subscription event

Context Object

The context object contains device and environment metadata:

FieldTypeRequiredDescription
osstringYesOperating system (e.g., iOS, Android)
os_versionstringNoOS version (e.g., 17.2)
app_versionstringNoYour app's version (e.g., 1.0.0)
localestringNoDevice locale (e.g., en_US)
device_typestringNoDevice model (e.g., iPhone 15)
screen_widthnumberNoScreen width in pixels
screen_heightnumberNoScreen height in pixels

Revenue Object

Required when the event type is revenue. See Revenue Events for the full field reference.

Constraints

ConstraintLimit
Max request body size512 KB
Max events per request100
Max properties per event50 keys
Max property value length500 characters
Timestamp range72 hours in the past to 1 hour in the future

Response

Success (202 Accepted)

{
  "status": "accepted",
  "events": 1
}

The response indicates how many events were accepted for processing. A 202 status means the events have been queued — they will appear in your dashboard within seconds.

Rate Limit Headers

Every response includes rate limit information:

HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRemaining requests in the current window
X-RateLimit-ResetUnix timestamp when the window resets

Idempotency

Include an Idempotency-Key header with a UUID to safely retry requests. The server remembers idempotency keys for 300 seconds. If a duplicate request is received within that window, the server returns the original response with an additional field:

{
  "status": "accepted",
  "events": 1,
  "deduplicated": true
}

For error responses and status codes, see Error Handling.

On this page