Skip to main content

Publish & Unpublish

Control the lifecycle of a bundle by publishing, unpublishing, or adding slots after creation.


Publish

Submit a configured bundle for processing. The account must be fully configured, and for account_and_videos bundles, at least one video must be configured.

POST /bundles/:id/publish

Requirements

  • Bundle must be in pending_setup status.
  • Account configuration must be complete (username, visible name, biography, profile picture).
  • For account_and_videos type: at least 1 video must be configured.

Example

curl -X POST https://app.tokportal.com/api/ext/bundles/bnd_abc123/publish \
-H "X-API-Key: tok_live_xxx"

Response

{
"data": {
"id": "bnd_abc123",
"status": "published",
"published_at": "2026-02-10T14:00:00Z"
}
}

Error Responses

StatusCodeDescription
400account_not_configuredAccount configuration is incomplete.
400no_videos_configuredAt least 1 video is required for account_and_videos bundles.
409invalid_statusBundle is not in pending_setup status.

Unpublish

Revert a published bundle back to pending_setup. This allows you to make further configuration changes before resubmitting.

POST /bundles/:id/unpublish
warning

Unpublishing does not refund credits. The credits charged at bundle creation remain deducted.

Requirements

  • Bundle must be in published status.
  • Bundle must not have been accepted yet.

Example

curl -X POST https://app.tokportal.com/api/ext/bundles/bnd_abc123/unpublish \
-H "X-API-Key: tok_live_xxx"

Response

{
"data": {
"id": "bnd_abc123",
"status": "pending_setup",
"unpublished_at": "2026-02-10T15:30:00Z"
}
}

Error Responses

StatusCodeDescription
409invalid_statusBundle is not in published status.
409already_acceptedBundle has been accepted and cannot be unpublished.

Add Video Slots

Add additional video slots to an existing bundle. Credits are debited immediately.

POST /bundles/:id/add-video-slots

Request Body

FieldTypeRequiredDescription
quantityintegerYesNumber of video slots to add. Must be >= 1.

Requirements

  • Bundle type must be account_and_videos or videos_only.
  • Bundle must not be in completed status.

Example

curl -X POST https://app.tokportal.com/api/ext/bundles/bnd_abc123/add-video-slots \
-H "X-API-Key: tok_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"quantity": 2
}'

Response

{
"data": {
"id": "bnd_abc123",
"videos_quantity": 5,
"previous_videos_quantity": 3
},
"credits_charged": 20,
"credits_remaining": 350
}

Error Responses

StatusCodeDescription
400invalid_bundle_typeBundle type does not support videos.
400invalid_quantityQuantity must be at least 1.
402insufficient_creditsNot enough credits.
409bundle_completedCannot add slots to a completed bundle.

Add Edit Slots

Add editing slots to an existing bundle. Each video can have at most 1 edit slot. Credits are debited immediately.

POST /bundles/:id/add-edit-slots

Request Body

FieldTypeRequiredDescription
quantityintegerYesNumber of edit slots to add. Must be >= 1.

Requirements

  • Bundle type must be account_and_videos or videos_only.
  • Total edits_quantity must not exceed videos_quantity (max 1 edit per video).
  • Bundle must not be in completed status.

Example

curl -X POST https://app.tokportal.com/api/ext/bundles/bnd_abc123/add-edit-slots \
-H "X-API-Key: tok_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"quantity": 1
}'

Response

{
"data": {
"id": "bnd_abc123",
"edits_quantity": 3,
"previous_edits_quantity": 2,
"videos_quantity": 5
},
"credits_charged": 5,
"credits_remaining": 345
}

Error Responses

StatusCodeDescription
400invalid_bundle_typeBundle type does not support videos/edits.
400edits_exceed_videosAdding these slots would exceed the 1-edit-per-video limit.
400invalid_quantityQuantity must be at least 1.
402insufficient_creditsNot enough credits.
409bundle_completedCannot add slots to a completed bundle.