Webhooks
curl --location --request POST 'https://muapi.ai/api/v1/endpoint/generate_wan_ai_effects?webhook=https://your.app.user/endpoints' \
--header "Content-Type: application/json" \
--header "x-api-key: {MUAPIAPP_API_KEY}" \
--data-raw '{"param1": "value1", "param2": "value2"}
import requests
import json
url = "https://muapi.ai/api/v1/endpoint/generate_wan_ai_effects"
params = {
"webhook": "https://your.app.user/endpoints"
}
headers = {
"x-api-key": f"{MUAPIAPP_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"param1": "value1",
"param2": "value2"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
When your webhook is triggered, it will receive a POST request containing the result of the task. The response format includes status information and relevant metadata:
When your webhook endpoint is called, you’ll receive a POST request with the following structure:
{
"id": "<task_id>",
"outputs": [
"<output_url>" // Present only if the task is successful
],
"urls": {
"get": "https://api.muapi.ai/api/v1/predictions/<task_id>/result"
},
"has_nsfw_contents": [
false
],
"status": "completed", // or "failed"
"created_at": "<created_at>",
"error": "<error>", // Present if status is "failed"
"executionTime": "<time>",
"timings": {
"inference": "<time>"
}
}