Clokeep Clokeep Docs
Documentation API Reference
Backup runsStore a backup's file index
Backup runs View as Markdown

Store a backup's file index

Adds file and folder entries to the file list of a backup this run stored, up to 10000 per request, and answers 201 with the whole list. 422 when the backup is not this run's, or when its file list is kept as a manifest file, which takes no entries.

Post /api/v1/backup-runs/{backupRun}/manifest
curl -X POST 'https://app.clokeep.com/api/v1/backup-runs/1873/manifest' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "artifact_id": 2291,
    "entries": [
      {
        "path": "httpdocs/wp-config.php",
        "parent_path": "httpdocs",
        "is_directory": false,
        "size_bytes": 3412,
        "mtime": 1795122930,
        "change_type": "added",
        "owner": "example",
        "group": "example",
        "uid": 10001,
        "gid": 1001,
        "mode": 420,
        "checksum": "3b7e1c9a5d2f48e6a0c1b93d7f5e2a84c6d0b1f9e3a7524c8d6b0e1f9a3c5d72",
        "copied_from": null
      }
    ]
  }'
<?php

$ch = curl_init('https://app.clokeep.com/api/v1/backup-runs/1873/manifest');

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([
    'artifact_id' => 2291,
    'entries' => [
      [
        'path' => 'httpdocs/wp-config.php',
        'parent_path' => 'httpdocs',
        'is_directory' => false,
        'size_bytes' => 3412,
        'mtime' => 1795122930,
        'change_type' => 'added',
        'owner' => 'example',
        'group' => 'example',
        'uid' => 10001,
        'gid' => 1001,
        'mode' => 420,
        'checksum' => '3b7e1c9a5d2f48e6a0c1b93d7f5e2a84c6d0b1f9e3a7524c8d6b0e1f9a3c5d72',
        'copied_from' => null,
      ],
    ],
  ]),
]);

$response = curl_exec($ch);

echo $response;
const response = await fetch("https://app.clokeep.com/api/v1/backup-runs/1873/manifest", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "artifact_id": 2291,
    "entries": [
      {
        "path": "httpdocs/wp-config.php",
        "parent_path": "httpdocs",
        "is_directory": false,
        "size_bytes": 3412,
        "mtime": 1795122930,
        "change_type": "added",
        "owner": "example",
        "group": "example",
        "uid": 10001,
        "gid": 1001,
        "mode": 420,
        "checksum": "3b7e1c9a5d2f48e6a0c1b93d7f5e2a84c6d0b1f9e3a7524c8d6b0e1f9a3c5d72",
        "copied_from": null,
      },
    ],
  }),
});

console.log(await response.text());
import requests

response = requests.post(
    "https://app.clokeep.com/api/v1/backup-runs/1873/manifest",
    headers={
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "artifact_id": 2291,
        "entries": [
            {
                "path": "httpdocs/wp-config.php",
                "parent_path": "httpdocs",
                "is_directory": False,
                "size_bytes": 3412,
                "mtime": 1795122930,
                "change_type": "added",
                "owner": "example",
                "group": "example",
                "uid": 10001,
                "gid": 1001,
                "mode": 420,
                "checksum": "3b7e1c9a5d2f48e6a0c1b93d7f5e2a84c6d0b1f9e3a7524c8d6b0e1f9a3c5d72",
                "copied_from": None,
            },
        ],
    },
)

print(response.text)
{
  "message": "Manifest stored successfully.",
  "artifact_id": 2291,
  "entries_count": 18432,
  "entries": [
    {
      "path": "httpdocs/wp-config.php",
      "parent_path": "httpdocs",
      "is_directory": false,
      "size_bytes": 3412,
      "mtime": 1795122930,
      "change_type": "added",
      "owner": "example",
      "group": "example",
      "uid": 10001,
      "gid": 1001,
      "mode": "0644"
    }
  ]
}
{
  "message": "Unauthenticated."
}
{
  "message": "This token lacks the required ability."
}
{
  "message": "No query results for model [App\\Models\\BackupRun] 1873"
}
{
  "message": "The artifact id field is required.",
  "errors": {
    "artifact_id": [
      "The artifact id field is required."
    ]
  }
}
{
  "message": "Too Many Attempts."
}

Path Parameters

  • backupRunintegerrequired

    The ID of the backup run.

    Example: 1873

Body Parameters

  • artifact_idintegerrequired

    The backup the entries belong to; it must come from this run.

    Example: 2291

  • entriesobject[]required

    The files and folders of the backup, up to 10000 per request. Each entry has path (required), parent_path, is_directory, size_bytes, mtime, change_type (added, modified, deleted, touched or copied), copied_from (required for copied), owner, group, uid, gid, mode (an integer, for example 420 for 0644) and checksum.

    Example: [{"path":"httpdocs/wp-config.php","parent_path":"httpdocs","is_directory":false,"size_bytes":3412,"mtime":1795122930,"change_type":"added","owner":"example","group":"example","uid":10001,"gid":1001,"mode":420,"checksum":"3b7e1c9a5d2f48e6a0c1b93d7f5e2a84c6d0b1f9e3a7524c8d6b0e1f9a3c5d72","copied_from":null}]

    Show properties
    • entries.pathstringrequired
    • entries.parent_pathstringnullable
    • entries.is_directoryboolean
    • entries.size_bytesintegernullable
    • entries.mtimeintegernullable
    • entries.change_typestringnullable

      One of: added, modified, deleted, touched, copied, null

    • entries.copied_fromstringnullable
    • entries.ownerstringnullable
    • entries.groupstringnullable
    • entries.uidintegernullable
    • entries.gidintegernullable
    • entries.modeintegernullable
    • entries.checksumstringnullable

Response

201

The entries are stored; the answer lists the backup's whole file index.

  • messagestring
  • artifact_idinteger
  • entries_countinteger

    How many entries the backup's file list now holds.

  • entriesobject[]
    Show properties
    • entries.pathstring

      The entry's path inside the backup.

    • entries.parent_pathstringnullable

      The folder that holds the entry.

    • entries.is_directoryboolean
    • entries.size_bytesinteger

      The file's size in bytes.

    • entries.mtimeintegernullable

      When the file was last modified, as a Unix timestamp in seconds.

    • entries.change_typestringnullable

      What the backup recorded for the entry: added, modified or deleted since the earlier backup, touched (same content, new modification time) or copied (same content as another path of the earlier backup). Null when the backup does not say.

      One of: added, modified, deleted, touched, copied, null

    • entries.ownerstringnullable

      The file's owner on the server, when the agent recorded it.

    • entries.groupstringnullable

      The file's group on the server, when the agent recorded it.

    • entries.uidintegernullable
    • entries.gidintegernullable
    • entries.modestringnullable

      The file's permissions as four octal digits.

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.

404

Not found

  • messagestring

    What went wrong.

422

The body or the query is invalid. message names the first problem and errors lists every problem by field. A backup this run did not store, or one whose file index is kept as a manifest file, is refused with a message only.

  • 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.

Esc
↑↓to navigate↵to openEscto close