Sign in with Klap (OAuth)Overview

Sign in with Klap (OAuth)

Let users connect their Klap account to your app, then clip videos, export clips and schedule social posts on their behalf.

Overview

This is the API behind Klap’s Zapier, Make and n8n integrations. Use it to build any third-party app or automation that works with a user’s own Klap account.

  • Authentication: OAuth 2.1 authorization code flow with PKCE. The user signs in with Klap and approves your app, and your app gets an access token. See Authentication.
  • Billing: Everything your app does is billed against the signed-in user’s Klap subscription, exactly as if they used klap.app. Their plan’s limits apply. There are no API keys or API credits involved.

This API is separate from the API-key API documented in the rest of these docs (base URL https://api.klap.app/v2, billed per operation to your organization). API keys don’t work on the endpoints below, and OAuth access tokens don’t work on /v2 endpoints.

Key Concepts

TermMeaningPaths
ProjectOne long video the user clipped, together with the clips Klap made from it/tasks, /tasks/{project_id}/...
ClipOne short video generated from a project/projects/{clip_id}/...
ExportA clip rendered to an MP4 file/projects/{clip_id}/exports/...

Endpoints under /tasks manage projects. Endpoints under /projects/{clip_id} act on a single clip: there, {clip_id} is the id of a Clip Object.

Making Requests

  • Base URL: All requests should be made to https://api.klap.app (no /v2).
  • Authorization: Every request must include the user’s access token in the header: Authorization: Bearer <access_token>.
  • Format: JSON is used for request bodies (Content-Type: application/json) and responses.
  • Rate limits: There is no fixed rate limit, but keep polling modest: check each processing project or export at an interval of several seconds or more, and keep each polling cycle to a few requests.

Typical Workflow

  1. Connect the user: Run the OAuth flow and store the access and refresh tokens.
  2. Create a project: Send a video link to Create Project from Video. To clip a file, upload it first.
  3. Wait for the clips: Clipping takes several minutes. Poll Get Project (or List Projects) until status is ready.
  4. Get the clips: List Project Clips returns the clips, best first.
  5. Export a clip: Start an export and poll Get Export until it’s ready. Its src_url is the MP4 file.
  6. Post it (optional): Write a caption and schedule posts to the user’s connected social accounts.

There are no webhooks: detect finished projects and exports by polling.

Endpoints

MethodPathDescription
POST/tasks/video-to-shortsCreate a project from a video
GET/tasks/{project_id}Get a project
GET/tasksList recent projects
GET/tasks/{project_id}/clipsList a project’s clips
GET/projects/{clip_id}/taskGet the project a clip belongs to
POST/media/uploadGet a file upload URL
PUT<signed_upload_url>Upload the file
GET/media/upload?filename={filename}Get the uploaded file’s URL
POST/projects/{clip_id}/exportsStart an export
GET/projects/{clip_id}/exports/{export_id}Get an export
GET/projects/{clip_id}/download?export_id={id}Download an export as MP4
GET/projects/{clip_id}/captionWrite a social caption with AI
GET/integrations/accountsList connected social accounts
POST/integrations/publications/batchSchedule posts

Object Formats and Errors

For the data structures returned by these endpoints, see Object Formats. For error responses and codes, see Errors.

Support

Questions or a client ID for your app: support@klap.app.