Send a signed module event
curl --request POST \
--url https://api.develop.fourdos.dev/v1/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-4D-Signature: <x-4d-signature>' \
--data '
{
"type": "<string>",
"version": 2,
"event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {},
"member_external_id": "<string>"
}
'import requests
url = "https://api.develop.fourdos.dev/v1/ingest"
payload = {
"type": "<string>",
"version": 2,
"event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {},
"member_external_id": "<string>"
}
headers = {
"X-4D-Signature": "<x-4d-signature>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-4D-Signature': '<x-4d-signature>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: '<string>',
version: 2,
event_id: '<string>',
occurred_at: '2023-11-07T05:31:56Z',
payload: {},
member_external_id: '<string>'
})
};
fetch('https://api.develop.fourdos.dev/v1/ingest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.develop.fourdos.dev/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'version' => 2,
'event_id' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z',
'payload' => [
],
'member_external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-4D-Signature: <x-4d-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.develop.fourdos.dev/v1/ingest"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-4D-Signature", "<x-4d-signature>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.develop.fourdos.dev/v1/ingest")
.header("X-4D-Signature", "<x-4d-signature>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.develop.fourdos.dev/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-4D-Signature"] = '<x-4d-signature>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"inbound_event_id": "<string>",
"status": "received",
"canonical_event_id": "<string>",
"reject_reason": "<string>"
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}Ingest
Send a signed module event
Accepts a native event from an installed module. Authenticate with the installation’s mk_live_ module credential, sign the exact raw JSON body with HMAC-SHA256 over ${timestamp}.${raw_body}, and send the matching event id as Idempotency-Key. The installed manifest declares the native type and maps it to a platform canonical type. Organization org_ keys are not accepted.
POST
/
v1
/
ingest
Send a signed module event
curl --request POST \
--url https://api.develop.fourdos.dev/v1/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-4D-Signature: <x-4d-signature>' \
--data '
{
"type": "<string>",
"version": 2,
"event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {},
"member_external_id": "<string>"
}
'import requests
url = "https://api.develop.fourdos.dev/v1/ingest"
payload = {
"type": "<string>",
"version": 2,
"event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {},
"member_external_id": "<string>"
}
headers = {
"X-4D-Signature": "<x-4d-signature>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-4D-Signature': '<x-4d-signature>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: '<string>',
version: 2,
event_id: '<string>',
occurred_at: '2023-11-07T05:31:56Z',
payload: {},
member_external_id: '<string>'
})
};
fetch('https://api.develop.fourdos.dev/v1/ingest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.develop.fourdos.dev/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'version' => 2,
'event_id' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z',
'payload' => [
],
'member_external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-4D-Signature: <x-4d-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.develop.fourdos.dev/v1/ingest"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-4D-Signature", "<x-4d-signature>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.develop.fourdos.dev/v1/ingest")
.header("X-4D-Signature", "<x-4d-signature>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.develop.fourdos.dev/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-4D-Signature"] = '<x-4d-signature>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"version\": 2,\n \"event_id\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"payload\": {},\n \"member_external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"inbound_event_id": "<string>",
"status": "received",
"canonical_event_id": "<string>",
"reject_reason": "<string>"
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"status": 123,
"message": "<string>",
"details": {}
}
}Authorizations
Module ingest credential (mk_live_...) sent as Authorization: Bearer <key>.
Headers
Signature in the form t=<unix_seconds>,v1=<hex_hmac>.
Must equal the body event_id; reuse it only with the same event body.
Minimum string length:
1Body
application/json
Module-owned native event type
Minimum string length:
1Version of the native event type
Required range:
x >= 1Caller-generated idempotency identifier
Minimum string length:
1Payload validated by the installed module manifest
Minimum string length:
1