Upload Custom Motion
October 7, 2025
Table of contents
This endpoint allows you to upload a custom video to extract motion data from it. The extracted motion can then be used with the POST /videos/motion-create endpoint to apply the motion to different images.
https://api.useapi.net/v1/kling/videos/motion-upload
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"resourceUrl": "https://s21-kling.klingai.com/.../video.mp4",
"coverUrl": "https://s21-kling.klingai.com/.../image.jpg",
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
email
is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required. -
resourceUrl
is required, URL to the video containing the motion to extract. Video should show a person performing the motion you want to capture.
Must be uploaded via POST /assets first - use theresourceUrl
field from the response. -
coverUrl
is required, URL to a cover image for the motion. Must be uploaded via POST /assets first - use thecoverUrl
field from the response. -
maxJobs
is optional, range from1
to50
. Specifies the maximum number of concurrent jobs. -
replyUrl
is optional, a callback URL to receive generation progress and result. See GET /tasks/task_id
for response model. -
replyRef
is optional, a reference identifier for the callback.
Notes:
- The video must be between 2 and 10 seconds long, otherwise it will be rejected
- The video should contain a clear view of a person performing the desired motion
- The system will extract the motion data (BVH and binary formats) from the video
- Once processed, the motion will appear in your user motions list (GET /videos/motions with
mine=true
) - To delete a user-uploaded motion, use DELETE /tasks/
task_id
with the motion’staskId
from the motions list
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "motion_control_motion_process", "scene": "MOTION_EXTRACTION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "motion_control_motion_process", "inputs": [ { "name": "input", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://s21-kling.klingai.com/.../video.mp4", "cover": "https://s21-kling.klingai.com/.../image.jpg", "fromWorkId": 0, "fromUploadId": "" } ], "arguments": [ { "name": "prompt", "value": "" }, { "name": "motionType", "value": "video2motion" }, { "name": "biz", "value": "klingai" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "MOTION_EXTRACTION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1745376611075, "updateTime": 1745376611075 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "limitation": { "type": "motion_control_motion_process", "remaining": 10000, "limit": 10000 }, "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null }
-
{ "error": "Parameter resourceUrl is required" }
-
{ "error": "Unauthorized", "code": 401 }
-
Kling was unable to locate one of the referenced assets. Make sure to use POST /assets to upload assets.
{ "error": "Sorry, the requested resource was not found (VALID.ResourceNotFound)", "message": "Not Found" }
-
Kling uses a
500
response to indicate moderation and other issues with the input. It may be hard to separate actual 500 errors from moderation errors, so use theerror
field text and your best judgement to tell them apart, since themessage
field most often has very generic and perhaps misleading text.{ "error": "The content you uploaded appears to violate the community guidelines. (CM_EXT.POther)", "message": "Service busy (CM_EXT.POther)" }
When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id
. Once processing completes, the extracted motion will be available in GET /videos/motions with mine=true
.
Model
{ // TypeScript, all fields are optional
task: {
id: number
userId: number
type: string
scene: string
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
taskInfo: {
type: string
inputs: Array<{
name: string
inputType: string
token: string | null
blobStorage: any | null
url: string
cover: string | null
fromWorkId: number
fromUploadId: string
}>
arguments: Array<{
name: string
value: string
}>
extraArgs: Record<string, any>
callbackPayloads: any[]
scene: string
}
favored: boolean
deleted: boolean
viewed: boolean
createTime: number
updateTime: number
viewTime: number
}
works: Array<any>
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
message: string
error: string
limitation: {
type: string
remaining: number
limit: number
}
userPoints: {
points: Array<{
orderId: string
type: string
amount: number
balance: number
startTime: number
endTime: number
}>
total: number
}
userTickets: {
ticket: Array<{
orderId: string
type: string
packageType: string
amount: number
balance: number
startTime: number
endTime: number
}>
}
editProject: any | null
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/videos/motion-upload" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "resourceUrl": "https://s21-kling.klingai.com/.../video.mp4", "coverUrl": "https://s21-kling.klingai.com/.../image.jpg" }'
-
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/videos/motion-upload"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, resourceUrl: "https://s21-kling.klingai.com/.../video.mp4", coverUrl: "https://s21-kling.klingai.com/.../image.jpg" }) }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" email = "Previously configured account email" apiUrl = "https://api.useapi.net/v1/kling/videos/motion-upload" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "resourceUrl": "https://s21-kling.klingai.com/.../video.mp4", "coverUrl": "https://s21-kling.klingai.com/.../image.jpg" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())