{"openapi":"3.1.0","info":{"title":"L2Index Events API","version":"1.0.0","description":"Send player registrations, logins and deposits from your Lineage II server. L2Index turns them into analytics in your dashboard."},"servers":[{"url":"https://l2index.eu"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Server token `l2i_…` from the L2Index dashboard."}},"schemas":{"Event":{"type":"object","required":["event","playerId"],"additionalProperties":false,"properties":{"event":{"type":"string","enum":["registration","login","deposit"],"description":"What happened on the game server."},"playerId":{"type":"string","maxLength":64,"description":"Your internal account ID or login. Do not send emails or passwords.","example":"10452"},"playerName":{"type":"string","maxLength":64,"description":"Optional display name shown in the top donors table.","example":"DarkElfLord"},"amount":{"type":"number","minimum":0,"description":"Deposit amount in real money. Only for `deposit`. Optional, but needed for revenue charts.","example":250},"currency":{"type":"string","pattern":"^[A-Z]{3}$","default":"UAH","description":"ISO 4217 currency of `amount`.","example":"UAH"},"eventId":{"type":"string","maxLength":100,"description":"Your unique ID for this event (e.g. payment ID). Repeated requests with the same eventId are ignored, so retries are safe.","example":"pay_88123"},"clickId":{"type":"string","maxLength":64,"description":"The `l2i_click` query parameter L2Index added to your website URL. Send it with `registration` to attribute the player to L2Index."},"occurredAt":{"type":"string","format":"date-time","description":"When it happened. Defaults to now. Up to 365 days back for imports."},"test":{"type":"boolean","description":"Validate the token and payload without storing anything."}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v1/events":{"post":{"summary":"Report a player event","operationId":"createEvent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"},"examples":{"registration":{"value":{"event":"registration","playerId":"10452","clickId":"3f2b8c1e-…"}},"login":{"value":{"event":"login","playerId":"10452"}},"deposit":{"value":{"event":"deposit","playerId":"10452","playerName":"DarkElfLord","amount":250,"currency":"UAH","eventId":"pay_88123"}}}}}},"responses":{"200":{"description":"Duplicate eventId or test request, nothing stored"},"201":{"description":"Stored","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"duplicate":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporary failure, retry with the same eventId"}}}}}}