{"openapi":"3.1.0","info":{"title":"Handwren API","version":"1.0.0","description":"One-time secret links, requests, grants and brokered calls. Free on every plan; limits by plan."},"servers":[{"url":"https://handwren-xkedfa.helm7.app"}],"paths":{"/api/v1/links":{"post":{"summary":"Store a link encrypted by you, or (with a key) send { secret } and we encrypt it.","security":[{},{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["ciphertext","iv","accessToken","expiresInHours"],"properties":{"ciphertext":{"type":"string"},"iv":{"type":"string"},"salt":{"type":"string"},"accessToken":{"type":"string"},"maxViews":{"type":"integer"},"expiresInHours":{"type":"integer"}}},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string"},"maxViews":{"type":"integer"},"expiresInHours":{"type":"integer"},"passphrase":{"type":"string"}}}]}}}}},"get":{"summary":"Links you've made, with views left and status.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/links/{id}":{"get":{"summary":"Whether a link is still there, views left, passphrase salt. Never the ciphertext.","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Burn a link early, with its burn token or as its owner.","security":[{},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/links/{id}/reveal":{"post":{"summary":"Spend a view: send the access token derived from the key, get the ciphertext.","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accessToken"],"properties":{"accessToken":{"type":"string"}}}}}}}},"/api/v1/requests":{"post":{"summary":"Ask a person for a secret. Returns their link and, with a policy, your grant token.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"purpose":{"type":"string"},"recipientName":{"type":"string"},"recipientEmail":{"type":"string"},"expiresInDays":{"type":"integer"},"publicKey":{"type":"object","description":"P-256 JWK for end-to-end mode"},"policy":{"type":"object","properties":{"service":{"type":"string","enum":["stripe","github","openai","anthropic","vercel","cloudflare","sentry","linear","notion","hubspot"]},"hosts":{"type":"array","items":{"type":"string"}},"methods":{"type":"array","items":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]}},"paths":{"type":"array","items":{"type":"string"}},"auth":{"type":"object","properties":{"header":{"type":"string"},"template":{"type":"string","description":"Must contain {{secret}} or {{secret_basic}}."}}}}},"grantMaxCalls":{"type":"integer"},"grantDays":{"type":"integer"}}}}}}},"get":{"summary":"Your requests.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/requests/{id}":{"get":{"summary":"Poll one request: open, fulfilled, declined, cancelled or expired.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Withdraw an open request.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/requests/{id}/link":{"post":{"summary":"Get a new link for an open request; the old one stops working.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/secrets":{"get":{"summary":"Secrets in your vault (names and dates, not values).","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a secret to your vault.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}}}}}},"/api/v1/secrets/{id}/reveal":{"post":{"summary":"Read a vault secret, or fetch an end-to-end envelope. Logged.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/secrets/{id}":{"delete":{"summary":"Delete a secret and revoke every grant made from it.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/grants":{"get":{"summary":"Your grants with status and calls used.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Make a grant from a vault secret. The token is shown once.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["secretId","label","policy"],"properties":{"secretId":{"type":"string","format":"uuid"},"label":{"type":"string"},"policy":{"type":"object","properties":{"service":{"type":"string","enum":["stripe","github","openai","anthropic","vercel","cloudflare","sentry","linear","notion","hubspot"]},"hosts":{"type":"array","items":{"type":"string"}},"methods":{"type":"array","items":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]}},"paths":{"type":"array","items":{"type":"string"}},"auth":{"type":"object","properties":{"header":{"type":"string"},"template":{"type":"string","description":"Must contain {{secret}} or {{secret_basic}}."}}}}},"maxCalls":{"type":"integer"},"expiresInDays":{"type":"integer"}}}}}}}},"/api/v1/grants/{id}":{"get":{"summary":"One grant and its recent calls.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Revoke a grant and everything shared from it.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/grants/self":{"get":{"summary":"What the grant you hold allows, and what's left.","security":[{"grant":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Give your grant up when the job is done.","security":[{"grant":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/grants/share":{"post":{"summary":"Hand a narrower grant to another agent.","security":[{"grant":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["maxCalls","expiresInHours"],"properties":{"label":{"type":"string"},"policy":{"type":"object","properties":{"service":{"type":"string","enum":["stripe","github","openai","anthropic","vercel","cloudflare","sentry","linear","notion","hubspot"]},"hosts":{"type":"array","items":{"type":"string"}},"methods":{"type":"array","items":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]}},"paths":{"type":"array","items":{"type":"string"}},"auth":{"type":"object","properties":{"header":{"type":"string"},"template":{"type":"string","description":"Must contain {{secret}} or {{secret_basic}}."}}}}},"maxCalls":{"type":"integer"},"expiresInHours":{"type":"integer"}}}}}}}},"/api/v1/proxy":{"post":{"summary":"Make one HTTPS call with the secret added. You get the API's answer.","security":[{"grant":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["method","url"],"properties":{"method":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"string"}}}}}}}},"/api/v1/me":{"get":{"summary":"Your plan, limits and usage this month.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activity":{"get":{"summary":"Activity log. ?format=csv on Pro.","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/plans":{"get":{"summary":"Plans, prices and limits.","security":[],"parameters":[],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"hw_live_... from /app/settings"},"grant":{"type":"apiKey","in":"header","name":"Handwren-Grant","description":"hwg_... grant token"}},"schemas":{"Error":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string","enum":["invalid_input","invalid_policy","unauthorized","limit_reached","host_not_allowed","revoked","private_address","gone","rate_limited","upstream_unreachable"]}}}}}}