Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
bulk-migrate
Bulk Migrate Content
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/bulk-migrate \
  --header 'Content-Type: application/json' \
  --data '
{
  "contentIds": [
    "<string>"
  ],
  "targetTypeVersion": 123
}
'
Migrates multiple content items to a new ContentType version in a single operation. Returns results for each item, including any failures.

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

contentIds
string[]
required
Array of content IDs to migrate
targetTypeVersion
number
required
The ContentType version to migrate to

Example Request

{
  "contentIds": ["cont123", "cont124", "cont125"],
  "targetTypeVersion": 3
}

Response

Returns arrays of successfully migrated and failed content IDs.
{
  "migrated": ["cont123", "cont124"],
  "failed": [
    {
      "id": "cont125",
      "error": {
        "code": "VALIDATION_FAILED",
        "message": "Content does not match target schema"
      }
    }
  ]
}
Bulk migration is atomic per content item. Failures do not rollback successful migrations. Review the failed array to identify and fix issues.

Error Responses

ContentType Version Not Found

{
  "error": {
    "code": "TYPE_VERSION_NOT_FOUND",
    "message": "ContentType version 3 not found"
  }
}

Empty Content IDs

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "contentIds array cannot be empty"
  }
}

Too Many Items

{
  "error": {
    "code": "LIMIT_EXCEEDED",
    "message": "Cannot migrate more than 100 items at once",
    "details": {
      "provided": 150,
      "limit": 100
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/bulk-migrate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contentIds": ["cont123", "cont124", "cont125"],
    "targetTypeVersion": 3
  }'