Skip to main content
Bulk operations allow you to update or delete multiple content items in a single request, reducing API calls and improving efficiency.

Endpoints

MethodEndpointDescription
POST/v1/content/bulk/updateUpdate multiple content items
POST/v1/content/bulk/deleteDelete multiple content items
POST/v1/content/bulk/tagAdd/remove tags from multiple items
POST/v1/content/bulk/visibilityChange visibility for multiple items

Bulk update

Update metadata for multiple content items.
POST /v1/content/bulk/update

Request body

items
array
required
Array of update operations (max 100 items).
continueOnError
boolean
default:false
Continue processing if individual items fail.

Example request

curl -X POST https://api.shortkit.dev/v1/content/bulk/update \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "id": "cnt_abc123",
        "title": "Updated Title 1",
        "visibility": "public"
      },
      {
        "id": "cnt_def456",
        "title": "Updated Title 2",
        "tags": ["featured"]
      }
    ],
    "continueOnError": true
  }'

Response

{
  "data": {
    "successful": [
      { "id": "cnt_abc123", "status": "updated" },
      { "id": "cnt_def456", "status": "updated" }
    ],
    "failed": [],
    "totalProcessed": 2,
    "totalSuccessful": 2,
    "totalFailed": 0
  },
  "meta": {
    "requestId": "req_xyz789"
  }
}

Partial failure response

When continueOnError is true and some items fail:
{
  "data": {
    "successful": [
      { "id": "cnt_abc123", "status": "updated" }
    ],
    "failed": [
      {
        "id": "cnt_invalid",
        "error": {
          "code": "NOT_FOUND",
          "message": "Content not found"
        }
      }
    ],
    "totalProcessed": 2,
    "totalSuccessful": 1,
    "totalFailed": 1
  }
}

Bulk delete

Delete multiple content items.
POST /v1/content/bulk/delete

Request body

ids
string[]
required
Content IDs to delete (max 100).
continueOnError
boolean
default:false
Continue if individual deletions fail.

Example request

curl -X POST https://api.shortkit.dev/v1/content/bulk/delete \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["cnt_abc123", "cnt_def456", "cnt_ghi789"],
    "continueOnError": true
  }'

Response

{
  "data": {
    "successful": [
      { "id": "cnt_abc123", "status": "deleted" },
      { "id": "cnt_def456", "status": "deleted" },
      { "id": "cnt_ghi789", "status": "deleted" }
    ],
    "failed": [],
    "totalProcessed": 3,
    "totalSuccessful": 3,
    "totalFailed": 0
  }
}
Bulk deletion is permanent and cannot be undone. All associated data (thumbnails, analytics) is removed within 24 hours.

Bulk tag

Add or remove tags from multiple content items.
POST /v1/content/bulk/tag

Request body

ids
string[]
required
Content IDs to modify (max 100).
addTags
string[]
Tags to add.
removeTags
string[]
Tags to remove.

Example request

curl -X POST https://api.shortkit.dev/v1/content/bulk/tag \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["cnt_abc123", "cnt_def456"],
    "addTags": ["featured", "homepage"],
    "removeTags": ["draft"]
  }'

Response

{
  "data": {
    "successful": [
      {
        "id": "cnt_abc123",
        "tags": ["featured", "homepage", "product"]
      },
      {
        "id": "cnt_def456",
        "tags": ["featured", "homepage"]
      }
    ],
    "failed": [],
    "totalProcessed": 2,
    "totalSuccessful": 2,
    "totalFailed": 0
  }
}

Bulk visibility

Change visibility for multiple content items.
POST /v1/content/bulk/visibility

Request body

ids
string[]
required
Content IDs to modify (max 100).
visibility
string
required
New visibility: private, unlisted, or public.

Example request

curl -X POST https://api.shortkit.dev/v1/content/bulk/visibility \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["cnt_abc123", "cnt_def456", "cnt_ghi789"],
    "visibility": "public"
  }'

Response

{
  "data": {
    "successful": [
      { "id": "cnt_abc123", "visibility": "public" },
      { "id": "cnt_def456", "visibility": "public" },
      { "id": "cnt_ghi789", "visibility": "public" }
    ],
    "failed": [],
    "totalProcessed": 3,
    "totalSuccessful": 3,
    "totalFailed": 0
  }
}

Rate limits

Bulk operations have specific rate limits:
OperationLimit
Items per request100
Requests per minute60
Items per minute1,000
For larger batch jobs, consider spacing requests or using async processing.

Async bulk operations

For very large operations (1000+ items), use async bulk jobs:

Create bulk job

POST /v1/content/bulk/jobs
curl -X POST https://api.shortkit.dev/v1/content/bulk/jobs \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "update",
    "filter": {
      "tags": ["old-campaign"]
    },
    "update": {
      "addTags": ["archived"],
      "removeTags": ["old-campaign"]
    }
  }'
Response:
{
  "data": {
    "jobId": "job_abc123",
    "status": "processing",
    "totalItems": 5420,
    "processedItems": 0,
    "createdAt": "2024-02-04T12:00:00Z"
  }
}

Check job status

curl https://api.shortkit.dev/v1/content/bulk/jobs/job_abc123 \
  -H "Authorization: Bearer sk_live_your_secret_key"
Response:
{
  "data": {
    "jobId": "job_abc123",
    "status": "complete",
    "totalItems": 5420,
    "processedItems": 5420,
    "successfulItems": 5418,
    "failedItems": 2,
    "createdAt": "2024-02-04T12:00:00Z",
    "completedAt": "2024-02-04T12:05:00Z"
  }
}

SDK examples

import { ShortkitAdmin } from '@shortkit/node';

const shortkit = new ShortkitAdmin({ apiKey: 'sk_live_...' });

// Bulk update
const result = await shortkit.content.bulkUpdate([
  { id: 'cnt_abc123', visibility: 'public' },
  { id: 'cnt_def456', visibility: 'public' }
]);

console.log(`Updated: ${result.totalSuccessful}`);

// Bulk delete
await shortkit.content.bulkDelete([
  'cnt_old1', 'cnt_old2', 'cnt_old3'
]);

// Bulk tag
await shortkit.content.bulkTag({
  ids: ['cnt_abc123', 'cnt_def456'],
  addTags: ['featured'],
  removeTags: ['draft']
});

Best practices

When processing large batches, enable continueOnError to ensure one failure doesn’t stop the entire operation.
Group related content together. If one group fails, other groups remain unaffected.
Always check the failed array in responses and implement retry logic for failed items.
For operations affecting 1000+ items, use async bulk jobs to avoid timeouts.

Next steps