Source: https://developers.tokportal.com/use-cases/no-code/mp4-delivered-account-preview/
Markdown: https://developers.tokportal.com/use-cases/no-code/mp4-delivered-account-preview.md

# Preview an MP4 configuration on a delivered account

This recipe starts after a real TikTok account has been delivered and already has a video-capable bundle with an unused slot. It checks one configuration request without changing that slot. It does not buy a new account or video capacity, download media, upload to storage, or publish a post.

For a first account, start with [the US launch guide](https://www.tokportal.com/learn/us-launch-from-abroad?utm_source=developers_tokportal\&utm_medium=docs\&utm_campaign=growth_us_launch_202609\&utm_content=mp4_preview_guide) and [account-order preview](https://developers.tokportal.com/use-cases/no-code/n8n-us-account-preview). For the web path, [sign up](https://app.tokportal.com/auth/signup?utm_source=developers_tokportal\&utm_medium=docs\&utm_campaign=growth_us_launch_202609\&utm_content=mp4_preview_signup) or [open your accounts](https://app.tokportal.com/dashboard/social-accounts?utm_source=developers_tokportal\&utm_medium=docs\&utm_campaign=growth_us_launch_202609\&utm_content=mp4_preview_accounts). MCP is optional.

## Select the real account and an unused slot

Use only an account you are authorized to operate and media you have the rights to publish. With your n8n Header Auth credential (`X-API-Key`), read:

1. `GET /accounts?page=1&per_page=100`. Follow the returned pagination if the account is not on the first page; do not infer absence from that page alone.
2. `GET /accounts/{account_id}` to inspect the chosen delivered account, its platform, country, ban state and current task-access information. Do not call the credential-reveal or verification-code endpoints.
3. `GET /accounts/{account_id}/bundles` to select its existing video-capable bundle, then `GET /bundles/{bundle_id}/videos` to inspect the slots. An `account_only` bundle has no video slots. Choose a position that is genuinely unused; do not replace an existing creative.

If the account is unavailable or there is no appropriate slot, stop. Decide separately whether to [open a new order](https://app.tokportal.com/bundles/create?utm_source=developers_tokportal\&utm_medium=docs\&utm_campaign=growth_us_launch_202609\&utm_content=mp4_preview_capacity) and review its current charge. This recipe never purchases capacity or picks another account for you.

## Validate the MP4 request in n8n

Reuse the input shape of [TokPortal's existing video-URL template](https://github.com/tokportal/n8n-nodes-tokportal/blob/main/templates/06-ai-video-url-to-tokportal-upload-schedule.json): `video_url`, `caption`, `bundle_id`, `position`, `publish_date`. Do not activate that template for this check: its webhook, upload and `auto_publish` steps perform real work.

For the preview, create a separate **Manual Trigger → Edit Fields → HTTP Request** chain. Enter the chosen real `bundle_id` and position, a stable public direct MP4 URL, and your caption in Edit Fields. For `publish_date`, choose a future UTC date; a sample n8n expression is `{{ $now.toUTC().plus({ days: 3 }).toISODate() }}`. A bundle attached to an existing account, or whose account setup is finalized, requires at least tomorrow in UTC; otherwise the minimum is three days ahead. A delivery label alone does not override the bundle's actual account state. The API's `INVALID_DATE` response with `details.earliest_allowed` is authoritative. See [date rules](https://developers.tokportal.com/configure-videos).

Configure the HTTP Request node:

| Setting           | Value                                                                                         |
| ----------------- | --------------------------------------------------------------------------------------------- |
| Method            | `PUT`                                                                                         |
| URL, expression   | `https://app.tokportal.com/api/ext/bundles/{{ $json.bundle_id }}/videos/{{ $json.position }}` |
| Authentication    | The same Header Auth credential; the preview requires write permission                        |
| Header            | `X-TokPortal-Dry-Run` = `true`, as a fixed value                                              |
| Body Content Type | JSON                                                                                          |
| Specify Body      | Using JSON; use the expression below                                                          |
| Response          | JSON; **Include Response Headers and Status** on; **Never Error** off                         |

Switch the JSON body field to **Expression**, then use:

```text
{{ {
  video_type: 'video',
  video_url: $json.video_url,
  description: $json.caption,
  target_publish_date: $json.publish_date,
  ai_content_disclaimer: $json.ai_content_disclaimer,
  auto_publish: false
} }}
```

Add `ai_content_disclaimer` as a boolean in Edit Fields according to your actual media. Do not copy a generator's disclosure assumption onto unrelated footage. The operation is a full-replace configuration; include the intended fields when testing it. The dry-run header ensures the existing slot remains unchanged.

Run manually once, then stop. A successful response must have header `X-TokPortal-Dry-Run: true` and body `dry_run: true`. If `credits_charged` is present it must be zero. No upload or publish node follows this HTTP Request. For an error, inspect the response header and normal error details; never remove the header to bypass a validation or permission failure.

This validates the API's configuration rules for that request and current account state. It does not prove the MP4 will remain reachable, pass every later media or platform check, be accepted for publication, or achieve a particular audience. Keep the direct URL available for any later real operation; a temporary generator URL is not durable storage.

## After the preview

If you decide to publish, review the creative and current account state in the [web app](https://app.tokportal.com/dashboard/social-accounts?utm_source=developers_tokportal\&utm_medium=docs\&utm_campaign=growth_us_launch_202609\&utm_content=mp4_preview_after_check). Any actual upload, configuration or publication is a separate action. Keep this preview chain unchanged.

For an intentionally automated workflow, the existing [upload-and-schedule template](https://github.com/tokportal/n8n-nodes-tokportal/blob/main/templates/06-ai-video-url-to-tokportal-upload-schedule.json) and [Media Upload reference](https://developers.tokportal.com/media-upload) explain how to persist the file. Review its webhook and `auto_publish: true` behavior before using it. An upload to an external storage URL is a real storage write; a TokPortal dry-run header does not make that storage request a simulation.
