For the complete documentation index, see llms.txt. This page is also available as Markdown.

Webhook Endpoints

Manage Outgoing Webhooks

Get webhook endpoints

get
/v1/webhook-endpoints

This operation returns a list of webhook endpoints with pagination.

Note: This operation needs Authentication.

Authorizations
AuthorizationstringRequired

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

Query parameters
page[size]integer · int32 · min: 1 · max: 1000Optional

The number of resources to return in a single response.

page[before]string · min: 1 · max: 36Optional

Unique identifier.

Pattern: ^[a-zA-Z0-9-]+$
page[after]string · min: 1 · max: 36Optional

Unique identifier.

Pattern: ^[a-zA-Z0-9-]+$
Responses
200

Successful response with webhook endpoints data in JSON:API format.

application/vnd.api+json
get/v1/webhook-endpoints
GET /pos/v1/webhook-endpoints HTTP/1.1
Host: api.mews.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "data": [
    {
      "id": "83f93e1c-b6e1-4040-90cf-3274b6f3c82d",
      "type": "webhookEndpoints",
      "attributes": {
        "targetUrl": "https://example.com/webhooks/receive",
        "secret": "secret",
        "events": [
          "booking.status.updated",
          "product.availability.updated"
        ],
        "createdAt": "2024-10-24T08:44:45.409Z",
        "updatedAt": "2024-10-24T08:44:45.409Z"
      }
    },
    {
      "id": "7f5d9c2a-1b34-4d7e-b2a3-9c51b4f4fabc",
      "type": "webhookEndpoints",
      "attributes": {
        "targetUrl": "https://another.example.com/webhooks",
        "secret": "secret",
        "events": [
          "order.status.updated"
        ],
        "createdAt": "2024-10-23T10:30:00.000Z",
        "updatedAt": "2024-10-23T10:30:00.000Z"
      }
    }
  ],
  "links": {
    "prev": "https://api.mews-demo.com/pos/v1/webhook-endpoints?page%5Bbefore%5D=NA&page%5Bsize%5D=10",
    "next": "https://api.mews-demo.com/pos/v1/webhook-endpoints?page%5Bafter%5D=NA&page%5Bsize%5D=10"
  }
}

Create Webhook endpoint

post
/v1/webhook-endpoints

Use this operation to register a Webhook with Mews to receive notification events that you subscribed to. For more information, including details about supported events, see API Events.

Note: This operation needs Authentication.

Authorizations
AuthorizationstringRequired

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

Body
Responses
201

Webhook endpoint was successfully created.

application/vnd.api+json
post/v1/webhook-endpoints
POST /pos/v1/webhook-endpoints HTTP/1.1
Host: api.mews.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 102

{
  "data": {
    "type": "webhookEndpoints",
    "attributes": {
      "targetUrl": "https://example.com/webhooks/receive"
    }
  }
}
{
  "data": {
    "id": "83f93e1c-b6e1-4040-90cf-3274b6f3c82d",
    "type": "webhookEndpoints",
    "attributes": {
      "targetUrl": "https://example.com/webhooks/receive",
      "secret": "secret",
      "createdAt": "2024-10-24T08:44:45.409Z",
      "updatedAt": "2024-10-24T08:44:45.409Z"
    }
  }
}

Update webhook endpoint

patch
/v1/webhook-endpoints/{id}

This operation updates a webhook endpoint. It allows to subscribe or unsubscribe from events.

Note: This operation needs Authentication.

Authorizations
AuthorizationstringRequired

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

Path parameters
idstring · uuid · min: 36 · max: 36Required

Universally unique ID UUID4.

Example: 83f93e1c-b6e1-4040-90cf-3274b6f3c82d
Body
Responses
200

The WebhookEndpoint was successfully updated.

application/vnd.api+json
patch/v1/webhook-endpoints/{id}
PATCH /pos/v1/webhook-endpoints/{id} HTTP/1.1
Host: api.mews.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 182

{
  "data": {
    "type": "webhookEndpoints",
    "id": "83f93e1c-b6e1-4040-90cf-3274b6f3c82d",
    "attributes": {
      "events": [
        "booking.status.updated"
      ],
      "targetUrl": "https://example.com/webhooks/receive"
    }
  }
}
{
  "data": {
    "id": "83f93e1c-b6e1-4040-90cf-3274b6f3c82d",
    "type": "webhookEndpoints",
    "attributes": {
      "events": [
        "booking.status.updated"
      ],
      "targetUrl": "https://example.com/webhooks/receive",
      "createdAt": "2024-10-24T08:44:45.409Z",
      "updatedAt": "2024-10-24T08:44:45.409Z"
    }
  }
}

Last updated

Was this helpful?