Restore Hub API
Public
GET
https://api.restorehub.net /api/v1/openapi.json Get this OpenAPI spec
Public — no authentication required.
Code samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/openapi.json"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}GET
https://api.restorehub.net /api/v1/public/templates List public marketplace templates
Public — no authentication required.
Parameters
pageintegerquerylimitintegerquerycategorystringqueryCode samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/public/templates"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}GET
https://api.restorehub.net /api/v1/public/templates/{id} Get a public template
Public — no authentication required.
Parameters
idstringpathrequiredCode samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/public/templates/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}Widget
GET
https://api.restorehub.net /api/v1/.well-known/jwks.json Get the JWKS used to sign widget JWTs (RS256, public)
Public — no authentication required.
Code samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/.well-known/jwks.json"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 JWKS document
{
"keys": [
{
"kty": "RSA",
"kid": "string",
"alg": "RS256",
"use": "sig",
"n": "string",
"e": "string"
}
]
}POST
https://api.restorehub.net /api/v1/widget/verify-token Verify a widget JWT and return the decoded Discord identity
Public — no authentication required.
Request body
application/json
tokenstringrequiredWidget JWT issued via the verification popup
{
"token": "string"
}Code samples
cURL
curl -X POST "https://api.restorehub.net/api/v1/widget/verify-token" \
-H "Content-Type: application/json" \
-d '{"token":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Decoded payload
{
"valid": true,
"user": {
"id": "string",
"username": "string",
"avatar": null,
"globalName": null,
"discriminator": null,
"banner": null,
"accentColor": null,
"locale": null,
"mfaEnabled": null,
"premiumType": null,
"publicFlags": null,
"email": null,
"emailVerified": null,
"phoneVerified": null,
"accountCreatedAt": null
},
"serverId": "string",
"discordGuildId": "string",
"issuedAt": "2024-01-01T00:00:00Z",
"expiresAt": "2024-01-01T00:00:00Z"
}400 Invalid request body
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Invalid or expired token
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit (100/min per IP)
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}POST
https://api.restorehub.net /api/v1/widget/access-token Trade a widget JWT for the verified member's Discord OAuth access_token + refresh_token. Requires the server owner to enable 'Share Discord OAuth tokens with widget integrators' in dashboard widget settings.
Public — no authentication required.
Request body
application/json
tokenstringrequiredWidget JWT issued via the verification popup (same shape as /widget/verify-token expects).
{
"token": "string"
}Code samples
cURL
curl -X POST "https://api.restorehub.net/api/v1/widget/access-token" \
-H "Content-Type: application/json" \
-d '{"token":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Discord OAuth tokens for the verified member
{
"accessToken": "string",
"refreshToken": "string",
"expiresAt": "2024-01-01T00:00:00Z",
"discordUserId": "string",
"serverId": "string",
"tokenType": "string"
}400 Invalid request body
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Invalid or expired widget JWT
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Server owner has not enabled OAuth-token sharing. Error code ACCESS_TOKEN_SHARE_DISABLED. The owner must flip the toggle in Dashboard → Widget → 'Share Discord OAuth tokens'.
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Server or verified member record not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit (60/min per IP)
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}500 Decrypt failed — member may need to re-verify
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}POST
https://api.restorehub.net /api/v1/widget/refresh-token Refresh an expired Discord access_token using a refresh_token previously obtained from /widget/access-token. Proxies through Discord's /oauth2/token endpoint using the server's OAuth credentials (which the integrator doesn't have). Requires scopeAccessTokenShare.
Public — no authentication required.
Request body
application/json
refreshTokenstringrequiredThe refresh_token previously returned by /widget/access-token.
serverIdstringrequiredRestoreHub server ID (UUID) the refresh_token belongs to.
{
"refreshToken": "string",
"serverId": "string"
}Code samples
cURL
curl -X POST "https://api.restorehub.net/api/v1/widget/refresh-token" \
-H "Content-Type: application/json" \
-d '{"refreshToken":"string","serverId":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 New Discord OAuth tokens
{
"accessToken": "string",
"refreshToken": "string",
"expiresAt": "2024-01-01T00:00:00Z",
"scope": null,
"serverId": "string",
"tokenType": "string"
}400 Invalid request body
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Discord rejected the refresh. Error code REFRESH_TOKEN_INVALID — the token may have been revoked, expired, or already used (Discord rotates).
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 scopeAccessTokenShare not enabled on this server
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Server or bot not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit (60/min per IP)
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}500 Internal decrypt failure
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}502 Could not reach Discord
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}GET
https://api.restorehub.net /api/v1/servers/{id}/widget/domain-connect-url Build a 1-click Domain Connect apply URL for the requested domain. Returns { supported:false } if the domain's DNS provider does not support Domain Connect — the manual TXT flow remains available.
Required scope: widget:write
Parameters
idstringpathrequiredCode samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/servers/{id}/widget/domain-connect-url"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}Account
GET
https://api.restorehub.net /api/v1/account Get the authenticated account
Required scope: account:read
Code samples
cURL
curl -X GET "https://api.restorehub.net/api/v1/account"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}PUT
https://api.restorehub.net /api/v1/account Update account profile + notification preferences
Required scope: account:write
Request body
application/json
displayNamestringlocalestringnotifyAccountChangesbooleannotifyVerifyLogsbooleannotifyTeamInvitesbooleannotifyUpgradesbooleannotifyMemberPullsbooleannotifyBackupsboolean{
"displayName": "string",
"locale": "en",
"notifyAccountChanges": true,
"notifyVerifyLogs": true,
"notifyTeamInvites": true,
"notifyUpgrades": true,
"notifyMemberPulls": true,
"notifyBackups": true
}Code samples
cURL
curl -X PUT "https://api.restorehub.net/api/v1/account" \
-H "Content-Type: application/json" \
-d '{"displayName":"string","locale":"en","notifyAccountChanges":true,"notifyVerifyLogs":true,"notifyTeamInvites":true,"notifyUpgrades":true,"notifyMemberPulls":true,"notifyBackups":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}DELETE
https://api.restorehub.net /api/v1/account Delete the authenticated account (requires '*' scope)
Required scope: account:delete
Request body
application/json
passwordstringrequiredCurrent account password
mfaCodestringRequired if MFA is enabled (6 digits)
confirmstringrequired{
"password": "string",
"mfaCode": "string",
"confirm": "delete-my-account"
}Code samples
cURL
curl -X DELETE "https://api.restorehub.net/api/v1/account" \
-H "Content-Type: application/json" \
-d '{"password":"string","mfaCode":"string","confirm":"delete-my-account"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
{}400 Validation failed
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}401 Unauthorized — missing or invalid API key
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}403 Forbidden — missing required scope
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}404 Not found
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}429 Rate limit exceeded
{
"error": "string",
"code": "string",
"details": {},
"requiredScope": "string",
"yourScopes": [
"string"
]
}Updated