Errors

The API uses standard HTTP status codes. Errors return a JSON body, and the codes in error_code tell you what went wrong so you can show the user a clear message.

Error Format

{
  "name": "payment-required",
  "message": "payment-required",
  "error_code": "clip_limit_reached",
  "required_plan": "pro"
}

Fields

  • name (string): Error category (e.g., "bad-request", "unauthenticated", "payment-required", "not-found", "conflict", "unprocessable-entity").
  • message (string): Description of the error. It can be terse: don’t show it to users as is.
  • error_code (string, optional): Machine-readable reason, on 402, 409 and 422 errors. See the tables below.
  • required_plan (string, optional): On 402 errors, the Klap plan that includes the action ("basic", "pro", "pro-plus").

Some 402 responses contain only error_code and message. A failed download (504) returns { "error": "Export timed out or failed." }.

Status Codes

StatusMeaningWhat to do
400Invalid parameters or body. message describes the problemFix the request
401Missing, expired or invalid access tokenRefresh the token and retry. If the refresh fails, ask the user to reconnect their Klap account
402Not included in the user’s plan, plan limit reached, or subscription not activeSee Payment Required
404The resource doesn’t exist or isn’t in the user’s accountCheck the ID
409The posts can’t be scheduledSee Conflicts
422Klap can’t use the videoSee Unprocessable Video
503Scheduling is busyRetry shortly, with the same post IDs
504A download timed out or its export failedCheck the export with Get Export
5xxKlap is temporarily unavailableRetry in a minute

Payment Required (402)

The action isn’t available on the user’s current plan or subscription. Plans are described at https://klap.app/pricing.

error_codeMeaning
subscription_pausedThe user’s Klap subscription is paused. They can update it at https://klap.app/billing
subscription_past_dueThe user’s Klap subscription is past due. They can update it at https://klap.app/billing
video_limit_reachedThe user reached their plan’s video limit
clip_limit_reachedThe clips this video would produce exceed the user’s remaining clip allowance
credit_limit_reachedThe user reached their plan’s credit limit
upload_limit_reachedThe user reached their plan’s upload limit
export_limit_reachedThe user reached their plan’s export allowance
payment_requiredThe action requires a paid plan
country_black_listedThe free trial isn’t available in the user’s country: a paid plan is required

Other values are possible. Treat any other 402 as “not included in the user’s current plan”, and mention required_plan when it’s present.

Conflicts (409)

Returned by Schedule Posts. None of the posts in the request were saved.

error_codeMeaning
account_disconnectedA social account is no longer connected. The user must reconnect it at https://klap.app/calendar
duplicate_postThe clip already has a post on that platform
youtube_capacityYouTube’s daily posting capacity is reached for that day. Choose another day
publication_existsA post with this id already exists: an earlier request with the same post went through

Unprocessable Video (422)

Returned by Create Project from Video when Klap can’t use the video. No project is created.

error_codeMeaning
invalid_videoKlap couldn’t read the video. Use a public link or a direct link to the file
yt_video_not_availableThe YouTube video isn’t available
drm_protectedThe video is DRM-protected
age_restrictedThe YouTube video is age-restricted
not_available_in_USThe YouTube video isn’t available in the United States
video_too_shortThe video is too short to clip (minimum 10 seconds)
video_too_longThe video is longer than the user’s plan allows
no_audio_streamThe video has no audio
no_video_streamThe file has no video track

Project Error Codes

When a project ends with status "error", its error_code says why:

error_codeMeaning
no_clip_generatedKlap couldn’t find clip-worthy moments in this video
not_enough_tokens, no_speech_detectedThe video doesn’t have enough speech to find clips
video_privateThe YouTube video is private
video_members_onlyThe YouTube video is for channel members only
video_removedThe YouTube video was removed
video_age_restrictedThe YouTube video is age-restricted
external_download_failedKlap couldn’t download the video

Other values are possible. Treat them as “Klap couldn’t process this video”.