Webhooks
Get a POST request from Meshy when one of your API tasks makes progress or finishes, instead of polling for it.
Moving from v1? A webhook keeps its v1 payload until you switch it. See Switch a webhook to v2.
Set up a webhook
To add a webhook, open the Webhooks page in the Developer Platform and click Create Webhook.
- In Payload URL, enter the URL that receives the deliveries. Meshy delivers only over
https://, and the URL's host must resolve to a public IPv4 address. - Leave Payload version on v2. See Payload versions.
- Keep a copy of the Webhook Secret that the dialog fills in. Every delivery carries it, so your server can check that a request came from Meshy.
- Check your server with Send test before you save. See Test a webhook.
- Keep Active on, and click Confirm.
Each account can have 5 active webhooks, and 10 in total. Every active webhook receives the deliveries of the API tasks that run as the Meshy user who signs in to the Webhooks page. A team API key runs as the team owner, so the team owner signs in to see, test, and switch the team's webhooks.
Payload versions
Each webhook has a payload version, v1 or v2. It sets the body of the webhook's deliveries:
- v2: the v2 task object, the same object
GET /openapi/v2/tasks/{id}returns, for every task type. - v1: the v1 task object of the endpoint that created the task. See the v1 Webhooks page.
The version belongs to the webhook, not to the API version that created the task. A task you create on v1 reaches a v2 webhook as the v2 task object. A task you create on v2 reaches a v1 webhook as the v1 body. Moving your API calls to v2 doesn't change your webhooks.
Creative Lab endpoints aren't part of API v2. Their deliveries keep their v1 body and the v1 header, even on a v2 webhook.
Deliveries
Meshy sends a delivery while a task is IN_PROGRESS, and another when the task reaches a final status. A task can reach its final status without an IN_PROGRESS delivery.
Each delivery is a POST to your Payload URL with a JSON body and these headers:
| Header | Value |
|---|---|
Meshy-Webhook-Version | v2 when the body is the v2 task object, v1 when it's the v1 body |
X-MESHY-API-WEBHOOK-SECRET-KEY | The webhook's secret |
X-MESHY-API-WEBHOOK-USER-ID | The ID of the Meshy user who owns the webhook |
Content-Type | application/json |
User-Agent | MeshyAPIWebhook/1.0.0 |
Read the body by the Meshy-Webhook-Version header, not by the webhook's version. The header names the format of that one delivery, and a Creative Lab delivery on a v2 webhook is v1.
A v2 delivery's body is the task object as GET /openapi/v2/tasks/{id} returns it, except progress. A delivery sends progress as one of these values:
50while the task isIN_PROGRESS100when the task succeeds0when the task fails or is canceled
To read the task's latest progress, get the task.
A v2 delivery
POST /meshy-webhook HTTP/1.1
Content-Type: application/json
Meshy-Webhook-Version: v2
User-Agent: MeshyAPIWebhook/1.0.0
X-MESHY-API-WEBHOOK-SECRET-KEY: ********************************
X-MESHY-API-WEBHOOK-USER-ID: ***
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1791846275575,
"started_at": 1791846275578,
"finished_at": 1791846334536,
"expires_at": 1792105534536,
"preceding_tasks": 0,
"consumed_credits": 30,
"task_error": null,
"input": {
"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
"texture_model": "meshy-7"
},
"output": {
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": null,
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": null,
"roughness": null,
"normal": null,
"metallic_roughness": null,
"emission": null
}
]
}
}
Handle a delivery
To accept a delivery, respond with a status below 400, such as 200 or 202. Meshy waits about 25 seconds for the response, so store the delivery and respond first. Do the slow work after that, such as downloading the model.
A status of 400 or above, or no response, counts as a failed delivery. Meshy retries it with longer waits between attempts, up to 4 times for an IN_PROGRESS update and up to 9 times for a final status. If 20 updates in a row fail every attempt, Meshy can deactivate the webhook. To turn it back on, edit it on the Webhooks page and select Active.
Write your code for these cases:
- Deliveries can arrive out of order. An
IN_PROGRESSdelivery can arrive after the final one, so don't let it replace a final status. - The same update can arrive more than once. Handle each pair of
idandstatusonce. - Anyone who knows your URL can send it a request. Compare
X-MESHY-API-WEBHOOK-SECRET-KEYwith your copy of the secret, and reject a request that doesn't match.
If a task's final delivery hasn't arrived after about twice the task's typical time, get the task. For typical times, see Processing times.
Receive a delivery
import hmac
import os
from flask import Flask, request
app = Flask(__name__)
SECRET = os.environ["MESHY_WEBHOOK_SECRET"]
@app.post("/meshy-webhook")
def meshy_webhook():
sent = request.headers.get("X-MESHY-API-WEBHOOK-SECRET-KEY", "")
if not hmac.compare_digest(sent, SECRET):
return "", 401
task = request.get_json()
# The same update can arrive twice. Handle each id and status once.
if already_handled(task["id"], task["status"]):
return "", 200
if request.headers.get("Meshy-Webhook-Version") == "v2":
save_v2(task) # results under task["output"]
else:
save_v1(task) # Creative Lab, or a webhook on v1
return "", 200
Test a webhook
Send test on the Webhooks page sends one of your tasks to a URL and shows you what your server answered. It works in the Create and Edit dialogs, before you save.
- Click Create Webhook, or edit a webhook.
- Enter the Payload URL, and set Payload version to the version you want to test.
- Under Test before saving, pick a task and click Send test. The list shows your 10 newest finished API tasks created in the last 30 days.
- Check the result. Any status below 400 counts as delivered. The response body is shown as your server returned it, up to the first 64 KiB. To see the exact request, open What we sent.


A test has the same body and headers as a real delivery of that task, plus Meshy-Webhook-Test: true. Real deliveries never have this header. Your code handles a test the same way as a real delivery. So when this header is true, skip paid follow-up work, such as a Retexture you start after an Image to 3D task succeeds.
A test doesn't count as a delivery, and it doesn't change your webhook. To close the dialog without saving, click Cancel. You can send up to 10 tests a minute.
Test on your computer
Meshy delivers only to a public https:// URL, so it can't reach a server on your computer directly. To test code on your computer, forward a public URL to it with a webhook proxy. These steps use smee.io, and any webhook proxy works the same way.
-
Open smee.io and click Start a new channel. Copy the Webhook Proxy URL.
-
Install the smee client:
npm install --global smee-client -
Forward the channel to your server. Replace
WEBHOOK_PROXY_URLwith your Webhook Proxy URL, and the path and port with your server's:smee --url WEBHOOK_PROXY_URL --path /meshy-webhook --port 3000Keep it running while you test. To stop forwarding, press Ctrl+C.
-
Use the Webhook Proxy URL as the Payload URL in Send test, or in a webhook.
Switch a webhook to v2
A webhook on v1 keeps receiving v1 deliveries until you switch it. To switch it without missing an update:
- Update the code behind the webhook's URL so it accepts both versions. Branch on the
Meshy-Webhook-Versionheader, as in Handle a delivery. - Edit the webhook and set Payload version to v2. Check your code with Send test. The webhook stays on v1 until you save.
- Click Save. From then on, the webhook receives v2 deliveries for every task except Creative Lab.
To switch back, set Payload version to v1. Switching doesn't resend past deliveries. If your code missed any, read those tasks with GET /openapi/v2/tasks/{id}, or with their v1 routes for Creative Lab.
For the full steps with screenshots, see Move your webhooks to v2 in the migration guide. For how the v1 and v2 bodies differ, see Webhook payloads.