{"openapi":"3.0.0","info":{"title":"Openapi OAuth Service","version":"2.1.0","description":"Comprehensive OAuth management API that enables developers to create, manage, and monitor OAuth tokens with granular scope-based permissions. Features include token lifecycle management, usage statistics tracking, wallet-based billing, subscription handling, callback monitoring, and detailed analytics across multiple API domains.","contact":{"url":"https://openapi.it/en/support","name":"Support"},"termsOfService":"https://openapi.it/en/terms-and-conditions"},"servers":[{"url":"https://oauth.openapi.com","description":"Production"},{"url":"https://test.oauth.openapi.com","description":"Sandbox"}],"tags":[{"name":"Tokens","description":"Operations related to OAuth tokens"},{"name":"Scopes","description":"Operations related to OAuth scopes"},{"name":"Callbacks","description":"Operations related to OAuth callbacks"},{"name":"Errors","description":"Operations related to API errors"},{"name":"Wallet","description":"Operations related to the wallet associated with tokens"},{"name":"Stats","description":"Operations related to API usage statistics"},{"name":"Subscriptions","description":"Operations related to subscriptions"}],"paths":{"/tokens":{"post":{"summary":"Create a new token","tags":["Tokens"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreate"}}}},"responses":{"200":{"description":"Token created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"422":{"description":"Validation error","content":{"application/json":{"examples":{"missing_scopes":{"summary":"missing scopes array","value":{"success":false,"message":"missing scopes array","error":70,"data":null}},"invalid_scopes_format":{"summary":"invalid scopes format","value":{"success":false,"message":"invalid scopes format","error":80,"data":null}},"invalid_scopes":{"summary":"Invalid scopes specified or API not enabled","value":{"success":false,"message":"Invalid scopes specified or API not enabled","error":90,"data":null}}}}}}},"security":[{"Basic-Authentication":[]}]},"get":{"summary":"List or token detail","tags":["Tokens"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of tokens to return (default 100, max 100)","required":false,"schema":{"type":"integer","default":100,"maximum":100}},{"name":"skip","in":"query","description":"Number of tokens to skip for pagination (default 0)","required":false,"schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List or token detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenListOrDetail"}}}},"404":{"description":"Token not found","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":120,"data":null}}}},"422":{"description":"Validation error","content":{"application/json":{"example":{"success":false,"message":"Invalid Token Format","error":60,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/scopes":{"get":{"summary":"List of available scopes","tags":["Scopes"],"responses":{"200":{"description":"List of scopes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserScope"}}}}}}}},"security":[{"Basic-Authentication":[]}]}},"/tokens/{token}":{"get":{"summary":"Get token by ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Token identifier"}],"responses":{"200":{"description":"Token detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"404":{"description":"Token not found","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":120,"data":null}}}},"422":{"description":"Validation error","content":{"application/json":{"example":{"success":false,"message":"Invalid Token Format","error":60,"data":null}}}}},"security":[{"Basic-Authentication":[]}]},"patch":{"summary":"Update token by ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Token identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUpdate"}}}},"responses":{"200":{"description":"Token updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"400":{"description":"Bad request","content":{"application/json":{"examples":{"token_id_required":{"summary":"Token ID is required","value":{"success":false,"message":"Token ID is required","error":150,"data":null}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"examples":{"unauthorized_refresh":{"summary":"Unauthorized","value":{"success":false,"message":"Unauthorized","error":130,"data":null}},"unauthorized_authdata":{"summary":"Unauthorized","value":{"success":false,"message":"Unauthorized","error":140,"data":null}}}}}},"404":{"description":"Token not found","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":160,"data":null}}}},"422":{"description":"Validation error","content":{"application/json":{"examples":{"invalid_scopes_format":{"summary":"invalid scopes format","value":{"success":false,"message":"invalid scopes format","error":100,"data":null}},"invalid_scopes":{"summary":"Invalid scopes specified or API not enabled","value":{"success":false,"message":"Invalid scopes specified or API not enabled","error":110,"data":null}}}}}}},"security":[{"Basic-Authentication":[]},{"Refresh-Authentication":[]}]},"delete":{"summary":"Delete token by ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Token identifier"}],"responses":{"200":{"description":"Token deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Deleted"},"data":{"nullable":true}}}}}},"400":{"description":"Bad request","content":{"application/json":{"example":{"success":false,"message":"Token ID is required","error":170,"data":null}}}},"404":{"description":"Token not found","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":180,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/errors":{"get":{"summary":"List error logs","tags":["Errors"],"parameters":[{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of scopes to filter errors"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Number of errors to skip for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Maximum number of errors to return"}],"responses":{"200":{"description":"List of error logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ErrorLog"}}}},"example":{"data":[{"id":"69822d1d48be79971b04351a","scope":"DELETE:oauth.openapi.com/tokens","domain":"oauth.openapi.com","errorAt":"2026-02-03T17:15:09+00:00","httpResponseCode":404,"errorCode":180,"message":"Not Found","ip":"93.146.69.125"},{"id":"69822d1d48be79971b04351b","scope":"GET:company.openapi.com/resource","domain":"company.openapi.com","errorAt":"2026-02-03T16:30:45+00:00","httpResponseCode":400,"errorCode":190,"message":"Query error","ip":"192.168.1.100"}]}}}},"400":{"description":"Query error","content":{"application/json":{"example":{"success":false,"message":"Query error","error":190,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/wallet":{"get":{"summary":"Get wallet information","tags":["Wallet"],"responses":{"200":{"description":"Wallet information","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Wallet"}}},"example":{"data":{"credit":125.5,"createdAt":"2025-01-15T10:00:00+00:00","updatedAt":"2026-02-12T08:30:00+00:00"}}}}}},"security":[{"Basic-Authentication":[]}]}},"/callbacks":{"get":{"summary":"List callbacks or get callback by ID","tags":["Callbacks"],"parameters":[{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of scopes to filter callbacks"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Number of callbacks to skip for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Maximum number of callbacks to return"}],"responses":{"200":{"description":"Callback(s) info","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/CallbackListElement"}},{"$ref":"#/components/schemas/Callback"}]}}},"examples":{"list":{"summary":"List of callbacks","value":{"data":[{"id":"65a1b2c3d4e5f6789abcdef0","scope":"POST:company.openapi.com/webhook","url":"https://example.com/callback","httpResponseCode":"200","startedAt":"2026-02-12T10:00:00+00:00","completedAt":"2026-02-12T10:00:05+00:00"},{"id":"65a1b2c3d4e5f6789abcdef1","scope":"POST:sms.openapi.com/send","url":"https://app.example.com/notify","httpResponseCode":"200","startedAt":"2026-02-12T09:30:00+00:00","completedAt":null}]}},"detail":{"summary":"Single callback detail","value":{"data":{"id":"65a1b2c3d4e5f6789abcdef0","scope":"POST:company.openapi.com/webhook","domain":"company.openapi.com","active":false,"startedAt":"2026-02-12T10:00:00+00:00","createdAt":"2026-02-12T09:59:55+00:00","completedAt":"2026-02-12T10:00:05+00:00","httpResponseCode":200,"data":{"event":"user.created","userId":"12345"},"custom":{"trackingId":"abc-123"},"headers":{"Content-Type":"application/json","X-Webhook-Signature":"sha256=..."},"elapsedTime":5234,"attempt":1,"retry":0,"field":"webhookUrl","method":"POST","url":"https://example.com/callback"}}}}}}},"400":{"description":"Query error","content":{"application/json":{"example":{"success":false,"message":"Query error","error":210,"data":null}}}},"404":{"description":"Callback not found","content":{"application/json":{"example":{"success":false,"message":"Callback not found","error":200,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/stats":{"get":{"summary":"Get overall API usage stats","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Date filter"}],"responses":{"200":{"description":"Overall stats info","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Total number of requests"},"walletRequests":{"type":"number","description":"Number of paid wallet requests"},"subscriptionRequests":{"type":"number","description":"Number of subscription requests"},"errorRequests":{"type":"number","description":"Number of error requests"},"walletAmount":{"type":"number","description":"Total amount spent via wallet"},"totalIps":{"type":"integer","description":"Total number of unique IP addresses"},"totalApis":{"type":"integer","description":"Total number of APIs used"}}}}},"example":{"data":{"totalRequests":1500,"walletRequests":800,"subscriptionRequests":700,"errorRequests":12,"walletAmount":125.5,"totalIps":45,"totalApis":8}}}}},"422":{"description":"Invalid date format","content":{"application/json":{"example":{"success":false,"message":"Invalid date format, must be YYYY or YYYY-MM or YYYY-MM-DD","error":240,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/stats/ips":{"get":{"summary":"Get list of unique IP addresses","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Date filter (YYYY or YYYY-MM or YYYY-MM-DD)"}],"responses":{"200":{"description":"Array of unique IP addresses","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}}},"example":{"data":["192.168.1.1","10.0.0.5","172.16.0.100","203.0.113.42"]}}}},"422":{"description":"Invalid date format","content":{"application/json":{"example":{"success":false,"message":"Invalid date format, must be YYYY or YYYY-MM or YYYY-MM-DD","error":240,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/stats/apis":{"get":{"summary":"Get stats grouped by API domain","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Date filter (YYYY or YYYY-MM or YYYY-MM-DD)"}],"responses":{"200":{"description":"Stats grouped by API domain","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Object where each key is an API domain and value contains stats for that domain","additionalProperties":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Total number of requests for this domain"},"walletRequests":{"type":"number","description":"Number of paid wallet requests for this domain"},"subscriptionRequests":{"type":"number","description":"Number of subscription requests for this domain"},"errorRequests":{"type":"number","description":"Number of error requests for this domain"},"walletAmount":{"type":"number","description":"Total amount spent via wallet for this domain"},"totalIps":{"type":"integer","description":"Number of unique IP addresses for this domain"},"totalScopes":{"type":"integer","description":"Number of scopes for this domain"}}}}}},"example":{"data":{"company.openapi.com":{"totalRequests":500,"walletRequests":300,"subscriptionRequests":200,"errorRequests":5,"walletAmount":45.5,"totalIps":20,"totalScopes":15},"sms.openapi.com":{"totalRequests":1000,"walletRequests":500,"subscriptionRequests":500,"errorRequests":7,"walletAmount":80,"totalIps":25,"totalScopes":20}}}}}},"422":{"description":"Invalid date format","content":{"application/json":{"example":{"success":false,"message":"Invalid date format, must be YYYY or YYYY-MM or YYYY-MM-DD","error":240,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/stats/apis/{domain}":{"get":{"summary":"Get detailed stats for a specific API domain including scopes breakdown","tags":["Stats"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"description":"API domain name","example":"company.openapi.com"},{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Date filter (YYYY or YYYY-MM or YYYY-MM-DD)"}],"responses":{"200":{"description":"Domain-specific stats with scopes breakdown","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Total number of requests for this domain"},"walletRequests":{"type":"number","description":"Number of paid wallet requests for this domain"},"subscriptionRequests":{"type":"number","description":"Number of subscription requests for this domain"},"errorRequests":{"type":"number","description":"Number of error requests for this domain"},"walletAmount":{"type":"number","description":"Total amount spent via wallet for this domain"},"ip":{"type":"array","description":"Array of unique IP addresses for this domain","items":{"type":"string"}},"totalIps":{"type":"integer","description":"Number of unique IP addresses for this domain"},"totalScopes":{"type":"integer","description":"Number of scopes for this domain"},"scopes":{"type":"object","description":"Object where each key is a scope identifier and value contains stats for that scope","additionalProperties":{"type":"object","properties":{"totalRequests":{"type":"number"},"walletRequests":{"type":"number"},"subscriptionRequests":{"type":"number"},"errorRequests":{"type":"number"},"walletAmount":{"type":"number"},"ip":{"type":"array","items":{"type":"string"}}}}}}}}},"example":{"data":{"totalRequests":500,"walletRequests":300,"subscriptionRequests":200,"errorRequests":5,"walletAmount":45.5,"ip":["192.168.1.1","10.0.0.5"],"totalIps":2,"totalScopes":15,"scopes":{"POST:company.openapi.com/endpoint":{"totalRequests":250,"walletRequests":150,"subscriptionRequests":100,"errorRequests":2,"walletAmount":22.75,"ip":["192.168.1.1"]},"GET:company.openapi.com/endpoint":{"totalRequests":250,"walletRequests":150,"subscriptionRequests":100,"errorRequests":3,"walletAmount":22.75,"ip":["10.0.0.5"]}}}}}}},"422":{"description":"Invalid date format","content":{"application/json":{"example":{"success":false,"message":"Invalid date format, must be YYYY or YYYY-MM or YYYY-MM-DD","error":240,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/subscriptions":{"get":{"summary":"List subscriptions or get subscription by ID","tags":["Subscriptions"],"parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string"},"description":"Subscription ID to retrieve specific subscription"},{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of scopes to filter subscriptions"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Number of subscriptions to skip for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Maximum number of subscriptions to return"}],"responses":{"200":{"description":"Subscription(s) info","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionListElement"}},{"$ref":"#/components/schemas/Subscription"}]}}},"examples":{"list":{"summary":"List of subscriptions","value":{"data":[{"id":"656d1e2f8b3c2a001f7e4a20","scope":"GET:company.openapi.com/resource","active":true,"availableRequests":"950","startsAt":"2025-11-01T00:00:00+00:00","expiresAt":"2025-12-01T00:00:00+00:00"},{"id":"656d1e2f8b3c2a001f7e4a21","scope":"POST:sms.openapi.com/send","active":true,"availableRequests":"800","startsAt":"2025-11-15T00:00:00+00:00","expiresAt":"2026-11-15T00:00:00+00:00"}]}},"detail":{"summary":"Single subscription detail","value":{"data":{"id":"656d1e2f8b3c2a001f7e4a20","scope":"GET:company.openapi.com/resource","domain":"company.openapi.com","active":true,"startsAt":"2025-11-01T00:00:00+00:00","expiresAt":"2025-12-01T00:00:00+00:00","totalRequests":"1000","availableRequests":"950","pricePerRequest":0.01,"type":"monthly","autorenew":true,"createdAt":"2025-10-25T10:00:00+00:00","updatedAt":"2025-11-19T15:30:00+00:00","price":10}}}}}}},"400":{"description":"Query error","content":{"application/json":{"example":{"success":false,"message":"Query error","error":230,"data":null}}}},"404":{"description":"Subscription not found","content":{"application/json":{"example":{"success":false,"message":"Subscription not found","error":220,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/scopes/{id}":{"get":{"summary":"Get scope by ID","tags":["Scopes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Scope ID"}],"responses":{"200":{"description":"Scope detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScopeDetail"},"success":{"type":"boolean","example":true},"message":{"type":"string","example":""},"error":{"nullable":true,"example":null}},"required":["data","success","message","error"]},"example":{"data":{"id":"682c9f5a51671f7ef264c4fd","scope":"GET:company.openapi.com/CH-start","method":"GET","endpoint":"CH-start","domain":"company.openapi.com","enabled":false,"rateLimit":false,"freeLimits":{"dayLimit":0,"monthLimit":false,"yearLimit":false,"totalLimit":false},"requirements":{"id_card":false,"oa_general_contract":false},"prices":{"ch-start":0.06}},"success":true,"message":"","error":null}}}},"404":{"description":"Scope not found","content":{"application/json":{"example":{"success":false,"message":"Scope not found","error":10,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/callbacks/{id}":{"get":{"summary":"Get callback by ID","tags":["Callbacks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Callback ID"}],"responses":{"200":{"description":"Callback detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Callback"}}},"example":{"data":{"id":"65a1b2c3d4e5f6789abcdef0","scope":"POST:company.openapi.com/webhook","domain":"company.openapi.com","active":false,"startedAt":"2026-02-12T10:00:00+00:00","createdAt":"2026-02-12T09:59:55+00:00","completedAt":"2026-02-12T10:00:05+00:00","httpResponseCode":200,"data":{"event":"user.created","userId":"12345"},"custom":{"trackingId":"abc-123"},"headers":{"Content-Type":"application/json","X-Webhook-Signature":"sha256=..."},"elapsedTime":5234,"attempt":1,"retry":0,"field":"webhookUrl","method":"POST","url":"https://example.com/callback"}}}}},"404":{"description":"Callback not found","content":{"application/json":{"example":{"success":false,"message":"Callback not found","error":200,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/wallet/transactions":{"get":{"summary":"Get wallet transactions history","tags":["Wallet"],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Number of transactions to skip for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Maximum number of transactions to return"}],"responses":{"200":{"description":"List of wallet transactions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WalletTransaction"}}}},"example":{"data":[{"id":"txn_65a1b2c3d4e5f6789abc001","amount":-15.5,"createdAt":"2026-02-12T08:30:00+00:00","description":"API usage - company.openapi.com"},{"id":"txn_65a1b2c3d4e5f6789abc002","amount":100,"createdAt":"2026-02-10T14:15:00+00:00","description":"Wallet recharge"},{"id":"txn_65a1b2c3d4e5f6789abc003","amount":-5.25,"createdAt":"2026-02-09T11:20:00+00:00","description":"API usage - sms.openapi.com"}]}}}}},"security":[{"Basic-Authentication":[]}]}},"/subscriptions/{id}":{"get":{"summary":"Get subscription by ID","tags":["Subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Subscription ID"}],"responses":{"200":{"description":"Subscription detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Subscription"}}},"example":{"data":{"id":"656d1e2f8b3c2a001f7e4a20","scope":"GET:company.openapi.com/resource","domain":"company.openapi.com","active":true,"startsAt":"2025-11-01T00:00:00+00:00","expiresAt":"2025-12-01T00:00:00+00:00","totalRequests":"1000","availableRequests":"950","pricePerRequest":0.01,"type":"monthly","autorenew":true,"createdAt":"2025-10-25T10:00:00+00:00","updatedAt":"2025-11-19T15:30:00+00:00","price":10}}}}},"404":{"description":"Subscription not found","content":{"application/json":{"example":{"success":false,"message":"Subscription not found","error":220,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}}},"components":{"securitySchemes":{"Basic-Authentication":{"description":"Basic authentication with EMAIL and APIKEY. Use the API key as the password and the email associated with the API key as the username in the Authorization header.","name":"Authorization","type":"http","scheme":"basic"},"Refresh-Authentication":{"description":"Bearer token authentication. Use a refresh token as the Bearer token in the Authorization header only for PATCH /tokens/{id} endpoint to update a token using its refresh token instead of the access token.","type":"http","scheme":"bearer"}},"schemas":{"TokenListOrDetail":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/TokenDetail"}},{"$ref":"#/components/schemas/TokenDetail"}]}}},"TokenDetail":{"type":"object","properties":{"token":{"type":"string","description":"Unique token identifier","example":"656d1e2f8b3c2a001f7e4a12"},"name":{"type":"string","description":"Human readable token name","example":"Service X API token"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp","example":"2025-11-19T10:00:00Z"},"expireAt":{"type":"string","format":"date-time","description":"Expiration timestamp","example":"2025-12-19T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2025-11-20T09:00:00Z"},"scopes":{"type":"array","items":{"type":"string"},"description":"Associated scopes","example":["GET:api.openapi.com/resource"]},"refreshToken":{"type":"string","description":"Associated refresh token. Is used to extend the token's TTL","example":"656d1e2f8b3c2a001f7e4a13"},"limits":{"$ref":"#/components/schemas/TokenLimits"},"stats":{"$ref":"#/components/schemas/TokenStats"}}},"TokenCreate":{"type":"object","description":"Data to create a new token","properties":{"scopes":{"type":"array","description":"List of requested scopes","items":{"type":"string","example":"GET:api.openapi.com/resource"},"example":["GET:api.openapi.com/resource","POST:other.openapi.com/other"]},"name":{"type":"string","description":"Human-readable token name","example":"Service X API token"},"ttl":{"type":"integer","description":"Token lifetime in seconds. Max 1 year. If a negative value or 0 is provided, the value is automatically clamped to the default TTL.","example":2592000},"limits":{"$ref":"#/components/schemas/TokenLimits"}},"required":["scopes"]},"TokenUpdate":{"type":"object","description":"Data to update an existing token. Authentication may use a Bearer access token or, alternatively, a refresh token passed as the Bearer token in the Authorization header. When using a refresh token, a new token and a new refresh token with the same scopes are returned, and the previous token is deleted.","properties":{"scopes":{"type":"array","description":"New list of scopes","items":{"type":"string","example":"GET:api.openapi.com/resource"},"example":["GET:api.openapi.com/resource","POST:other.openapi.com/other"]},"name":{"type":"string","description":"New token name","example":"Updated token"},"ttl":{"type":"integer","description":"New lifetime in seconds","example":604800},"limits":{"$ref":"#/components/schemas/TokenLimits"}}},"TokenLimits":{"type":"object","description":"Usage limits associated with the token","properties":{"totalRequests":{"type":"integer","description":"Maximum number of total allowed requests","example":10000},"walletRequests":{"type":"integer","description":"Maximum number of paid wallet requests allowed","example":1000},"subscriptionRequests":{"type":"integer","description":"Maximum number of subscription requests allowed","example":500},"walletAmount":{"type":"number","description":"Maximum amount usable from the associated wallet","example":50},"ip":{"type":"array","description":"List of allowed IP addresses","items":{"type":"string","example":"192.168.1.1"},"example":["192.168.1.1","10.0.0.2"]}}},"TokenStats":{"type":"object","description":"Usage statistics for the token","properties":{"totalRequests":{"type":"integer","description":"Total number of requests made","example":1234},"walletRequests":{"type":"integer","description":"Number of paid wallet requests made","example":120},"subscriptionRequests":{"type":"integer","description":"Number of subscription requests made","example":30},"errorRequests":{"type":"integer","description":"Number of requests that resulted in an error","example":5},"walletAmount":{"type":"number","description":"Total amount spent via wallet","example":12.5},"ip":{"type":"array","description":"List of IP addresses used","items":{"type":"string","example":"192.168.1.1"},"example":["192.168.1.1","10.0.0.2"]}}},"UserScope":{"type":"object","description":"Basic scope information available in list view","properties":{"id":{"type":"string","description":"Scope unique identifier","example":"656d1e2f8b3c2a001f7e4a14"},"scope":{"type":"string","description":"Scope name","example":"GET:api.openapi.com/resource"},"method":{"type":"string","description":"HTTP method","example":"GET"},"endpoint":{"type":"string","description":"Associated endpoint","example":"resource"},"domain":{"type":"string","description":"Associated domain","example":"api.openapi.com"},"enabled":{"type":"boolean","description":"Whether this scope is enabled for the authenticated user","example":true}}},"ScopeDetail":{"type":"object","description":"Detailed scope information including limits, requirements and pricing","allOf":[{"$ref":"#/components/schemas/UserScope"},{"type":"object","properties":{"rateLimit":{"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Rate limit for this scope, or false if no limit","example":false},"freeLimits":{"$ref":"#/components/schemas/ScopeLimits"},"requirements":{"type":"object","description":"Requirements for this scope with their fulfillment status","additionalProperties":{"type":"boolean"},"example":{"id_card":false,"oa_general_contract":false}},"prices":{"type":"object","description":"Pricing information for this scope by price key","additionalProperties":{"type":"number"},"example":{"ch-start":0.06}}}}]},"ScopeLimits":{"type":"object","description":"Free usage limits for a scope","properties":{"dayLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Daily request limit, or false if no limit","example":0},"monthLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Monthly request limit, or false if no limit","example":false},"yearLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Yearly request limit, or false if no limit","example":false},"totalLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Total request limit (lifetime), or false if no limit","example":false}}},"ErrorLog":{"type":"object","description":"Error log entry","properties":{"id":{"type":"string","description":"Error log unique identifier","example":"69822d1d48be79971b04351a"},"scope":{"type":"string","description":"Scope that caused the error","example":"DELETE:oauth.openapi.com/tokens"},"domain":{"type":"string","description":"API domain where the error occurred","example":"oauth.openapi.com"},"errorAt":{"type":"string","format":"date-time","description":"Timestamp when the error occurred","example":"2026-02-03T17:15:09+00:00"},"httpResponseCode":{"type":"integer","description":"HTTP response status code","example":404},"errorCode":{"type":"number","description":"Internal error code","example":131},"message":{"type":"string","description":"Error message","example":"Not Found"},"ip":{"type":"string","description":"IP address that triggered the error","example":"93.146.69.125"}}},"Wallet":{"type":"object","description":"Wallet information","properties":{"credit":{"type":"number","description":"Current wallet credit balance","example":125.5},"createdAt":{"type":"string","format":"date-time","description":"Wallet creation date","example":"2025-01-15T10:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Last wallet update date","example":"2026-02-12T08:30:00+00:00"}}},"WalletTransaction":{"type":"object","description":"Wallet transaction entry","properties":{"id":{"type":"string","description":"Transaction unique identifier","example":"txn_65a1b2c3d4e5f6789abc001"},"amount":{"type":"number","description":"Transaction amount (negative for expenses, positive for credits)","example":-15.5},"createdAt":{"type":"string","format":"date-time","description":"Transaction timestamp","example":"2026-02-12T08:30:00+00:00"},"description":{"type":"string","description":"Transaction description","example":"API usage - company.openapi.com"}}},"CallbackListElement":{"type":"object","description":"Simplified callback information for list view","properties":{"id":{"type":"string","description":"Callback unique identifier","example":"65a1b2c3d4e5f6789abcdef0"},"scope":{"type":"string","description":"Scope that triggered this callback","example":"POST:company.openapi.com/webhook"},"url":{"type":"string","description":"Callback destination URL","example":"https://example.com/callback"},"httpResponseCode":{"type":"string","description":"HTTP response code received from the callback URL","example":"200"},"startedAt":{"type":"string","format":"date-time","description":"Callback execution start time","example":"2026-02-12T10:00:00+00:00"},"completedAt":{"type":"string","format":"date-time","description":"Callback execution completion time (null if still active)","example":"2026-02-12T10:00:05+00:00","nullable":true}}},"Callback":{"type":"object","description":"Complete callback information","properties":{"id":{"type":"string","description":"Callback unique identifier","example":"65a1b2c3d4e5f6789abcdef0"},"scope":{"type":"string","description":"Scope that triggered this callback","example":"POST:company.openapi.com/webhook"},"domain":{"type":"string","description":"API domain for this callback","example":"company.openapi.com","nullable":true},"active":{"type":"boolean","description":"Whether the callback is still active (not completed)","example":false},"startedAt":{"type":"string","format":"date-time","description":"Callback execution start time","example":"2026-02-12T10:00:00+00:00"},"createdAt":{"type":"string","format":"date-time","description":"Callback creation time","example":"2026-02-12T09:59:55+00:00"},"completedAt":{"type":"string","format":"date-time","description":"Callback execution completion time","example":"2026-02-12T10:00:05+00:00","nullable":true},"httpResponseCode":{"type":"integer","description":"HTTP response code received from the callback URL","example":200},"data":{"type":"object","description":"Callback payload data","example":{"event":"user.created","userId":"12345"}},"custom":{"description":"Custom data associated with the callback","example":{"trackingId":"abc-123"}},"headers":{"type":"object","description":"HTTP headers sent with the callback","example":{"Content-Type":"application/json","X-Webhook-Signature":"sha256=..."}},"elapsedTime":{"type":"integer","description":"Callback execution time in milliseconds","example":5234},"attempt":{"type":"integer","description":"Current attempt number","example":1},"retry":{"type":"integer","description":"Number of retries performed","example":0},"field":{"type":"string","description":"Field identifier for the callback","example":"webhookUrl"},"method":{"type":"string","description":"HTTP method used for the callback","example":"POST"},"url":{"type":"string","description":"Callback destination URL","example":"https://example.com/callback"}}},"SubscriptionListElement":{"type":"object","description":"Simplified subscription information for list view","properties":{"id":{"type":"string","description":"Subscription unique identifier","example":"656d1e2f8b3c2a001f7e4a20"},"scope":{"type":"string","description":"Scope this subscription applies to","example":"GET:company.openapi.com/resource"},"active":{"type":"boolean","description":"Whether the subscription is currently active","example":true},"availableRequests":{"type":"string","description":"Number of requests available in this subscription","example":"950"},"startsAt":{"type":"string","format":"date-time","description":"Subscription start date","example":"2025-11-01T00:00:00+00:00"},"expiresAt":{"type":"string","format":"date-time","description":"Subscription expiration date","example":"2025-12-01T00:00:00+00:00"}}},"Subscription":{"type":"object","description":"Complete subscription information","properties":{"id":{"type":"string","description":"Subscription unique identifier","example":"656d1e2f8b3c2a001f7e4a20"},"scope":{"type":"string","description":"Scope this subscription applies to","example":"GET:company.openapi.com/resource"},"domain":{"type":"string","description":"API domain for this subscription","example":"company.openapi.com"},"active":{"type":"boolean","description":"Whether the subscription is currently active","example":true},"startsAt":{"type":"string","format":"date-time","description":"Subscription start date","example":"2025-11-01T00:00:00+00:00"},"expiresAt":{"type":"string","format":"date-time","description":"Subscription expiration date","example":"2025-12-01T00:00:00+00:00"},"totalRequests":{"type":"string","description":"Total number of requests originally included in this subscription","example":"1000"},"availableRequests":{"type":"string","description":"Number of requests still available in this subscription","example":"950"},"pricePerRequest":{"type":"number","description":"Price per request for this subscription","example":0.01},"type":{"type":"string","description":"Subscription type (e.g., month, year)","example":"month"},"autorenew":{"type":"boolean","description":"Whether the subscription will automatically renew","example":true},"createdAt":{"type":"string","format":"date-time","description":"Subscription creation date","example":"2025-10-25T10:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date","example":"2025-11-19T15:30:00+00:00"},"price":{"type":"number","description":"Total price of the subscription","example":10}}}}},"externalDocs":{"description":"First time here? Generate a new access token","url":"https://console.openapi.com/oauth"}}