---
title: "Events and subscriptions | Docs | WMS by R&D Copilot"
description: "Register an endpoint for events, read the events and their delivery state, and replay a parked event."
canonical: "https://warehouse.rdcopilot.com/docs/api-reference/events/"
language: en
updated: 2026-11-22
---

# Events and subscriptions

Register an endpoint for events, read the events and their delivery state, and replay a parked event.

## List events

GET `/warehouse/v1/events`

Returns the events of your subscriptions in pages, the newest first, with the state of their delivery.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `state` | query | `string` | Nooptional | Only events in this delivery state. One of `delivered`, `retrying`, `parked`, `replayed` |
| `limit` | query | `integer` | Nooptional | Records per page. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of records. | `EventPage` |
| `400` | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. `fields` names each one. | `Error` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `429` | The request was refused. The `code` is `rate_limited`. | `Error` |
| `503` | The request was refused. The `code` is `unavailable`. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/warehouse/v1/events?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/events?limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/events?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/events?limit=20');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/events?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "items": [
    {
      "id": "7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21",
      "type": "com.rdcopilot.warehouse.pick_task.confirmed.v1",
      "time": "2026-11-23T08:00:00Z",
      "aggregateId": "a1000000-0000-4000-8000-000000023106",
      "state": "parked",
      "attempts": 6
    }
  ],
  "nextCursor": null
}
```

## Replay an event

POST `/warehouse/v1/events/{eventId}/replay`

Sends a parked event again, with the same `id`, to the subscriptions it belongs to.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `eventId` | path | `string (uuid)` | Yesrequired | The event. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result. | `OperationResult` |
| `400` | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. `fields` names each one. | `Error` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `404` | The request was refused. The `code` is `event_not_found`. | `Error` |
| `409` | The request was refused. The `code` is `operation_reused`. | `Error` |
| `429` | The request was refused. The `code` is `rate_limited`. | `Error` |
| `503` | The request was refused. The `code` is `unavailable`. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/warehouse/v1/events/7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21/replay" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "e0316720-65f8-4a68-85fb-7ce0c57cf0e8"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/events/7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21/replay`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "e0316720-65f8-4a68-85fb-7ce0c57cf0e8"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/events/7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21/replay',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'e0316720-65f8-4a68-85fb-7ce0c57cf0e8',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "e0316720-65f8-4a68-85fb-7ce0c57cf0e8"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/events/7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21/replay');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/events/7d3a1c58-2e94-4b06-a1f7-93c5e08b4d21/replay");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "e0316720-65f8-4a68-85fb-7ce0c57cf0e8"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "e0316720-65f8-4a68-85fb-7ce0c57cf0e8",
  "status": "accepted",
  "aggregateRevision": 1
}
```

## Create a subscription

POST `/warehouse/v1/subscriptions`

Registers an HTTPS endpoint of yours for the event types you name. Every delivery is signed with the secret of the subscription; the answer carries the secret once.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `endpoint` | `string` | Yesrequired | The HTTPS address that receives the events. |
| `eventTypes` | `string[]` | Yesrequired | The event types to send, for example `com.rdcopilot.warehouse.pick_task.confirmed.v1`. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result and `secret`, the signing secret of the subscription. It is returned in this answer only. | `SecretOperationResult` |
| `400` | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. `fields` names each one. | `Error` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `409` | The request was refused. The `code` is `operation_reused`. | `Error` |
| `429` | The request was refused. The `code` is `rate_limited`. | `Error` |
| `503` | The request was refused. The `code` is `unavailable`. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/warehouse/v1/subscriptions" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "3b1d121a-d316-4b90-8885-312604838490",
  "endpoint": "https://hooks.brumar.example/warehouse",
  "eventTypes": [
    "com.rdcopilot.warehouse.pick_task.confirmed.v1",
    "com.rdcopilot.warehouse.shipment.dispatched.v1"
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/subscriptions`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "3b1d121a-d316-4b90-8885-312604838490",
    "endpoint": "https://hooks.brumar.example/warehouse",
    "eventTypes": [
      "com.rdcopilot.warehouse.pick_task.confirmed.v1",
      "com.rdcopilot.warehouse.shipment.dispatched.v1"
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/subscriptions',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '3b1d121a-d316-4b90-8885-312604838490',
        'endpoint': 'https://hooks.brumar.example/warehouse',
        'eventTypes': [
            'com.rdcopilot.warehouse.pick_task.confirmed.v1',
            'com.rdcopilot.warehouse.shipment.dispatched.v1',
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "3b1d121a-d316-4b90-8885-312604838490",
  "endpoint": "https://hooks.brumar.example/warehouse",
  "eventTypes": [
    "com.rdcopilot.warehouse.pick_task.confirmed.v1",
    "com.rdcopilot.warehouse.shipment.dispatched.v1"
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/subscriptions');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/subscriptions");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "3b1d121a-d316-4b90-8885-312604838490",
  "endpoint": "https://hooks.brumar.example/warehouse",
  "eventTypes": [
    "com.rdcopilot.warehouse.pick_task.confirmed.v1",
    "com.rdcopilot.warehouse.shipment.dispatched.v1"
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "3b1d121a-d316-4b90-8885-312604838490",
  "status": "accepted",
  "aggregateRevision": 1,
  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
}
```

## Rotate the secret of a subscription

POST `/warehouse/v1/subscriptions/{subscriptionId}/secret`

Issues a new signing secret and returns it once. For 24 hours every delivery carries two signatures, one for each secret; after that only the new one.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | `string (uuid)` | Yesrequired | The subscription. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result and `secret`, the signing secret of the subscription. It is returned in this answer only. | `SecretOperationResult` |
| `400` | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. `fields` names each one. | `Error` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `404` | The request was refused. The `code` is `subscription_not_found`. | `Error` |
| `409` | The request was refused. The `code` is `operation_reused`. | `Error` |
| `429` | The request was refused. The `code` is `rate_limited`. | `Error` |
| `503` | The request was refused. The `code` is `unavailable`. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/warehouse/v1/subscriptions/b7e2c4a9-5d13-4f68-8a07-1c9e3d5f2b60/secret" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "a9fb3b31-f99b-4571-856c-2aef9353dc81"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/subscriptions/b7e2c4a9-5d13-4f68-8a07-1c9e3d5f2b60/secret`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "a9fb3b31-f99b-4571-856c-2aef9353dc81"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/subscriptions/b7e2c4a9-5d13-4f68-8a07-1c9e3d5f2b60/secret',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'a9fb3b31-f99b-4571-856c-2aef9353dc81',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "a9fb3b31-f99b-4571-856c-2aef9353dc81"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/subscriptions/b7e2c4a9-5d13-4f68-8a07-1c9e3d5f2b60/secret');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/subscriptions/b7e2c4a9-5d13-4f68-8a07-1c9e3d5f2b60/secret");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "a9fb3b31-f99b-4571-856c-2aef9353dc81"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "a9fb3b31-f99b-4571-856c-2aef9353dc81",
  "status": "accepted",
  "aggregateRevision": 2,
  "secret": "whsec_Zm9yIHRoZSBuZXcgc2VjcmV0IG9mIGEgc3Vic2NyaXB0aW9u"
}
```
