The AfterAds REST API spans 4 surfaces: Tracking, Studio, Loyalty, Services.

#Base URLs

EnvironmentBase URLNotes
Productionhttps://afterads.com/apiDefault
Staginghttps://staging.afterads.com/apiFor testing
Localhttp://localhost:3000/apiDevelopment only

#Authentication

#Core endpoints

EndpointMethodDescription
/api/trackPOSTSalla theme event (HMAC-signed)
/api/studio/rewritePOSTAI product description rewrite (SSE)
/api/waitlistPOSTSubscribe an email to a waitlist
/api/ordersGETCurrent user's orders
/api/servicesPOSTCreate a service request
/api/services/:idGET, PATCHView / update a request
/api/auth/**Better Auth endpoints
/api/healthGETHealth check
/api/webhooks/moyasarPOSTMoyasar payment webhook

#Rate limits

#Error format

All errors return a unified JSON shape:

json
{
  "error": "rate_limited",
  "message": "Daily rewrite quota exceeded",
  "retry_after_seconds": 3600
}

#HTTP codes

CodeUse
200Success + body
204Success without body (e.g. OPTIONS)
400invalid_request (Zod validation)
401unauthenticated or bad signature
403forbidden (not admin, etc.)
404resource not found
409conflict (duplicate slug, etc.)
429rate_limited
500internal server error

#Versioning

#Idempotency

Some endpoints accept an Idempotency-Key header (16-char string):

  • POST /api/orders — useful for network timeouts
  • POST /api/services — same benefit

#SDK