Request & Response Example

General Notes

  • All requests must include x-api-key and x-project-id headers.

  • Responses are in standard JSON format.

  • Error responses include details about the error - The base URL for all API endpoints is 'https://api.biamo.dev.

List API Keys

Retrieve all API keys associated with your project.

Request

index.js
1curl --request GET \
2 --url https://api.biamo.dev/api/developer/api-keys \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1[
2 {
3 "id": "key_01H7Q1X3XYZ123",
4 "name": "Production Key",
5 "created_at": "2025-04-26T14:32:00Z",
6 "last_used_at": "2025-04-26T15:00:00Z"
7 },
8 {
9 "id": "key_01H7Q2X4ABC456",
10 "name": "Staging Key",
11 "created_at": "2025-04-22T09:15:00Z",
12 "last_used_at": "2025-04-26T10:05:00Z"
13 }
14]
15

Create API Key

Generate a new API key for your project.

Request

index.js
1curl --request POST \
2 --url https://api.biamo.dev/api/developer/api-keys \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID" \
5 --header "Content-Type: application/json" \
6 --data '{
7 "name": "New Mobile App Key"
8 }'
9

Successful Response

index.js
1{
2 "id": "key_01H9Q1X5NEWKEY",
3 "key": "bm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
4 "name": "New Mobile App Key",
5 "project_id": "YOUR_PROJECT_ID",
6 "module_id": null,
7 "created_at": "2025-04-26T16:00:00Z"
8}
9

Delete API Key

Revoke an API key by ID.

Request

index.js
1curl --request DELETE \
2 --url https://api.biamo.dev/api/developer/api-keys/key_01H7Q1X3XYZ123 \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1{
2 "success": true
3}
4

List

Retrieve all registered webhook endpoints for your project.

Request

index.js
1curl --request GET \
2 --url https://api.biamo.dev/api/developer/webhooks \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1[
2 {
3 "id": "wh_01H8ZX1XYZ987",
4 "url": "https://yourapp.com/webhooks",
5 "event": "billing.payment_updated",
6 "description": "Payment webhook",
7 "created_at": "2025-04-26T15:05:00Z"
8 }
9]
10

Register Webhook

Create a new webhook endpoint and select an event to listen for.

Request

index.js
1curl --request POST \
2 --url https://api.biamo.dev/api/developer/webhooks \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID" \
5 --header "Content-Type: application/json" \
6 --data '{
7 "url": "https://yourapp.com/webhooks",
8 "event": "billing.payment_updated",
9 "description": "Payment webhook"
10 }'
11

Successful Response

index.js
1{
2 "id": "wh_01H8ZX1XYZ987",
3 "url": "https://yourapp.com/webhooks",
4 "event": "billing.payment_updated",
5 "description": "Payment webhook",
6 "project_id": "YOUR_PROJECT_ID",
7 "module_id": null,
8 "created_at": "2025-04-26T15:05:00Z"
9}

Delete Webhook

Delete a registered webhook endpoint.

Request

index.js
1curl --request DELETE \
2 --url https://api.biamo.dev/api/developer/webhooks/wh_01H8ZX1XYZ987 \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1{
2 "success": true
3}
4

Retrieve Webhook Logs

Retrieve recent webhook delivery logs for troubleshooting.

Request

index.js
1curl --request GET \
2 --url https://api.biamo.dev/api/developer/logs/webhooks \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1{
2 "logs": [
3 {
4 "id": "log_1",
5 "webhook_id": "webhook_1",
6 "event_type": "billing.payment_updated",
7 "url": "https://webhook.site/60f76c15-95bc-4b7e-92c3-9c65e3af2dfd",
8 "response_code": 200,
9 "success": true,
10 "project_id": "YOUR_PROJECT_ID",
11 "module_id": null,
12 "created_at": "2025-04-26T16:15:00Z"
13 },
14 {
15 "id": "log_2",
16 "webhook_id": "webhook_2",
17 "event_type": "billing.subscription_cancelled",
18 "url": "https://webhook.site/60f76c15-95bc-4b7e-92c3-9c65e3af2dfd",
19 "response_code": 404,
20 "success": false,
21 "project_id": "YOUR_PROJECT_ID",
22 "module_id": null,
23 "created_at": "2025-04-26T16:10:00Z"
24 }
25 ],
26 "meta": {
27 "total": 50,
28 "success_rate": 0.85,
29 "project_id": "YOUR_PROJECT_ID",
30 "module_id": null
31 }
32}
33

Test Webhook

Test a webhook endpoint.

Request

index.js
1curl --request POST \
2 --url https://api.biamo.dev/api/developer/webhooks/test \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID" \
5 --header "Content-Type: application/json" \
6 --data '{
7 "webhookId": "wh_01H8ZX1XYZ987",
8 "eventType": "test.webhook"
9 }'
10

Successful Response

index.js
1{
2 "success": true,
3 "message": "Test webhook delivered successfully",
4 "delivery": {
5 "id": "log_1619461234567",
6 "status": "delivered",
7 "timestamp": "2025-04-26T16:20:00Z",
8 "success": true,
9 "status_code": 200,
10 "duration_ms": 312,
11 "response_data": {
12 "received": true
13 }
14 }
15}
16

List Available Webhook Events

Get a list of all available webhook event types.

Request

index.js
1curl --request GET \
2 --url https://api.biamo.dev/api/developer/webhooks/events \
3 --header "x-api-key: YOUR_API_KEY" \
4 --header "x-project-id: YOUR_PROJECT_ID"
5

Successful Response

index.js
1[
2 {
3 "name": "billing.payment_updated",
4 "description": "Triggered when a payment method is updated",
5 "category": "billing",
6 "example_payload": {
7 "event": "billing.payment_updated",
8 "timestamp": "2025-04-26T16:25:00Z",
9 "data": {
10 "payment_method": {
11 "type": "card",
12 "card_type": "visa",
13 "last4": "4242",
14 "exp_month": 12,
15 "exp_year": 25
16 }
17 }
18 }
19 },
20 {
21 "name": "device.connected",
22 "description": "Triggered when a device connects",
23 "category": "device",
24 "example_payload": {
25 "event": "device.connected",
26 "timestamp": "2025-04-26T16:30:00Z",
27 "data": {
28 "device_id": "dev_123456",
29 "device_type": "breastpump",
30 "connection_type": "bluetooth",
31 "battery_percent": 85,
32 "user_id": "usr_789012"
33 }
34 }
35 }
36]
37