{"openapi":"3.1.0","info":{"title":"EyePush","version":"1.1.0","description":"Send short messages to Even Realities G2 smart glasses, and ask yes/no questions the user answers with a tap."},"servers":[{"url":"https://eyepush.app"}],"components":{"securitySchemes":{"sourceKey":{"type":"http","scheme":"bearer","description":"An EyePush source key."}},"schemas":{"Message":{"type":"object","required":["body"],"properties":{"title":{"type":"string","description":"Optional short heading."},"body":{"type":"string","description":"Plain-text message, ideally under 400 characters."},"silent":{"type":"boolean","description":"Widget only, no phone notification."}}},"Ask":{"type":"object","required":["question"],"properties":{"question":{"type":"string","description":"The yes/no question, ideally under 100 characters."},"body":{"type":"string","description":"Optional context shown under the question."},"yes":{"type":"string","description":"Label for yes, e.g. \"Approve\". Default \"Yes\". Up to 20 characters."},"no":{"type":"string","description":"Label for no, e.g. \"Deny\". Default \"No\". Up to 20 characters."},"expiresIn":{"type":"integer","description":"Seconds the user can still answer. Default 3600, max 604800."},"wait":{"type":"integer","description":"Seconds to hold the request open for the answer, 0 to 60. Default 0."},"callbackUrl":{"type":"string","description":"Optional https URL that receives the outcome as a signed POST."}}},"Question":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["open","answered","expired"]},"answer":{"type":["string","null"],"enum":["yes","no",null]},"choice":{"type":["string","null"],"description":"The label the user picked."},"title":{"type":"string"},"body":{"type":"string"},"askedAt":{"type":"integer","description":"Milliseconds since the epoch."},"answeredAt":{"type":["integer","null"]},"expiresAt":{"type":"integer"},"pollUrl":{"type":"string","description":"Only when asking: where to check the answer."}}}}},"security":[{"sourceKey":[]}],"paths":{"/api/v1/messages":{"post":{"operationId":"sendToGlasses","summary":"Show a message on the user's G2 glasses and as a phone notification","description":"Use for brief updates the user should see without checking their phone. Plain text only, no markdown or emoji.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"responses":{"202":{"description":"Delivered","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"widgets":{"type":"integer"},"phones":{"type":"integer"}}}}}},"400":{"description":"Invalid question fields"},"402":{"description":"Source paused (account over its plan limit)"},"404":{"description":"Unknown key"},"429":{"description":"Daily limit reached"}}}},"/api/v1/questions":{"post":{"operationId":"askOnGlasses","summary":"Ask the user a yes/no question on their G2 glasses","description":"The user answers with a tap on the glasses or their ring. Use before a step that needs their decision. Set wait to get the answer in the response; if status is still \"open\", call checkAnswer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ask"}}}},"responses":{"202":{"description":"Asked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Question"}}}},"400":{"description":"Invalid question fields"},"402":{"description":"Source paused (account over its plan limit)"},"404":{"description":"Unknown key"},"429":{"description":"Daily limit reached"}}}},"/api/v1/questions/{id}":{"get":{"operationId":"checkAnswer","summary":"Get the answer to a question","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"wait","in":"query","required":false,"description":"Seconds to wait for an answer if the question is still open, 0 to 60.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Question"}}}},"404":{"description":"Unknown question"}}}}}}