{"openapi":"3.0.0","info":{"title":"Openapi OAuth Service","version":"2.1.0","description":"API di gestione OAuth completa che consente agli sviluppatori di creare, gestire e monitorare i token OAuth con autorizzazioni granulari basate sullo scope. Le funzionalità includono la gestione del ciclo di vita dei token, il monitoraggio delle statistiche di utilizzo, la fatturazione basata su wallet, la gestione degli abbonamenti, il monitoraggio dei callback e l'analisi dettagliata su più domini API.","contact":{"url":"https://openapi.it/en/support","name":"Support"},"termsOfService":"https://openapi.it/en/terms-and-conditions"},"servers":[{"url":"https://oauth.openapi.com","description":"Produzione"},{"url":"https://test.oauth.openapi.com","description":"Sandbox"}],"tags":[{"name":"Tokens","description":"Operazioni relative ai token OAuth"},{"name":"Scopes","description":"Operazioni relative agli scope di OAuth"},{"name":"Callbacks","description":"Operazioni relative ai callback OAuth"},{"name":"Errors","description":"Operazioni relative agli errori API"},{"name":"Wallet","description":"Operazioni relative al wallet associato ai token"},{"name":"Stats","description":"Operazioni relative alle statistiche di utilizzo dell'API"},{"name":"Subscriptions","description":"Operazioni relative agli abbonamenti"}],"paths":{"/tokens":{"post":{"summary":"Creare un nuovo token","tags":["Tokens"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreate"}}}},"responses":{"200":{"description":"Gettone creato","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"422":{"description":"Errore di convalida","content":{"application/json":{"examples":{"missing_scopes":{"summary":"array di scope mancanti","value":{"success":false,"message":"missing scopes array","error":70,"data":null}},"invalid_scopes_format":{"summary":"formato scope non valido","value":{"success":false,"message":"invalid scopes format","error":80,"data":null}},"invalid_scopes":{"summary":"Scopi non validi specificati o API non abilitata","value":{"success":false,"message":"Invalid scopes specified or API not enabled","error":90,"data":null}}}}}}},"security":[{"Basic-Authentication":[]}]},"get":{"summary":"Dettaglio elenco o token","tags":["Tokens"],"parameters":[{"name":"limit","in":"query","description":"Numero massimo di gettoni da restituire (default 100, max 100)","required":false,"schema":{"type":"integer","default":100,"maximum":100}},{"name":"skip","in":"query","description":"Numero di token da saltare per la paginazione (valore predefinito 0)","required":false,"schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Dettaglio elenco o token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenListOrDetail"}}}},"404":{"description":"Token non trovato","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":120,"data":null}}}},"422":{"description":"Errore di convalida","content":{"application/json":{"example":{"success":false,"message":"Invalid Token Format","error":60,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/scopes":{"get":{"summary":"Elenco degli scope disponibili","tags":["Scopes"],"responses":{"200":{"description":"Elenco degli scope","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserScope"}}}}}}}},"security":[{"Basic-Authentication":[]}]}},"/tokens/{token}":{"get":{"summary":"Ottenere il token per ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Identificatore del token"}],"responses":{"200":{"description":"Dettaglio gettone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"404":{"description":"Token non trovato","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":120,"data":null}}}},"422":{"description":"Errore di convalida","content":{"application/json":{"example":{"success":false,"message":"Invalid Token Format","error":60,"data":null}}}}},"security":[{"Basic-Authentication":[]}]},"patch":{"summary":"Aggiornare il token per ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Identificatore del token"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUpdate"}}}},"responses":{"200":{"description":"Gettone aggiornato","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDetail"}}}},"400":{"description":"Bad Request","content":{"application/json":{"examples":{"token_id_required":{"summary":"L'ID del token è necessario","value":{"success":false,"message":"Token ID is required","error":150,"data":null}}}}}},"401":{"description":"Non autorizzato","content":{"application/json":{"examples":{"unauthorized_refresh":{"summary":"Non autorizzato","value":{"success":false,"message":"Unauthorized","error":130,"data":null}},"unauthorized_authdata":{"summary":"Non autorizzato","value":{"success":false,"message":"Unauthorized","error":140,"data":null}}}}}},"404":{"description":"Token non trovato","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":160,"data":null}}}},"422":{"description":"Errore di convalida","content":{"application/json":{"examples":{"invalid_scopes_format":{"summary":"formato scope non valido","value":{"success":false,"message":"invalid scopes format","error":100,"data":null}},"invalid_scopes":{"summary":"Scopi non validi specificati o API non abilitata","value":{"success":false,"message":"Invalid scopes specified or API not enabled","error":110,"data":null}}}}}}},"security":[{"Basic-Authentication":[]},{"Refresh-Authentication":[]}]},"delete":{"summary":"Eliminare il token per ID","tags":["Tokens"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Identificatore del token"}],"responses":{"200":{"description":"Token cancellato con successo","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 non trovato","content":{"application/json":{"example":{"success":false,"message":"Not Found","error":180,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/errors":{"get":{"summary":"Elenco dei registri degli errori","tags":["Errors"],"parameters":[{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Elenco separato da virgole di scope per filtrare gli errori"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Numero di errori da saltare per la paginazione"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Numero massimo di errori da restituire"}],"responses":{"200":{"description":"Elenco dei log degli errori","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":"Errore di interrogazione","content":{"application/json":{"example":{"success":false,"message":"Query error","error":190,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/wallet":{"get":{"summary":"Ottenere informazioni sul wallet","tags":["Wallet"],"responses":{"200":{"description":"Informazioni sul wallet","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":"Elencare i callback o ottenere un callback per ID","tags":["Callbacks"],"parameters":[{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Elenco separato da virgole di scope per filtrare i callback"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Numero di callback da saltare per la paginazione"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Numero massimo di callback da restituire"}],"responses":{"200":{"description":"Info sui callback","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/CallbackListElement"}},{"$ref":"#/components/schemas/Callback"}]}}},"examples":{"list":{"summary":"Elenco dei callback","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":"Dettaglio del richiamo singolo","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":"Errore di interrogazione","content":{"application/json":{"example":{"success":false,"message":"Query error","error":210,"data":null}}}},"404":{"description":"Callback non trovato","content":{"application/json":{"example":{"success":false,"message":"Callback not found","error":200,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/stats":{"get":{"summary":"Ottenere statistiche complessive sull'utilizzo dell'API","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Filtro data"}],"responses":{"200":{"description":"Informazioni sulle statistiche complessive","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Numero totale di richieste"},"walletRequests":{"type":"number","description":"Numero di richieste di wallet a pagamento"},"subscriptionRequests":{"type":"number","description":"Numero di richieste di abbonamento"},"errorRequests":{"type":"number","description":"Numero di richieste di errore"},"walletAmount":{"type":"number","description":"Importo totale speso tramite wallet"},"totalIps":{"type":"integer","description":"Numero totale di indirizzi IP unici"},"totalApis":{"type":"integer","description":"Numero totale di API utilizzate"}}}}},"example":{"data":{"totalRequests":1500,"walletRequests":800,"subscriptionRequests":700,"errorRequests":12,"walletAmount":125.5,"totalIps":45,"totalApis":8}}}}},"422":{"description":"Formato della data non valido","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":"Ottenere l'elenco degli indirizzi IP unici","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Filtro data (AAAA o AAAA-MM o AAAA-MM-GG)"}],"responses":{"200":{"description":"Array di indirizzi IP univoci","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":"Formato della data non valido","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":"Ottenere statistiche raggruppate per dominio API","tags":["Stats"],"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Filtro data (AAAA o AAAA-MM o AAAA-MM-GG)"}],"responses":{"200":{"description":"Statistiche raggruppate per dominio API","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Oggetto in cui ogni chiave è un dominio API e il valore contiene statistiche per quel dominio","additionalProperties":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Numero totale di richieste per questo dominio"},"walletRequests":{"type":"number","description":"Numero di richieste di wallet a pagamento per questo dominio"},"subscriptionRequests":{"type":"number","description":"Numero di richieste di abbonamento per questo dominio"},"errorRequests":{"type":"number","description":"Numero di richieste di errore per questo dominio"},"walletAmount":{"type":"number","description":"Importo totale speso tramite wallet per questo dominio"},"totalIps":{"type":"integer","description":"Numero di indirizzi IP unici per questo dominio"},"totalScopes":{"type":"integer","description":"Numero di scope per questo dominio"}}}}}},"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":"Formato della data non valido","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":"Ottenere statistiche dettagliate per uno specifico dominio API, compresa la ripartizione degli scope","tags":["Stats"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"description":"Nome del dominio API","example":"company.openapi.com"},{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Filtro data (AAAA o AAAA-MM o AAAA-MM-GG)"}],"responses":{"200":{"description":"Statistiche specifiche del dominio con ripartizione degli scope","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalRequests":{"type":"number","description":"Numero totale di richieste per questo dominio"},"walletRequests":{"type":"number","description":"Numero di richieste di wallet a pagamento per questo dominio"},"subscriptionRequests":{"type":"number","description":"Numero di richieste di abbonamento per questo dominio"},"errorRequests":{"type":"number","description":"Numero di richieste di errore per questo dominio"},"walletAmount":{"type":"number","description":"Importo totale speso tramite wallet per questo dominio"},"ip":{"type":"array","description":"Array di indirizzi IP unici per questo dominio","items":{"type":"string"}},"totalIps":{"type":"integer","description":"Numero di indirizzi IP unici per questo dominio"},"totalScopes":{"type":"integer","description":"Numero di scope per questo dominio"},"scopes":{"type":"object","description":"Oggetto in cui ogni chiave è un identificatore di scope e il valore contiene statistiche per quello 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":"Formato della data non valido","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":"Elencare le sottoscrizioni o ottenere le sottoscrizioni per ID","tags":["Subscriptions"],"parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string"},"description":"ID abbonamento per recuperare un abbonamento specifico"},{"name":"scopes","in":"query","required":false,"schema":{"type":"string"},"description":"Elenco separato da virgole degli scope per filtrare le sottoscrizioni"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Numero di abbonamenti da saltare per la paginazione"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Numero massimo di abbonamenti da restituire"}],"responses":{"200":{"description":"Informazioni sugli abbonamenti","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionListElement"}},{"$ref":"#/components/schemas/Subscription"}]}}},"examples":{"list":{"summary":"Elenco degli abbonamenti","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":"Dettaglio abbonamento singolo","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":"Errore di interrogazione","content":{"application/json":{"example":{"success":false,"message":"Query error","error":230,"data":null}}}},"404":{"description":"Abbonamento non trovato","content":{"application/json":{"example":{"success":false,"message":"Subscription not found","error":220,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/scopes/{id}":{"get":{"summary":"Ottenere lo scope per ID","tags":["Scopes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"ID scope"}],"responses":{"200":{"description":"Dettaglio dello scope","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":"Scopes non trovato","content":{"application/json":{"example":{"success":false,"message":"Scope not found","error":10,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/callbacks/{id}":{"get":{"summary":"Ottenere il callback per ID","tags":["Callbacks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"ID callback"}],"responses":{"200":{"description":"Dettaglio della richiamata","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 non trovato","content":{"application/json":{"example":{"success":false,"message":"Callback not found","error":200,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}},"/wallet/transactions":{"get":{"summary":"Ottenere la cronologia delle transazioni del wallet","tags":["Wallet"],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Numero di transazioni da saltare per la paginazione"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Numero massimo di transazioni da restituire"}],"responses":{"200":{"description":"Elenco delle transazioni del wallet","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":"Utilizzo dell'API - company.openapi.com"},{"id":"txn_65a1b2c3d4e5f6789abc002","amount":100,"createdAt":"2026-02-10T14:15:00+00:00","description":"Ricarica del wallet"},{"id":"txn_65a1b2c3d4e5f6789abc003","amount":-5.25,"createdAt":"2026-02-09T11:20:00+00:00","description":"Utilizzo dell'API - sms.openapi.com"}]}}}}},"security":[{"Basic-Authentication":[]}]}},"/subscriptions/{id}":{"get":{"summary":"Ottenere l'abbonamento per ID","tags":["Subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"ID abbonamento"}],"responses":{"200":{"description":"Dettaglio abbonamento","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":"Abbonamento non trovato","content":{"application/json":{"example":{"success":false,"message":"Subscription not found","error":220,"data":null}}}}},"security":[{"Basic-Authentication":[]}]}}},"components":{"securitySchemes":{"Basic-Authentication":{"description":"Autenticazione di base con EMAIL e APIKEY. Utilizzare la chiave API come password e l'e-mail associata alla chiave API come nome utente nell'intestazione Authorization.","name":"Authorization","type":"http","scheme":"basic"},"Refresh-Authentication":{"description":"Autenticazione con token portatore. Usare un token di aggiornamento come token del portatore nell'intestazione Authorization solo per l'endpoint PATCH /tokens/{id} per aggiornare un token usando il suo token di aggiornamento invece del token di accesso.","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":"Identificatore univoco del token","example":"656d1e2f8b3c2a001f7e4a12"},"name":{"type":"string","description":"Nome del token leggibile dall'uomo","example":"Service X API token"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp di creazione","example":"2025-11-19T10:00:00Z"},"expireAt":{"type":"string","format":"date-time","description":"Data di scadenza","example":"2025-12-19T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp dell'ultimo aggiornamento","example":"2025-11-20T09:00:00Z"},"scopes":{"type":"array","items":{"type":"string"},"description":"Scopi associati","example":["GET:api.openapi.com/resource"]},"refreshToken":{"type":"string","description":"Token di aggiornamento associato. Viene usato per estendere il TTL del token","example":"656d1e2f8b3c2a001f7e4a13"},"limits":{"$ref":"#/components/schemas/TokenLimits"},"stats":{"$ref":"#/components/schemas/TokenStats"}}},"TokenCreate":{"type":"object","description":"Dati per creare un nuovo token","properties":{"scopes":{"type":"array","description":"Elenco degli scope richiesti","items":{"type":"string","example":"GET:api.openapi.com/resource"},"example":["GET:api.openapi.com/resource","POST:other.openapi.com/other"]},"name":{"type":"string","description":"Nome del token leggibile dall'uomo","example":"Service X API token"},"ttl":{"type":"integer","description":"Durata del token in secondi. Massimo 1 anno. Se viene fornito un valore negativo o 0, il valore viene automaticamente fissato al TTL predefinito.","example":2592000},"limits":{"$ref":"#/components/schemas/TokenLimits"}},"required":["scopes"]},"TokenUpdate":{"type":"object","description":"Dati per aggiornare un token esistente. L'autenticazione può utilizzare un token di accesso Bearer o, in alternativa, un token di aggiornamento passato come token Bearer nell'intestazione Authorization. Quando si utilizza un token di aggiornamento, vengono restituiti un nuovo token e un nuovo token di aggiornamento con gli stessi scope e il token precedente viene cancellato.","properties":{"scopes":{"type":"array","description":"Nuovo elenco di 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":"Nome del nuovo token","example":"Updated token"},"ttl":{"type":"integer","description":"Nuova vita in pochi secondi","example":604800},"limits":{"$ref":"#/components/schemas/TokenLimits"}}},"TokenLimits":{"type":"object","description":"Limiti di utilizzo associati al token","properties":{"totalRequests":{"type":"integer","description":"Numero massimo di richieste totali consentite","example":10000},"walletRequests":{"type":"integer","description":"Numero massimo di richieste di wallet a pagamento consentite","example":1000},"subscriptionRequests":{"type":"integer","description":"Numero massimo di richieste di sottoscrizione consentite","example":500},"walletAmount":{"type":"number","description":"Importo massimo utilizzabile dal wallet associato","example":50},"ip":{"type":"array","description":"Elenco degli indirizzi IP consentiti","items":{"type":"string","example":"192.168.1.1"},"example":["192.168.1.1","10.0.0.2"]}}},"TokenStats":{"type":"object","description":"Statistiche d'uso del token","properties":{"totalRequests":{"type":"integer","description":"Numero totale di richieste effettuate","example":1234},"walletRequests":{"type":"integer","description":"Numero di richieste di wallet a pagamento effettuate","example":120},"subscriptionRequests":{"type":"integer","description":"Numero di richieste di abbonamento effettuate","example":30},"errorRequests":{"type":"integer","description":"Numero di richieste che hanno dato luogo a un errore","example":5},"walletAmount":{"type":"number","description":"Importo totale speso tramite wallet","example":12.5},"ip":{"type":"array","description":"Elenco degli indirizzi IP utilizzati","items":{"type":"string","example":"192.168.1.1"},"example":["192.168.1.1","10.0.0.2"]}}},"UserScope":{"type":"object","description":"Informazioni di base sull'ambito disponibili nella vista elenco","properties":{"id":{"type":"string","description":"Identificatore univoco dello scope","example":"656d1e2f8b3c2a001f7e4a14"},"scope":{"type":"string","description":"Nome dello scope","example":"GET:api.openapi.com/resource"},"method":{"type":"string","description":"Metodo HTTP","example":"GET"},"endpoint":{"type":"string","description":"Punto finale associato","example":"resource"},"domain":{"type":"string","description":"Dominio associato","example":"api.openapi.com"},"enabled":{"type":"boolean","description":"Se l'ambito è abilitato per l'utente autenticato","example":true}}},"ScopeDetail":{"type":"object","description":"Informazioni dettagliate sull'ambito di applicazione, compresi limiti, requisiti e prezzi","allOf":[{"$ref":"#/components/schemas/UserScope"},{"type":"object","properties":{"rateLimit":{"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Limite di velocità per questo scope, o false se non c'è un limite","example":false},"freeLimits":{"$ref":"#/components/schemas/ScopeLimits"},"requirements":{"type":"object","description":"Requisiti per questo scope con il relativo stato di adempimento","additionalProperties":{"type":"boolean"},"example":{"id_card":false,"oa_general_contract":false}},"prices":{"type":"object","description":"Informazioni sui prezzi di questo scope per chiave di prezzo","additionalProperties":{"type":"number"},"example":{"ch-start":0.06}}}}]},"ScopeLimits":{"type":"object","description":"Limiti di utilizzo gratuiti per uno scope","properties":{"dayLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Limite di richiesta giornaliero, o false se non c'è limite","example":0},"monthLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Limite mensile di richieste, o false se non c'è limite","example":false},"yearLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Limite di richiesta annuale, o false se non c'è limite","example":false},"totalLimit":{"oneOf":[{"type":"integer"},{"type":"boolean"}],"description":"Limite totale di richieste (durata), o false se non c'è limite","example":false}}},"ErrorLog":{"type":"object","description":"Voce del registro degli errori","properties":{"id":{"type":"string","description":"Identificatore univoco del registro degli errori","example":"69822d1d48be79971b04351a"},"scope":{"type":"string","description":"Lo scope che ha causato l'errore","example":"DELETE:oauth.openapi.com/tokens"},"domain":{"type":"string","description":"Dominio API in cui si è verificato l'errore","example":"oauth.openapi.com"},"errorAt":{"type":"string","format":"date-time","description":"Timestamp del momento in cui si è verificato l'errore","example":"2026-02-03T17:15:09+00:00"},"httpResponseCode":{"type":"integer","description":"Codice di stato della risposta HTTP","example":404},"errorCode":{"type":"number","description":"Codice di errore interno","example":131},"message":{"type":"string","description":"Messaggio di errore","example":"Not Found"},"ip":{"type":"string","description":"Indirizzo IP che ha generato l'errore","example":"93.146.69.125"}}},"Wallet":{"type":"object","description":"Informazioni sul wallet","properties":{"credit":{"type":"number","description":"Saldo corrente del credito wallet","example":125.5},"createdAt":{"type":"string","format":"date-time","description":"Data di creazione del wallet","example":"2025-01-15T10:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Data dell'ultimo aggiornamento del wallet","example":"2026-02-12T08:30:00+00:00"}}},"WalletTransaction":{"type":"object","description":"Inserimento della transazione wallet","properties":{"id":{"type":"string","description":"Identificatore univoco della transazione","example":"txn_65a1b2c3d4e5f6789abc001"},"amount":{"type":"number","description":"Importo della transazione (negativo per le spese, positivo per i crediti)","example":-15.5},"createdAt":{"type":"string","format":"date-time","description":"Timestamp della transazione","example":"2026-02-12T08:30:00+00:00"},"description":{"type":"string","description":"Descrizione della transazione","example":"API usage - company.openapi.com"}}},"CallbackListElement":{"type":"object","description":"Informazioni di callback semplificate per la vista elenco","properties":{"id":{"type":"string","description":"Identificatore univoco del callback","example":"65a1b2c3d4e5f6789abcdef0"},"scope":{"type":"string","description":"Scopes che ha generato questo callback","example":"POST:company.openapi.com/webhook"},"url":{"type":"string","description":"URL di destinazione del callback","example":"https://example.com/callback"},"httpResponseCode":{"type":"string","description":"Codice di risposta HTTP ricevuto dall'URL di callback","example":"200"},"startedAt":{"type":"string","format":"date-time","description":"Ora di inizio dell'esecuzione del callback","example":"2026-02-12T10:00:00+00:00"},"completedAt":{"type":"string","format":"date-time","description":"Tempo di completamento dell'esecuzione della callback (null se ancora attiva)","example":"2026-02-12T10:00:05+00:00","nullable":true}}},"Callback":{"type":"object","description":"Informazioni complete sul richiamo","properties":{"id":{"type":"string","description":"Identificatore univoco del callback","example":"65a1b2c3d4e5f6789abcdef0"},"scope":{"type":"string","description":"Scopes che ha generato questo callback","example":"POST:company.openapi.com/webhook"},"domain":{"type":"string","description":"Dominio API per questo callback","example":"company.openapi.com","nullable":true},"active":{"type":"boolean","description":"Se il callback è ancora attivo (non completato)","example":false},"startedAt":{"type":"string","format":"date-time","description":"Ora di inizio dell'esecuzione del callback","example":"2026-02-12T10:00:00+00:00"},"createdAt":{"type":"string","format":"date-time","description":"Tempo di creazione della callback","example":"2026-02-12T09:59:55+00:00"},"completedAt":{"type":"string","format":"date-time","description":"Tempo di completamento dell'esecuzione della callback","example":"2026-02-12T10:00:05+00:00","nullable":true},"httpResponseCode":{"type":"integer","description":"Codice di risposta HTTP ricevuto dall'URL di callback","example":200},"data":{"type":"object","description":"Dati del payload di callback","example":{"event":"user.created","userId":"12345"}},"custom":{"description":"Dati personalizzati associati al callback","example":{"trackingId":"abc-123"}},"headers":{"type":"object","description":"Intestazioni HTTP inviate con il callback","example":{"Content-Type":"application/json","X-Webhook-Signature":"sha256=..."}},"elapsedTime":{"type":"integer","description":"Tempo di esecuzione della callback in millisecondi","example":5234},"attempt":{"type":"integer","description":"Numero di tentativo attuale","example":1},"retry":{"type":"integer","description":"Numero di tentativi eseguiti","example":0},"field":{"type":"string","description":"Identificatore del campo per il callback","example":"webhookUrl"},"method":{"type":"string","description":"Metodo HTTP utilizzato per il callback","example":"POST"},"url":{"type":"string","description":"URL di destinazione del callback","example":"https://example.com/callback"}}},"SubscriptionListElement":{"type":"object","description":"Informazioni sull'abbonamento semplificate per la visualizzazione dell'elenco","properties":{"id":{"type":"string","description":"Identificatore univoco dell'abbonamento","example":"656d1e2f8b3c2a001f7e4a20"},"scope":{"type":"string","description":"Ambito di applicazione Questo abbonamento si applica a","example":"GET:company.openapi.com/resource"},"active":{"type":"boolean","description":"Se l'abbonamento è attualmente attivo","example":true},"availableRequests":{"type":"string","description":"Numero di richieste disponibili in questo abbonamento","example":"950"},"startsAt":{"type":"string","format":"date-time","description":"Data di inizio dell'abbonamento","example":"2025-11-01T00:00:00+00:00"},"expiresAt":{"type":"string","format":"date-time","description":"Data di scadenza dell'abbonamento","example":"2025-12-01T00:00:00+00:00"}}},"Subscription":{"type":"object","description":"Informazioni complete sull'abbonamento","properties":{"id":{"type":"string","description":"Identificatore univoco dell'abbonamento","example":"656d1e2f8b3c2a001f7e4a20"},"scope":{"type":"string","description":"Ambito di applicazione Questo abbonamento si applica a","example":"GET:company.openapi.com/resource"},"domain":{"type":"string","description":"Dominio API per questo abbonamento","example":"company.openapi.com"},"active":{"type":"boolean","description":"Se l'abbonamento è attualmente attivo","example":true},"startsAt":{"type":"string","format":"date-time","description":"Data di inizio dell'abbonamento","example":"2025-11-01T00:00:00+00:00"},"expiresAt":{"type":"string","format":"date-time","description":"Data di scadenza dell'abbonamento","example":"2025-12-01T00:00:00+00:00"},"totalRequests":{"type":"string","description":"Numero totale di richieste originariamente incluse in questo abbonamento","example":"1000"},"availableRequests":{"type":"string","description":"Numero di richieste ancora disponibili in questo abbonamento","example":"950"},"pricePerRequest":{"type":"number","description":"Prezzo per richiesta per questo abbonamento","example":0.01},"type":{"type":"string","description":"Tipo di abbonamento (ad esempio, mese, anno)","example":"month"},"autorenew":{"type":"boolean","description":"Se l'abbonamento si rinnova automaticamente","example":true},"createdAt":{"type":"string","format":"date-time","description":"Data di creazione dell'abbonamento","example":"2025-10-25T10:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Data dell'ultimo aggiornamento","example":"2025-11-19T15:30:00+00:00"},"price":{"type":"number","description":"Prezzo totale dell'abbonamento","example":10}}}}},"externalDocs":{"description":"Prima volta qui? Generare un nuovo token di accesso","url":"https://console.openapi.com/it/oauth"}}