Create a plan
config holds the settings of the plan's type. storages lists where backups are uploaded, in order of priority (1 first). The answer carries the plan with its server, schedule, compression profile and storages.
/api/v1/plans
curl -X POST 'https://app.clokeep.com/api/v1/plans' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"server_id": 12,
"plan_template_id": 1,
"name": "Nightly files",
"type": "files",
"schedule_id": 7,
"compression_profile_id": 2,
"enabled": true,
"config": {
"backup_path_ids": [
5
],
"incremental": true,
"full_every": 7,
"archive_per_path": false,
"dedup_disabled": false
},
"retention_days": 30,
"retention_count": 7,
"storages": [
{
"storage_id": 3,
"priority": 1,
"path_prefix": "web-01/nightly-files"
}
]
}'<?php
$ch = curl_init('https://app.clokeep.com/api/v1/plans');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'server_id' => 12,
'plan_template_id' => 1,
'name' => 'Nightly files',
'type' => 'files',
'schedule_id' => 7,
'compression_profile_id' => 2,
'enabled' => true,
'config' => [
'backup_path_ids' => [
5,
],
'incremental' => true,
'full_every' => 7,
'archive_per_path' => false,
'dedup_disabled' => false,
],
'retention_days' => 30,
'retention_count' => 7,
'storages' => [
[
'storage_id' => 3,
'priority' => 1,
'path_prefix' => 'web-01/nightly-files',
],
],
]),
]);
$response = curl_exec($ch);
echo $response;
const response = await fetch("https://app.clokeep.com/api/v1/plans", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"server_id": 12,
"plan_template_id": 1,
"name": "Nightly files",
"type": "files",
"schedule_id": 7,
"compression_profile_id": 2,
"enabled": true,
"config": {
"backup_path_ids": [
5,
],
"incremental": true,
"full_every": 7,
"archive_per_path": false,
"dedup_disabled": false,
},
"retention_days": 30,
"retention_count": 7,
"storages": [
{
"storage_id": 3,
"priority": 1,
"path_prefix": "web-01/nightly-files",
},
],
}),
});
console.log(await response.text());
import requests
response = requests.post(
"https://app.clokeep.com/api/v1/plans",
headers={
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"server_id": 12,
"plan_template_id": 1,
"name": "Nightly files",
"type": "files",
"schedule_id": 7,
"compression_profile_id": 2,
"enabled": True,
"config": {
"backup_path_ids": [
5,
],
"incremental": True,
"full_every": 7,
"archive_per_path": False,
"dedup_disabled": False,
},
"retention_days": 30,
"retention_count": 7,
"storages": [
{
"storage_id": 3,
"priority": 1,
"path_prefix": "web-01/nightly-files",
},
],
},
)
print(response.text)
{
"data": {
"id": 41,
"server_id": 12,
"plan_template_id": 1,
"name": "Nightly files",
"type": "files",
"type_label": "Files",
"schedule_id": 7,
"compression_profile_id": 2,
"enabled": true,
"encrypts_new_backups": false,
"config": {
"backup_path_ids": [
5
],
"incremental": true,
"full_every": 7,
"archive_per_path": false,
"dedup_disabled": false
},
"retention_days": 30,
"retention_count": 7,
"server": {
"id": 12,
"name": "web-01",
"ip": "203.0.113.10",
"status": "online",
"status_label": "Online",
"control_panel": "plesk",
"detected_control_panel": "plesk",
"last_seen_at": "2026-11-20T02:00:04+00:00",
"agent_version": "1.4.1",
"account_portal_plugin_status": null,
"enrolled_at": "2026-11-01T09:20:00+00:00",
"metadata": {
"hostname": "web-01.example.com",
"os": "Ubuntu 22.04"
},
"work_dir": "/var/backups/clokeep",
"agent_work_dirs": [
{
"path": "/var/backups/clokeep",
"default": true,
"available": true,
"free_bytes": 214748364800,
"total_bytes": 536870912000,
"source": "config",
"mount_point": "/",
"device": "/dev/sda1",
"fs_type": "ext4"
}
],
"accounts_synced_at": "2026-11-20T01:30:04+00:00",
"plesk_subscriptions_synced_at": "2026-11-20T01:30:04+00:00",
"plesk_sync_requested": false,
"created_at": "2026-11-01T09:14:22+00:00",
"updated_at": "2026-11-20T02:00:04+00:00"
},
"schedule": {
"id": 7,
"name": "Nightly at 2:00 AM",
"platform": false,
"cron_expression": "0 2 * * *",
"timezone": "UTC",
"created_at": "2026-11-01T09:14:22+00:00",
"updated_at": "2026-11-18T16:40:05+00:00"
},
"compression_profile": {
"id": 2,
"name": "Gzip",
"platform": false,
"archive_format": "tar",
"archive_format_label": "tar",
"compressor": "gzip",
"compressor_label": "gzip",
"level": 6,
"file_extension": ".tar.gz",
"is_default": true,
"created_at": "2026-11-01T09:14:22+00:00",
"updated_at": "2026-11-18T16:40:05+00:00"
},
"storages": [
{
"id": 62,
"storage_id": 3,
"priority": 1,
"path_prefix": "web-01/nightly-files",
"storage": {
"id": 3,
"name": "Offsite S3",
"driver": "s3",
"driver_label": "S3",
"config": {
"bucket": "example-offsite-backups",
"region": "eu-central-1"
},
"has_credentials": true,
"is_active": true,
"last_tested_at": "2026-11-19T09:30:00+00:00",
"last_test_status": "success",
"object_lock_enabled": true,
"created_at": "2026-11-01T09:14:22+00:00",
"updated_at": "2026-11-19T09:30:00+00:00"
}
}
],
"created_at": "2026-11-01T09:14:22+00:00",
"updated_at": "2026-11-18T16:40:05+00:00"
}
}{
"message": "Unauthenticated."
}{
"message": "This token lacks the required ability."
}{
"message": "The server id field is required.",
"errors": {
"server_id": [
"The server id field is required."
]
}
}{
"message": "Too Many Attempts."
}Body Parameters
-
server_idintegerrequired
The server to back up.
Example:
12 -
plan_template_idintegernullable
The plan template the plan starts from, or null.
Example:
1 -
namestringrequired
A name for the plan.
Example:
Nightly files -
typestringrequired
What the plan backs up:
files,database,email,plesk_subscriptionorcpanel_account. The last two need a server with that control panel.One of:
files,database,email,plesk_subscription,cpanel_accountExample:
files -
schedule_idintegernullable
The schedule the plan runs on. Null: the plan runs only when started (
POST /plans/{plan}/run).Example:
7 -
compression_profile_idintegernullable
The compression profile of the plan's backups. Null: the agent's default.
Example:
2 -
enabledboolean
Whether the schedule starts the plan.
Example:
true -
configobjectnullable
The settings of the plan's
type. files:backup_path_ids,incremental,full_every,archive_per_path,dedup_disabled. database:database_connection_id,tables. email:mail_paths,mail_domains,mail_mailboxes,mail_all_domains. plesk_subscription and cpanel_account:account_scope,include_mail,archive_per_component.Example:
{"backup_path_ids":[5],"incremental":true,"full_every":7,"archive_per_path":false,"dedup_disabled":false} -
retention_daysintegernullable
Delete backups older than this many days. Null: no age limit.
Example:
30 -
retention_countintegernullable
Keep at most this many backups, deleting the oldest. Null: no count limit.
Example:
7 -
storagesobject[]nullable
Where backups are uploaded, in order of
priority. On update a sent list replaces the plan's storages.Show properties
-
storages.storage_idintegerrequired
A storage of the client.
Example:
3 -
storages.priorityintegerrequired
The order the storages are used in, 1 first.
Example:
1 -
storages.path_prefixstringnullable
A folder inside the storage for this plan's backups.
Example:
web-01/nightly-files
-
Response
201
-
dataobject
Show properties
-
data.idinteger
-
data.server_idinteger
-
data.plan_template_idintegernullable
-
data.namestring
-
data.typestring
One of:
files,database,email,plesk_subscription,cpanel_account -
data.type_labelstring
One of:
Files,Database,Email,Plesk server,cPanel server -
data.schedule_idintegernullable
-
data.compression_profile_idintegernullable
-
data.enabledboolean
-
data.encrypts_new_backupsboolean
True when the plan's next backups will be encrypted with the platform's key (the platform-wide setting or the client's own).
-
data.configobjectnullable
The plan's settings; the keys depend on
type. files:backup_path_ids,incremental,full_every,archive_per_path,dedup_disabled. database:database_connection_id,tables. email:mail_paths,mail_domains,mail_mailboxes,mail_all_domains. plesk_subscription and cpanel_account:account_scope(on Plesk alsoplesk_scope, its pre-4.3.0 name),include_mail,archive_per_component. An empty list[]when nothing is set. -
data.retention_daysintegernullable
-
data.retention_countintegernullable
-
data.serverobject
Show properties
-
data.server.idinteger
-
data.server.namestring
-
data.server.ipstringnullable
-
data.server.statusstring
One of:
pending,online,offline -
data.server.status_labelstring
One of:
Pending,Online,Offline -
data.server.control_panelstring
One of:
none,plesk,cpanel -
data.server.detected_control_panelstringnullable
One of:
none,plesk,cpanel,null -
data.server.last_seen_atstring · date-timenullable
-
data.server.agent_versionstringnullable
-
data.server.account_portal_plugin_statusstringnullable
What the agent last reported for the cPanel Backups plugin:
installed,not_installedorfailed. Null until an agent reports it. -
data.server.enrolled_atstring · date-timenullable
-
data.server.metadataobjectnullable
Free-form details about the server: whatever the API or panel stored, plus
hostnameandosas the agent reports them. An empty list[]when nothing is set. -
data.server.work_dirstringnullable
The directory the agent stages and archives in: an absolute path the agent reports in
agent_work_dirs,autoto let the agent pick the one with the most free space, or null for the agent default. -
data.server.agent_work_dirsobject[]nullable
The work directories the agent reported on its last heartbeat; null until an agent that reports them has checked in. Each entry has
path,default(the agent's first choice),available,free_bytes,total_bytes,source(configfor a directory from the agent's settings,diskfor a detected one) and the nullablemount_point,deviceandfs_type.Show properties
-
data.server.agent_work_dirs.pathstring
-
data.server.agent_work_dirs.defaultboolean
-
data.server.agent_work_dirs.availableboolean
-
data.server.agent_work_dirs.free_bytesinteger
-
data.server.agent_work_dirs.total_bytesinteger
-
data.server.agent_work_dirs.sourcestring
-
data.server.agent_work_dirs.mount_pointstringnullable
-
data.server.agent_work_dirs.devicestringnullable
-
data.server.agent_work_dirs.fs_typestringnullable
-
-
data.server.accounts_synced_atstring · date-timenullable
-
data.server.plesk_subscriptions_synced_atstring · date-timenullable
-
data.server.plesk_sync_requestedboolean
Whether a hosting-account sync is waiting for the agent to pick it up.
-
data.server.created_atstring · date-timenullable
-
data.server.updated_atstring · date-timenullable
-
-
data.scheduleobjectnullable
Show properties
-
data.schedule.idinteger
-
data.schedule.namestring
-
data.schedule.platformboolean
True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created.
-
data.schedule.cron_expressionstring
-
data.schedule.timezonestring
-
data.schedule.created_atstring · date-timenullable
-
data.schedule.updated_atstring · date-timenullable
-
-
data.compression_profileobjectnullable
Show properties
-
data.compression_profile.idinteger
-
data.compression_profile.namestring
-
data.compression_profile.platformboolean
True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created.
-
data.compression_profile.archive_formatstring
One of:
tar,zip -
data.compression_profile.archive_format_labelstring
One of:
tar,zip -
data.compression_profile.compressorstring
One of:
none,gzip,zstd -
data.compression_profile.compressor_labelstring
One of:
None,gzip,zstd -
data.compression_profile.levelinteger
-
data.compression_profile.file_extensionstring
-
data.compression_profile.is_defaultboolean
-
data.compression_profile.created_atstring · date-timenullable
-
data.compression_profile.updated_atstring · date-timenullable
-
-
data.plan_templateobjectnullable
Show properties
-
data.plan_template.idinteger
-
data.plan_template.slugstring
-
data.plan_template.namestring
-
data.plan_template.platformboolean
A shared catalog item: read-only to clients.
-
data.plan_template.descriptionstringnullable
-
data.plan_template.typestring
One of:
files,database,email,plesk_subscription,cpanel_account -
data.plan_template.type_labelstring
One of:
Files,Database,Email,Plesk server,cPanel server -
data.plan_template.default_schedule_idintegernullable
-
data.plan_template.default_compression_profile_idintegernullable
-
data.plan_template.default_configobjectnullable
The settings a plan made from this template starts with; the keys are those of a plan's
configfor the sametype. An empty list[]when nothing is set. -
data.plan_template.is_systemboolean
-
data.plan_template.created_atstring · date-timenullable
-
data.plan_template.updated_atstring · date-timenullable
-
-
data.storagesobject[]
Show properties
-
data.storages.idinteger
-
data.storages.storage_idinteger
-
data.storages.priorityinteger
-
data.storages.path_prefixstringnullable
-
data.storages.storageobject
Show properties
-
data.storages.storage.idinteger
-
data.storages.storage.namestring
-
data.storages.storage.driverstring
One of:
s3,sftp,ftp -
data.storages.storage.driver_labelstring
One of:
S3,SFTP,FTP -
data.storages.storage.configobjectnullable
The storage's non-secret settings; the keys depend on
driver. s3:bucket,region,endpoint,use_path_style_endpoint,root. sftp:host,port,root,timeout,host_key. ftp:host,port,root,timeout,ssl,passive(the panel's own connections only; the agent always uses passive mode). Credentials are never returned. An empty list[]when nothing is set. -
data.storages.storage.has_credentialsboolean
-
data.storages.storage.is_activeboolean
-
data.storages.storage.last_tested_atstring · date-timenullable
-
data.storages.storage.last_test_statusstringnullable
The outcome of the last connection test; null before the first.
One of:
success,failed,null -
data.storages.storage.object_lock_enabledbooleannullable
Whether the S3 bucket has Object Lock turned on, as the last connection test found it. Detected, never set through the API; null for SFTP and FTP storages and before an S3 storage's first successful check.
-
data.storages.storage.created_atstring · date-timenullable
-
data.storages.storage.updated_atstring · date-timenullable
-
-
-
data.created_atstring · date-timenullable
-
data.updated_atstring · date-timenullable
-
401
The request carries no valid token: the Authorization: Bearer header is missing, or its token is unknown, revoked or past its expiry date. Send a current personal access token.
-
messagestring
Always
Unauthenticated.
403
The token may not do this. The message says why: This token lacks the required ability. (a read token), Your role does not permit this action. (its owner is not an Admin or Operator in the client), This account is disabled., This token is not bound to a client you belong to., or Client suspended.
-
messagestring
What went wrong.
422
The body or the query is invalid. message names the first problem and errors lists every problem by field.
-
messagestring
The first problem, and how many more there are.
-
errorsobject
Every problem, by field.
429
More than 120 requests a minute for this user. Wait the seconds in Retry-After, then retry.
-
messagestring
What went wrong.