Templates

Embed
Preview of the card
<a href="https://restorehub.net/docs/templates"><img src="https://restorehub.net/docs/_api/public/orgs/02205afa-581f-4b8b-b2a5-8aa1a06b0a65/spaces/3b58c1c8-7c23-44ef-9ff3-f4a5c899d9ac/pages/7b00189e-8ab4-499f-b11c-d86bf13d75ab/social-card.svg?v=3e7ae33eec8b" alt="Templates" width="600" height="315"></a>
GEThttps://api.restorehub.net/api/v1/templates

List your templates

Required scope: templates:read

Code samples

cURL
curl -X GET "https://api.restorehub.net/api/v1/templates" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed
Example
{
  "error": "string",
  "code": "string",
  "details": {},
  "requiredScope": "string",
  "yourScopes": [
    "string"
  ]
}
Schema
errorstring
Human-readable error message
codestring
Machine-readable error code (optional)
detailsobject
Validation issues (optional)
requiredScopestring
Required scope (on 403 only)
yourScopesstring[]
Your key's scopes (on 403 only)
401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

POSThttps://api.restorehub.net/api/v1/templates

Create a template

Required scope: templates:write

Request body

application/json
namestringrequired
descriptionstring
dataobjectrequired
Template body (channels, roles, ...)
isPublicboolean
{
  "name": "string",
  "description": "string",
  "data": {},
  "isPublic": true
}

Code samples

cURL
curl -X POST "https://api.restorehub.net/api/v1/templates" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","data":{},"isPublic":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

POSThttps://api.restorehub.net/api/v1/templates/from-backup

Create a template from an existing backup

Required scope: templates:write

Request body

application/json
backupIdstringrequired
namestringrequired
descriptionstring
isPublicboolean
{
  "backupId": "string",
  "name": "string",
  "description": "string",
  "isPublic": true
}

Code samples

cURL
curl -X POST "https://api.restorehub.net/api/v1/templates/from-backup" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"backupId":"string","name":"string","description":"string","isPublic":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

GEThttps://api.restorehub.net/api/v1/templates/{id}

Get a template

Required scope: templates:read

Parameters

idstringpathrequired

Code samples

cURL
curl -X GET "https://api.restorehub.net/api/v1/templates/{id}" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

PUThttps://api.restorehub.net/api/v1/templates/{id}

Update a template

Required scope: templates:write

Parameters

idstringpathrequired

Request body

application/json
namestring
descriptionstring
dataobject
isPublicboolean
{
  "name": "string",
  "description": "string",
  "data": {},
  "isPublic": true
}

Code samples

cURL
curl -X PUT "https://api.restorehub.net/api/v1/templates/{id}" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","data":{},"isPublic":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

DELETEhttps://api.restorehub.net/api/v1/templates/{id}

Delete a template

Required scope: templates:write

Parameters

idstringpathrequired

Code samples

cURL
curl -X DELETE "https://api.restorehub.net/api/v1/templates/{id}" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

POSThttps://api.restorehub.net/api/v1/servers/{id}/apply-template

Apply a template to a server

Required scope: templates:apply

Parameters

idstringpathrequired

Request body

application/json
templateIdstringrequired
optionsobject
{
  "templateId": "string",
  "options": {}
}

Code samples

cURL
curl -X POST "https://api.restorehub.net/api/v1/servers/{id}/apply-template" \
  -H "Authorization: Bearer $RESTOREHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"templateId":"string","options":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
{}
400 Validation failed

Same as 400 · GET /api/v1/templates

401 Unauthorized — missing or invalid API key

Same as 400 · GET /api/v1/templates

403 Forbidden — missing required scope

Same as 400 · GET /api/v1/templates

404 Not found

Same as 400 · GET /api/v1/templates

429 Rate limit exceeded

Same as 400 · GET /api/v1/templates

Updated