{"openapi":"3.1.1","info":{"title":"Krypt Agent API","version":"1.0.0","description":"Krypt lets an enrolled agent request access to a website session with the owner's approval. The only supported site is Synthetic Portal. A grant currently lets the agent verify that the test account is signed in."},"servers":[{"url":"https://krypt.allendavisswing.com"}],"externalDocs":{"description":"Agent onboarding","url":"https://krypt.allendavisswing.com/llms.txt"},"x-krypt-site":{"id":"synthetic","name":"Synthetic Portal","account":"test-owner","scope":"verify-session","loginUrl":"https://krypt.allendavisswing.com/fake-login"},"security":[{"agentBearer":[]}],"paths":{"/healthz":{"get":{"operationId":"getHealth","summary":"Check service health","security":[],"responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"const":"ok"}}}}}}}}},"/v1/requests":{"post":{"operationId":"requestAccess","summary":"Request access to the synthetic account","description":"Send POST /v1/requests with your agent bearer token, a unique Idempotency-Key, and a JSON purpose. Reuse the key when retrying the same request. If the response includes authorizationUrl, send it privately to the owner. The owner signs in or approves through that link.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["purpose"],"properties":{"purpose":{"type":"string","minLength":1,"maxLength":500,"pattern":"\\S"}}},"example":{"purpose":"Verify the synthetic test account"}}}},"responses":{"200":{"description":"Request state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Agent authentication required","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"409":{"description":"Idempotency key conflict, wrong account, or browser busy","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"415":{"description":"Expected JSON","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"503":{"description":"Site verification temporarily unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/requests/{id}":{"get":{"operationId":"getRequest","summary":"Check the agent's request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Poll GET /v1/requests/{id} with the same bearer token. When the state is ready, use its grantId to verify the session.","responses":{"200":{"description":"Request state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"401":{"description":"Agent authentication required","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/grants/{id}/verify":{"post":{"operationId":"verifyGrant","summary":"Verify the authenticated session","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The expected account is signed in","content":{"application/json":{"schema":{"type":"object","required":["authenticated"],"properties":{"authenticated":{"const":true}}}}}},"401":{"description":"Agent authentication required","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Grant not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"409":{"description":"Session changed or browser busy","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"410":{"description":"Grant is closed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"503":{"description":"Site verification temporarily unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/grants/{id}/inspect":{"post":{"operationId":"inspectGrant","summary":"Read the signed-in test account heading with agent-browser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Signed-in test account heading","content":{"application/json":{"schema":{"type":"object","required":["authenticated","heading"],"properties":{"authenticated":{"const":true},"heading":{"type":"string"}}}}}},"401":{"description":"Agent authentication required","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Grant not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"409":{"description":"Session changed or browser busy","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"410":{"description":"Grant is closed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"503":{"description":"Site verification temporarily unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/grants/{id}":{"delete":{"operationId":"revokeGrant","summary":"Revoke the agent's grant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Grant revoked"},"401":{"description":"Agent authentication required","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Grant not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}}},"components":{"securitySchemes":{"agentBearer":{"type":"http","scheme":"bearer"}},"schemas":{"AccessRequest":{"type":"object","required":["id","state"],"properties":{"id":{"type":"string"},"state":{"type":"string","enum":["needs_login","awaiting_approval","ready","canceled","expired","closed"]},"authorizationUrl":{"type":"string","format":"uri","description":"Private link for the owner when sign-in or approval is required."},"grantId":{"type":"string","description":"Present when the request is ready. Use the same agent token with this grant."}}}}}}