{"openapi":"3.1.0","info":{"title":"uEngage Logs API","version":"0.1.0","description":"Structured-log ingestion endpoint. Producers POST one or more LogEvents and the service writes them to CloudWatch under `/logs/uengage/<product>/<service>`. Schema-validated; partial-rejection batches are surfaced as HTTP 207.","license":{"name":"Proprietary"}},"servers":[{"url":"https://api.platform.uengage.io","description":"Production"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer JWT, RS256-signed by the auth service. Verify against the JWKS at `/auth/business/jwks.json`. Service-to-service callers mint via `POST /auth/business/oauth/token` with `grant_type=client_credentials`."}},"schemas":{"LogIngestOk":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"example":12}},"required":["accepted"]},"LogIngestPartial":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"example":10},"rejected":{"type":"integer","minimum":0,"example":2},"detail":{"type":"array","items":{"type":"object","properties":{"log_group":{"type":"string"},"log_stream":{"type":"string"},"attempted":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0},"info":{"nullable":true}},"required":["log_group","log_stream","attempted","rejected"]},"description":"Per-batch rejection details from CloudWatch"}},"required":["accepted","rejected","detail"]},"ApiError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"nullable":true}}},"required":["error"],"description":"Standard error envelope. `error` is a stable machine-readable code; `message` is a human-readable hint; `issues` (when present) is a Zod validation issue list."},"LogEvent":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"level":{"type":"string","enum":["ERROR","WARN","INFO","DEBUG"]},"product":{"type":"string","enum":["edge","flash","prism","platform","white-label"]},"service":{"type":"string","minLength":1},"component":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"environment":{"type":"string","minLength":1},"trace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","minLength":8}]},"tenant":{"type":"object","nullable":true,"properties":{"business_id":{"type":"string","minLength":1},"parent_id":{"type":"string","minLength":1}},"required":["business_id"]},"user_id":{"type":"string"},"source":{"type":"string","enum":["server","client","lambda","worker"]},"error":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"category":{"type":"string","minLength":1},"stack":{"type":"string"},"upstream":{"type":"string"}},"required":["code","category"]},"context":{"type":"object","additionalProperties":{"nullable":true}}},"required":["timestamp","level","product","service","component","version","environment","trace_id","source"],"description":"A single structured log event. Producers pin product/service/component to identify which Lambda or worker emitted the event; trace_id propagates across services."},"LogIngestRequest":{"anyOf":[{"$ref":"#/components/schemas/LogEvent"},{"type":"array","items":{"$ref":"#/components/schemas/LogEvent"},"minItems":1,"maxItems":1000}],"description":"Either a single LogEvent or an array of 1..1000 LogEvents. Arrays larger than 1000 are rejected before any partial write."}},"parameters":{}},"paths":{"/v1/logs":{"post":{"tags":["logs"],"summary":"Ingest one or more log events","description":"Writes structured log events to CloudWatch under `/logs/uengage/<product>/<service>`. Schema-validated up front; downstream CloudWatch may still reject individual events (timestamp out of range, etc.) which surface as a 207 partial response.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestRequest"}}}},"responses":{"200":{"description":"All events accepted by CloudWatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestOk"}}}},"207":{"description":"Partial: some events accepted, some dropped by CloudWatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestPartial"}}}},"400":{"description":"INVALID_JSON, SCHEMA_VIOLATION, or ALL_REJECTED (every event was dropped by CloudWatch)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"WRITE_FAILED - the underlying PutLogEvents call threw","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/logs/ingest":{"post":{"tags":["logs"],"summary":"Ingest one or more log events","description":"Writes structured log events to CloudWatch under `/logs/uengage/<product>/<service>`. Schema-validated up front; downstream CloudWatch may still reject individual events (timestamp out of range, etc.) which surface as a 207 partial response.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestRequest"}}}},"responses":{"200":{"description":"All events accepted by CloudWatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestOk"}}}},"207":{"description":"Partial: some events accepted, some dropped by CloudWatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogIngestPartial"}}}},"400":{"description":"INVALID_JSON, SCHEMA_VIOLATION, or ALL_REJECTED (every event was dropped by CloudWatch)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"WRITE_FAILED - the underlying PutLogEvents call threw","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}