Creating a Webhook

To register a webhook endpoint for your organization:
  1. Navigate to the Webhooks section in your Ayna API Platform sidebar
  2. Click Create New Webhook to register your endpoint
  3. Enter your webhook URL that will receive the event notifications
  4. Save your webhook configuration
Each organization can register only one webhook endpoint at a time.

Webhook Triggers

Webhooks are automatically triggered when try-on jobs reach a terminal state:
  • Successful completion - When a try-on job completes successfully
  • Failed execution - When a try-on job fails to complete
Your registered webhook endpoint will receive a POST request with the job details and status information whenever these events occur.

Webhook Request Payload

When a webhook is triggered, your endpoint will receive a JSON payload with the following structure:

Success Request

{
  "model": "ayna-1.0",
  "status": "completed",
  "output": {
    "image": "https://cdn.getayna.com/outputs/1752555896712.png"
  },
  "error": null
}

Failure Request

{
  "model": "ayna-1.0",
  "status": "failed", 
  "output": {
    "image": null
  },
  "error": {
    "code": "IMAGE_LOAD_ERROR",
    "message": "Error message describing the failure reason"
  }
}
Request Fields:
  • model - The AI model version used for the try-on job (e.g., “ayna-1.0”)
  • status - Job completion status: "completed" for success, "failed" for errors
  • output - Contains the generated output data
    • image - Direct URL to the generated try-on image (success) or null (failure)
  • error - Error object explaining the failure reason (failure only). Contains:
    • code (string) - Error code identifier
    • message (string) - Human-readable error message