API

/

Webhook

Webhook

Connect a webhook to receive application events in real time.

Register Webhook

You can receive notifications via webhook when an event occurs (e.g., ORDER.PROCESSED).
You can view the full list of events in the Webhook Events section.

New event types are continuously added, and you can choose which events to handle and how.

However, when implementing event listeners, you must ensure that the system continues to operate correctly.

When an event occurs, an HTTP POST request is sent to the configured webhook URL, allowing you to perform subsequent actions accordingly.

<It is recommended to maintain idempotency in your webhook handler to prevent the same event from being processed multiple times.>

Webhook events are attempted to be delivered once to the specified URL. If delivery fails (due to a timeout or an HTTP response code other than 200), they are retried up to three times using an exponential backoff algorithm. Events are executed immediately upon creation.

<It is recommended to use the eventId as an idempotency key to ensure that retried events are not processed multiple times.>

Webhook registration is only available via API requests.

This API registers a webhook URL to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.
You can register up to one webhook URL.

POST

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Request body

Field

Type

Description

url

string

webhook URL

Response

Field

Type

Description

secret

string

webhook secret key

Retrieve Webhook

This API retrieves the webhook URL used to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.

GET

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Response

Field

Type

Description

url

string

webhook URL

Delete Webhook

This API deletes the webhook URL used to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.

DELETE

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Webhook Security (Optional)

Payload Verification

When an API key is set, MORI generates an HMAC SHA-256 hash signature using the entire webhook request payload. This signature is hex-encoded and included in the X-Mori-Signature header when the request is sent.

When verifying the signature, compare the generated hash value with the X-Mori-Signature header value:

· Match: The request has passed verification.

· Mismatch: The request may have been tampered with or forged during transmission.

Example Code

Example Code

Webhook Events

Events are used to record significant changes to resources.

Once an event is created, it is delivered via a webhook call.

Event Type:

{{RESOURCE}}.{{FEATURE}}.{{EVENT}}

Event Type

Description

ORDER.ANTI_AI.PROCESSED

Triggered when a watermarking order has been completed.

{

"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",

"eventType": "ORDER.ANTI_AI.PROCESSED",

"occuredAt": "2024-01-01T12:00:00.000Z",

"data": {

"orderId": 123456789,

"createdAt": "2024-01-01T11:00:00.000Z",

"updatedAt": "2024-01-01T12:00:00.000Z",

"status": "complete"

}

}

ORDER.WTR_EMBED.PROCESSED

Triggered when an invisible watermark embed order has been completed.

{
"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",
"eventType": "ORDER.ANTI_AI.PROCESSED",
"occuredAt": "2024-01-01T12:00:00.000Z",
"data": {
"orderId": 123456789,
"createdAt": "2024-01-01T11:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z",
"status": "complete"
}
}

ORDER.WTR_EXTRACT.PROCESSED

Triggered when an invisible watermark extract order has been completed.

{
"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",
"eventType": "ORDER.ANTI_AI.PROCESSED",
"occuredAt": "2024-01-01T12:00:00.000Z",
"data": {
"orderId": 123456789,
"createdAt": "2024-01-01T11:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z",
"status": "complete"
}
}

API

/

Webhook

Webhook

Connect a webhook to receive application events in real time.

Register Webhook

You can receive notifications via webhook when an event occurs (e.g., ORDER.PROCESSED).
You can view the full list of events in the Webhook Events section.

New event types are continuously added, and you can choose which events to handle and how.

However, when implementing event listeners, you must ensure that the system continues to operate correctly.

When an event occurs, an HTTP POST request is sent to the configured webhook URL, allowing you to perform subsequent actions accordingly.

<It is recommended to maintain idempotency in your webhook handler to prevent the same event from being processed multiple times.>

Webhook events are attempted to be delivered once to the specified URL. If delivery fails (due to a timeout or an HTTP response code other than 200), they are retried up to three times using an exponential backoff algorithm. Events are executed immediately upon creation.

<It is recommended to use the eventId as an idempotency key to ensure that retried events are not processed multiple times.>

Webhook registration is only available via API requests.

This API registers a webhook URL to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.
You can register up to one webhook URL.

POST

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Request body

Field

Type

Description

url

string

webhook URL

Response

Field

Type

Description

secret

string

webhook secret key

Webhook Security (Optional)

Payload Verification

When an API key is set, MORI generates an HMAC SHA-256 hash signature using the entire webhook request payload. This signature is hex-encoded and included in the X-Mori-Signature header when the request is sent.

When verifying the signature, compare the generated hash value with the X-Mori-Signature header value:

· Match: The request has passed verification.

· Mismatch: The request may have been tampered with or forged during transmission.

Example Code

Example Code

Webhook Events

Events are used to record significant changes to resources.

Once an event is created, it is delivered via a webhook call.

Event Type:

{{RESOURCE}}.{{FEATURE}}.{{EVENT}}

Event Type

Description

ORDER.ANTI_AI.PROCESSED

Triggered when a watermarking order has been completed.

{

"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",

"eventType": "ORDER.ANTI_AI.PROCESSED",

"occuredAt": "2024-01-01T12:00:00.000Z",

"data": {

"orderId": 123456789,

"createdAt": "2024-01-01T11:00:00.000Z",

"updatedAt": "2024-01-01T12:00:00.000Z",

"status": "complete"

}

}

ORDER.WTR_EMBED.PROCESSED

Triggered when an invisible watermark embed order has been completed.

{
"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",
"eventType": "ORDER.ANTI_AI.PROCESSED",
"occuredAt": "2024-01-01T12:00:00.000Z",
"data": {
"orderId": 123456789,
"createdAt": "2024-01-01T11:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z",
"status": "complete"
}
}

ORDER.WTR_EXTRACT.PROCESSED

Triggered when an invisible watermark extract order has been completed.

{
"eventId": "7dddea77-232c-4ae7-a880-ba9e11563762",
"eventType": "ORDER.ANTI_AI.PROCESSED",
"occuredAt": "2024-01-01T12:00:00.000Z",
"data": {
"orderId": 123456789,
"createdAt": "2024-01-01T11:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z",
"status": "complete"
}
}

Retrieve Webhook

This API retrieves the webhook URL used to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.

GET

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Response

Field

Type

Description

url

string

webhook URL

Delete Webhook

This API deletes the webhook URL used to receive order processing result events.
An {{API_KEY}} is required to authenticate the API request.

DELETE

https://{{API_DOMAIN}}/api/v2/webhook

Request Headers

Key

Value

Authorization

Bearer {{API_KEY}}

Field