TikTok error 40002: parameter error in the request
TikTok error 40002 is a parameter error: a field in the request is missing, in the wrong format, not supported, or incompatible with another field. The response's message names the problem, for example a missing required field. Correct that field against the endpoint's reference, such as business_id, post_info or max_count on the Accounts API, and send the request again.
easyCoexistence adds business_id to every TikTok call it makes for Claude, ChatGPT or your own code, and checks a post before sending it: a video or 1 to 35 images, on HTTPS links, with PNG photos refused because TikTok takes only JPEG or WebP.
TikTok's return code for a parameter error, with the details in the response message.
The status of TikTok's example 40002 response, so the code field, not the status, shows the failure.
Characters, counted in UTF-16, a video caption can hold through the Accounts API, including up to 30 mentions.
Comments per page that /business/comment/list/ accepts in max_count; the default is 20.
The furthest back a start_date can reach when /business/get/ reads account insights.
What does error 40002 mean?
One or more parameters do not fit what the endpoint accepts. TikTok's return code appendix lists 40002 as a parameter error and says to see the error message for details. The causes it names are missing required fields, an incorrect format, unsupported fields or values, fields that are incompatible with each other, invalid data accuracy and an invalid number.
How do you read the response?
Start with the message, which names the field. TikTok's own example, below, comes back with HTTP 200 and the message "Missing required field(s): account_id." Another example in the appendix reads "Time format should be %Y-%m-%dT%H:%M." Keep the request_id as well, since TikTok's references ask for it in issue reports.
HTTPS/1.1 200 OK
{
"code": 40002,
"message": "Missing required field(s): account_id.",
"request_id": "2022110918305001025108614416C7CC00"
}Which Accounts API rules are worth checking?
Each endpoint's reference sets its own. These are the rules behind the calls a connection makes to publish, work with comments and read insights:
- Every call:
business_id, set to theopen_idthat came back with the account's access token. - Video posts:
video_urlandpost_infoare both required,post_infoeven when empty; captions hold up to 2,200 characters. - Photo posts: up to 35 image URLs in
photo_images, aprivacy_levelthe account allows, and a title of up to 90 characters. - Comments:
video_idis a post'sitem_idfrom /business/video/list/,max_countruns from 1 to 30, andcomment_idstakes at most 30. - Replies: text of up to 1,200 characters, or an image in its place.
- Insights: dates written like 2021-06-01, in UTC, reaching back no more than 60 days.
How do you fix it?
Find the field the message names in the endpoint's reference, correct it, and send the request again. The error describes the request itself, so sending it unchanged returns the same code. For values that depend on the account, such as privacy levels or whether comments can be switched on, read the allowed options from /business/video/settings/ before publishing.
What about problems in the media file?
TikTok reports those after the call. The publish endpoints return a share_id for the publishing task while TikTok downloads the file, and when the file breaks a rule, /business/publish/status/ reads FAILED with a reason such as file_format_check_failed, frame_rate_check_failed or picture_size_check_failed. TikTok marks those reasons as not retryable, so the file itself has to change.
Common mistakes
- Sending the same request again. 40002 describes the parameters, so nothing changes until the field the message names is corrected.
- Writing array parameters as plain text. Fields such as fields are sent as JSON arrays, as in TikTok's example ["display_name", "profile_image"].
- Using one privacy setting for every account. The options differ between public and private accounts, so read privacy_level_options from /business/video/settings/ first.
- Setting disable_comment to false on an account whose comments are switched off. When comment_disabled reads true, TikTok accepts only true.
When TikTok still answers 40002, the tool returns its code and message, so your AI can correct the field and try again. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
What is a parameter error in the TikTok API?
It is return code 40002: a field in the request is missing, malformed, unsupported or incompatible with another field, and the message says which.
Why does TikTok send error 40002 with HTTP 200?
TikTok's return codes take precedence over the HTTP status, so a 200 response whose code is not 0 is still a failed call.
Should I retry error 40002?
Only after changing the request. The parameters cause the error, so correct the field the message names before sending it again.
Where do problems with the video file show up?
In the publishing status. Once TikTok has downloaded the media, a file that breaks its rules makes /business/publish/status/ read FAILED, with a reason naming the failed check.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on