Events
Fetch an event again for 30 days: to check a webhook you received, or to process one you missed.
The event object
| Field | Type | Description |
|---|---|---|
id | string | The event's id: the same in every delivery of it (X-SemaLink-Event-Id). |
object | string | Always event. |
type | string | One of message.sent, message.delivered, message.failed, sender_id.approved, sender_id.rejected, message.held, message.released, batch.completed. |
livemode | boolean | |
created_at | string | When it happened. |
data | object | |
data. | object | The message, batch or sender ID as it was then. |
Example
json
{
"id": "evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a",
"object": "event",
"type": "message.delivered",
"livemode": true,
"created_at": "2026-12-01T07:30:06.000Z",
"data": {
"object": {
"id": "msg_3b9f6c2a1d4e4f5a8b7c6d5e4f3a2b1c",
"object": "message",
"livemode": true,
"to": "+254712345678",
"from": "GREENHILL",
"text": "Your order 1042 is ready for collection at Greenhill Shop, Moi Avenue. Call 0712 345 678.",
"type": "service",
"status": "delivered",
"network": "safaricom",
"parts": 1,
"encoding": "gsm7",
"cost": {
"amount": 80,
"currency": "KES",
"display": "KES 0.80"
},
"reference": "invoice-1042",
"batch": null,
"send_at": null,
"created_at": "2026-12-01T07:30:00.000Z",
"sent_at": "2026-12-01T07:30:02.000Z",
"delivered_at": "2026-12-01T07:30:06.000Z",
"failure": null,
"refunded": false
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Get an event
GET
/v1/events/{id}Scope: webhooks:manageAn event as it was delivered (to check a webhook you received, or to replay one), for 30 days. A live key reads live events, a sandbox key the sandbox's.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The evt_... id. |
Returns
200 OK The event. An event object.
Errors
| Status | Code | For example |
|---|---|---|
| 404 | resource_not_found | There's no event evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a for this key. |
Like any request, it can also answer invalid_api_key key_revoked key_expired scope_missing ip_not_allowed browser_requests_not_allowed api_blocked account_suspended rate_limited internal_error request_timeout.
Request
bash
curl https://api.semalink.africa/v1/events/evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a \
-H "Authorization: Bearer $SEMALINK_API_KEY"1
2
2
js
const response = await fetch('https://api.semalink.africa/v1/events/evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a', {
headers: {
Authorization: `Bearer ${process.env.SEMALINK_API_KEY}`,
},
});
const event = await response.json();
console.log(response.status, event);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
python
import os
import requests
response = requests.get(
"https://api.semalink.africa/v1/events/evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a",
headers={
"Authorization": f"Bearer {os.environ['SEMALINK_API_KEY']}",
},
timeout=30,
)
event = response.json()
print(response.status_code, event)1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
php
<?php
$ch = curl_init('https://api.semalink.africa/v1/events/evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SEMALINK_API_KEY'),
],
]);
$event = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
print_r($event);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Response
json
{
"id": "evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a",
"object": "event",
"type": "message.delivered",
"livemode": true,
"created_at": "2026-12-01T07:30:06.000Z",
"data": {
"object": {
"id": "msg_3b9f6c2a1d4e4f5a8b7c6d5e4f3a2b1c",
"object": "message",
"livemode": true,
"to": "+254712345678",
"from": "GREENHILL",
"text": "Your order 1042 is ready for collection at Greenhill Shop, Moi Avenue. Call 0712 345 678.",
"type": "service",
"status": "delivered",
"network": "safaricom",
"parts": 1,
"encoding": "gsm7",
"cost": {
"amount": 80,
"currency": "KES",
"display": "KES 0.80"
},
"reference": "invoice-1042",
"batch": null,
"send_at": null,
"created_at": "2026-12-01T07:30:00.000Z",
"sent_at": "2026-12-01T07:30:02.000Z",
"delivered_at": "2026-12-01T07:30:06.000Z",
"failure": null,
"refunded": false
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
json
{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "There's no event evt_9d8c7b6a5f4e4d3c2b1a0f9e8d7c6b5a for this key.",
"param": "id",
"doc_url": "https://docs.semalink.africa/errors#resource_not_found",
"request_id": "req_5f1d0c2e8a9b4c3d9e7f6a5b4c3d2e1f"
}
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
json
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "This API key isn't one we know. Check it was copied whole, or make a new one in Developer > API keys.",
"doc_url": "https://docs.semalink.africa/errors#invalid_api_key",
"request_id": "req_5f1d0c2e8a9b4c3d9e7f6a5b4c3d2e1f"
}
}1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9