{"openapi":"3.1.0","info":{"title":"PagePenny API","description":"Templated PDF and image generation. Send JSON plus a template, get a PDF or image back.","version":"1.0.0"},"paths":{"/v1/auth/magic-link":{"post":{"summary":"Magic Link","operationId":"magic_link_v1_auth_magic_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Magic Link V1 Auth Magic Link Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/verify":{"post":{"summary":"Verify","operationId":"verify_v1_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Verify V1 Auth Verify Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/logout":{"post":{"summary":"Logout","operationId":"logout_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Logout V1 Auth Logout Post"}}}}}}},"/v1/account":{"get":{"summary":"Account","operationId":"account_v1_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Account V1 Account Get"}}}}}}},"/v1/account/keys":{"post":{"summary":"New Key","operationId":"new_key_v1_account_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response New Key V1 Account Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/keys/{prefix}":{"delete":{"summary":"Revoke Key","operationId":"revoke_key_v1_account_keys__prefix__delete","parameters":[{"name":"prefix","in":"path","required":true,"schema":{"type":"string","title":"Prefix"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Key V1 Account Keys  Prefix  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/cap":{"put":{"summary":"Set Cap","operationId":"set_cap_v1_account_cap_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Set Cap V1 Account Cap Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/checkout":{"post":{"summary":"Checkout","operationId":"checkout_v1_account_checkout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Checkout V1 Account Checkout Post"}}}}}}},"/v1/account/portal":{"post":{"summary":"Portal","operationId":"portal_v1_account_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Portal V1 Account Portal Post"}}}}}}},"/v1/templates":{"get":{"summary":"List Templates","operationId":"list_templates_v1_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Templates V1 Templates Get"}}}}}}},"/v1/templates/{template_id}":{"get":{"summary":"Get Template","operationId":"get_template_v1_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Template V1 Templates  Template Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/render":{"post":{"summary":"Render","operationId":"render_v1_render_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{},"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-secret":{"get":{"summary":"Webhook Secret","description":"The secret that signs your webhooks (X-PagePenny-Signature: t=<unix>,v1=<hex hmac-sha256 of \"t.body\">).","operationId":"webhook_secret_v1_webhook_secret_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Webhook Secret V1 Webhook Secret Get"}}}}}}},"/v1/renders/{render_id}":{"get":{"summary":"Get Render","operationId":"get_render_v1_renders__render_id__get","parameters":[{"name":"render_id","in":"path","required":true,"schema":{"type":"string","title":"Render Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Render V1 Renders  Render Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"summary":"Usage","operationId":"usage_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Usage V1 Usage Get"}}}}}}}},"components":{"schemas":{"CapIn":{"properties":{"monthly_cap_usd":{"type":"integer","maximum":10000.0,"minimum":5.0,"title":"Monthly Cap Usd"}},"type":"object","required":["monthly_cap_usd"],"title":"CapIn"},"EmailIn":{"properties":{"email":{"type":"string","maxLength":254,"title":"Email"},"accept_terms":{"type":"boolean","title":"Accept Terms","default":false},"terms_version":{"type":"string","maxLength":20,"title":"Terms Version","default":""}},"type":"object","required":["email"],"title":"EmailIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageOptionsIn":{"properties":{"width":{"type":"integer","title":"Width","default":1200},"height":{"type":"integer","title":"Height","default":630},"scale":{"type":"number","title":"Scale","default":1.0},"quality":{"type":"integer","title":"Quality","default":90},"full_page":{"type":"boolean","title":"Full Page","default":false}},"type":"object","title":"ImageOptionsIn"},"KeyIn":{"properties":{"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name","default":"key"}},"type":"object","title":"KeyIn"},"PdfOptionsIn":{"properties":{"page_size":{"type":"string","title":"Page Size","default":"Letter"},"landscape":{"type":"boolean","title":"Landscape","default":false},"margin":{"type":"string","pattern":"^\\d+(\\.\\d+)?(mm|cm|in|px)$","title":"Margin","default":"12mm"},"scale":{"type":"number","title":"Scale","default":1.0}},"type":"object","title":"PdfOptionsIn"},"RenderRequest":{"properties":{"template_id":{"anyOf":[{"type":"string","pattern":"^tpl_[a-z0-9_]{1,64}$"},{"type":"null"}],"title":"Template Id"},"html":{"anyOf":[{"type":"string","maxLength":2097152},{"type":"null"}],"title":"Html"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"format":{"anyOf":[{"type":"string","enum":["pdf","png","jpeg","webp"]},{"type":"null"}],"title":"Format"},"pdf":{"anyOf":[{"$ref":"#/components/schemas/PdfOptionsIn"},{"type":"null"}]},"image":{"anyOf":[{"$ref":"#/components/schemas/ImageOptionsIn"},{"type":"null"}]},"output":{"type":"string","enum":["url","binary","base64"],"title":"Output","default":"url"},"async":{"type":"boolean","title":"Async","default":false},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url"},"expires_in":{"type":"integer","maximum":604800.0,"minimum":60.0,"title":"Expires In","default":86400}},"type":"object","title":"RenderRequest"},"TokenIn":{"properties":{"token":{"type":"string","maxLength":200,"minLength":10,"title":"Token"}},"type":"object","required":["token"],"title":"TokenIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}