Skip to main content

API Reference

The AppActor REST API. Base URL: https://api.appactor.com

Authenticationโ€‹

  • Public keys (pk_*): client SDK endpoints
  • Secret keys (sk_*): admin/server-to-server endpoints

Use one of:

Authorization: Bearer <key>

or

X-API-Key: <key>

Response Formatโ€‹

Most endpoints return this envelope:

// Success
{ "data": { "...": "..." }, "requestId": "req_abc123" }

// Error
{ "error": { "code": "ERROR_CODE", "message": "..." }, "requestId": "req_abc123" }

Exception: POST /v1/payment/receipts/apple returns the SDK receipt-status contract (ok, retryable_error, permanent_error) instead of the generic envelope.

Client SDK Endpoints (pk_* key)โ€‹

Identityโ€‹

POST /v1/payment/identifyโ€‹

Create or retrieve a user identity and return customer snapshot.

{
"appUserId": "user_123",
"platform": "ios",
"appVersion": "2.1.0",
"sdkVersion": "1.0.0",
"deviceLocale": "en_US",
"deviceModel": "iPhone15,2",
"osVersion": "17.0"
}

POST /v1/payment/loginโ€‹

Switch from current user to a new user.

{
"currentAppUserId": "appactor-anon-abc",
"newAppUserId": "user_123"
}

POST /v1/payment/logoutโ€‹

Logout current user.

{
"appUserId": "user_123"
}

Offeringsโ€‹

GET /v1/payment/offeringsโ€‹

Fetch server-driven offerings. Supports ETag / If-None-Match.

Customer Infoโ€‹

GET /v1/customers/:appUserIdโ€‹

Fetch customer entitlements/subscriptions for the given app user ID. Supports ETag / If-None-Match.

Receiptsโ€‹

POST /v1/payment/receipts/appleโ€‹

Submit Apple StoreKit 2 signed transaction (signedTransactionInfo) for validation.

{
"appUserId": "user_123",
"bundleId": "com.myapp.app",
"signedTransactionInfo": "<JWS string>",
"environment": "production"
}

Response status contract:

StatusMeaningSDK behavior
okReceipt validatedFinish transaction
retryable_errorTemporary/transient failureKeep queued and retry
permanent_errorInvalid/revoked/malformed receiptFinish and discard

POST /v1/payment/restoreโ€‹

Restore purchases by submitting transactions/purchases.

{
"appUserId": "user_123",
"store": "apple",
"transactions": [
{
"transactionId": "12345",
"jwsRepresentation": "<JWS string>"
}
]
}

Remote Configโ€‹

GET /v1/remote-configโ€‹

Resolve active config values for the authenticated app context.

Query parameters:

ParameterRequiredDescription
app_user_idNoUser ID for entitlement-based targeting
app_versionNoApp version for version targeting
countryNoISO 3166-1 alpha-2 country code

Experimentsโ€‹

POST /v1/experiments/:experimentKey/assignmentsโ€‹

Assign (or return sticky assignment for) a user in an experiment.

Query parameters:

ParameterRequiredDescription
app_user_idYesUser ID (max 256 chars)
app_versionNoApp version for targeting
countryNoISO 3166-1 alpha-2 country code

Apple Search Adsโ€‹

POST /v1/asa/attributionโ€‹

Submit ASA attribution token payload.

POST /v1/asa/purchase-eventโ€‹

Submit ASA purchase event payload.

Server-Side Endpoints (sk_* key)โ€‹

User Managementโ€‹

GET /v1/api/users/:idโ€‹

Get user details.

DELETE /v1/api/users/:idโ€‹

Soft-delete a user.

PUT /v1/api/users/:id/attributesโ€‹

Patch/replace user attributes.

{
"attributes": {
"plan": "enterprise",
"seats": 50,
"trial": false
}
}

Entitlement Managementโ€‹

POST /v1/api/users/:id/entitlements/:entitlementId/grantโ€‹

Grant entitlement directly (promotional/manual).

{
"duration": "P30D"
}

Or:

{
"endTimeMs": 1706745600000
}

POST /v1/api/users/:id/entitlements/:entitlementId/revokeโ€‹

Revoke manually granted entitlement.

ASA Identity Syncโ€‹

POST /v1/asa/update-user-idโ€‹

Server-to-server ASA identity update endpoint (requires secret key).

Webhook Endpointsโ€‹

POST /v1/webhooks/apple/:tokenโ€‹

Inbound Apple App Store Server Notifications V2.

POST /v1/webhooks/google/:appIdโ€‹

Inbound Google Play Pub/Sub notifications.

Error Codesโ€‹

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid request payload/params
UNAUTHORIZED401Invalid/missing API key
NOT_FOUND404Resource not found
CONFLICT409Conflict (e.g., identity collision)
RATE_LIMIT_EXCEEDED429Request throttled
INTERNAL500Internal server error

Health Checkโ€‹

GET /healthโ€‹

Service health endpoint (no authentication required).

{
"status": "ok",
"timestamp": "2025-01-15T12:00:00Z"
}

Next Stepsโ€‹