{"openapi":"3.0.3","info":{"title":"Ashniva eSign API","version":"1.0.0","description":"Send documents and receive webhooks. Use JWT (Bearer) or sandbox/live API keys (X-API-Key)."},"servers":[{"url":"/v1","description":"API base"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"paths":{"/documents":{"post":{"summary":"Create document","description":"Create a draft/prepare document. Test API keys create sandbox documents (isSandbox=true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"templateId":{"type":"string"},"signers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}}}}}}}}},"responses":{"201":{"description":"Created"}}}},"/documents/{id}/send":{"post":{"summary":"Send document for signature","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["deadline"],"properties":{"deadline":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Sent; signers invited"}}}},"/api-keys":{"get":{"summary":"List API keys (live + test)","responses":{"200":{"description":"OK"}}},"post":{"summary":"Create API key","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"environment":{"type":"string","enum":["live","test"]},"scopes":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Secret shown once"}}}},"/webhooks":{"get":{"summary":"List webhooks","responses":{"200":{"description":"OK"}}},"post":{"summary":"Create webhook","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Created with signing secret"}}}},"/webhooks/{id}/ping":{"post":{"summary":"Queue a ping delivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Queued"}}}},"/webhooks/deliveries":{"get":{"summary":"List recent webhook deliveries","responses":{"200":{"description":"OK"}}}},"/webhooks/deliveries/{id}/retry":{"post":{"summary":"Retry a failed delivery (same delivery row)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Re-queued"}}}},"/webhooks/deliveries/{id}/replay":{"post":{"summary":"Replay as a new delivery (fresh event id)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"New delivery queued"}}}}}}