Clokeep Clokeep Docs
Documentation API Reference
Compression profilesCreate a compression profile
Compression profiles View as Markdown

Create a compression profile

file_extension is the suffix of the archives, for example .tar.gz for tar with gzip.

Post /api/v1/compression-profiles
curl -X POST 'https://app.clokeep.com/api/v1/compression-profiles' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Gzip",
    "archive_format": "tar",
    "compressor": "gzip",
    "level": 6,
    "file_extension": ".tar.gz",
    "is_default": true
  }'
<?php

$ch = curl_init('https://app.clokeep.com/api/v1/compression-profiles');

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([
    'name' => 'Gzip',
    'archive_format' => 'tar',
    'compressor' => 'gzip',
    'level' => 6,
    'file_extension' => '.tar.gz',
    'is_default' => true,
  ]),
]);

$response = curl_exec($ch);

echo $response;
const response = await fetch("https://app.clokeep.com/api/v1/compression-profiles", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Gzip",
    "archive_format": "tar",
    "compressor": "gzip",
    "level": 6,
    "file_extension": ".tar.gz",
    "is_default": true,
  }),
});

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

response = requests.post(
    "https://app.clokeep.com/api/v1/compression-profiles",
    headers={
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "name": "Gzip",
        "archive_format": "tar",
        "compressor": "gzip",
        "level": 6,
        "file_extension": ".tar.gz",
        "is_default": True,
    },
)

print(response.text)
{
  "data": {
    "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"
  }
}
{
  "message": "Unauthenticated."
}
{
  "message": "This token lacks the required ability."
}
{
  "message": "The name field is required.",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
{
  "message": "Too Many Attempts."
}

Body Parameters

  • namestringrequired

    A name for the profile, shown when choosing one for a plan.

    Example: Gzip

  • archive_formatstringrequired

    The archive format: tar or zip.

    One of: tar, zip

    Example: tar

  • compressorstringrequired

    The compressor: none, gzip or zstd.

    One of: none, gzip, zstd

    Example: gzip

  • levelintegerrequired

    The compression level, 0 to 9.

    Example: 6

  • file_extensionstringrequired

    The suffix of the archive files, starting with a dot, for example .tar.gz for tar with gzip.

    Example: .tar.gz

  • is_defaultboolean

    Marks the profile as the client's default in the panel.

    Example: true

Response

201

  • dataobject
    Show properties
    • data.idinteger
    • data.namestring
    • data.platformboolean

      True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created.

    • data.archive_formatstring

      One of: tar, zip

    • data.archive_format_labelstring

      One of: tar, zip

    • data.compressorstring

      One of: none, gzip, zstd

    • data.compressor_labelstring

      One of: None, gzip, zstd

    • data.levelinteger
    • data.file_extensionstring
    • data.is_defaultboolean
    • 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.

Esc
↑↓to navigate↵to openEscto close