{"openapi":"3.1.0","info":{"title":"ReSQLable","description":"Unstructured data, structured. Read-only SQL over versioned dataset snapshots, served per API key and metered like tokens.","version":"0.1.0"},"paths":{"/v1/health":{"get":{"tags":["data"],"summary":"Service health","operationId":"health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health V1 Health Get"}}}}}}},"/v1/datasets":{"get":{"tags":["data"],"summary":"List datasets","operationId":"datasets_v1_datasets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Datasets V1 Datasets Get"}}}}}}},"/v1/datasets/{dataset}/schema":{"get":{"tags":["data"],"summary":"Schema for one dataset","operationId":"schema_v1_datasets__dataset__schema_get","parameters":[{"name":"dataset","in":"path","required":true,"schema":{"type":"string","title":"Dataset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Schema V1 Datasets  Dataset  Schema Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/query":{"post":{"tags":["data"],"summary":"Run a read-only SQL query","operationId":"query_v1_query_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Query V1 Query Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["data"],"summary":"Current usage and limits","operationId":"get_usage_v1_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage V1 Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"tags":["data"],"summary":"Key identity","operationId":"me_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Me V1 Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/rotate":{"post":{"tags":["data"],"summary":"Issue a replacement key","operationId":"rotate_v1_keys_rotate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate V1 Keys Rotate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/free":{"post":{"tags":["data"],"summary":"Get a free API key","operationId":"free_key_v1_keys_free_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreeKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Free Key V1 Keys Free Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/config":{"get":{"tags":["billing"],"summary":"Plan catalog and billing availability","operationId":"billing_config_billing_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Billing Config Billing Config Get"}}}}}}},"/billing/checkout":{"post":{"tags":["billing"],"summary":"Create a hosted checkout session","operationId":"create_checkout_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Checkout Billing Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/claim":{"post":{"tags":["billing"],"summary":"Exchange a claim token for an API key","operationId":"claim_billing_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Claim Billing Claim Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/recovery/request":{"post":{"tags":["recovery"],"summary":"Email a one-time recovery link","operationId":"request_recovery_v1_recovery_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Request Recovery V1 Recovery Request Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/recovery/claim":{"post":{"tags":["recovery"],"summary":"Exchange a recovery token for a new key","operationId":"claim_recovery_v1_recovery_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Claim Recovery V1 Recovery Claim Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/config":{"get":{"tags":["auth"],"summary":"Which sign-in methods are available","operationId":"auth_config_v1_auth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Auth Config V1 Auth Config Get"}}}}}}},"/v1/auth/request":{"post":{"tags":["auth"],"summary":"Email a one-time sign-in link","operationId":"request_login_v1_auth_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Request Login V1 Auth Request Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/verify":{"post":{"tags":["auth"],"summary":"Exchange a sign-in link for a session","operationId":"verify_login_v1_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Verify Login V1 Auth Verify Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/session":{"get":{"tags":["auth"],"summary":"Current session","operationId":"session_info_v1_auth_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Session Info V1 Auth Session Get"}}}}}}},"/v1/auth/logout":{"post":{"tags":["auth"],"summary":"End the session","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":{"tags":["account"],"summary":"Account, keys and usage","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/{key_id}/rotate":{"post":{"tags":["account"],"summary":"Rotate a key from the session","operationId":"rotate_key_v1_account_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate Key V1 Account Keys  Key Id  Rotate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/keys/{key_id}/revoke":{"post":{"tags":["account"],"summary":"Revoke a key from the session","operationId":"revoke_key_v1_account_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Key V1 Account Keys  Key Id  Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CheckoutRequest":{"properties":{"tier":{"type":"string","enum":["developer","commercial","enterprise"],"title":"Tier"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Email"}},"type":"object","required":["tier"],"title":"CheckoutRequest"},"ClaimBody":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"}},"type":"object","required":["token"],"title":"ClaimBody"},"ClaimRequest":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"}},"type":"object","required":["token"],"title":"ClaimRequest"},"EmailBody":{"properties":{"email":{"type":"string","maxLength":200,"minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"EmailBody"},"FreeKeyRequest":{"properties":{"email":{"type":"string","maxLength":200,"minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"FreeKeyRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"QueryRequest":{"properties":{"dataset":{"type":"string","maxLength":64,"minLength":1,"title":"Dataset"},"sql":{"type":"string","maxLength":20000,"minLength":1,"title":"Sql"},"format":{"type":"string","enum":["objects","arrays"],"title":"Format","default":"objects"}},"type":"object","required":["dataset","sql"],"title":"QueryRequest"},"RequestBody":{"properties":{"email":{"type":"string","maxLength":200,"minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"RequestBody"},"TokenBody":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"}},"type":"object","required":["token"],"title":"TokenBody"},"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"}}}}