/v2/events/batch
1 min
POST
https://api.throughlinecare.com/v2/events/batch
Query Parameters
- atomicbooleanDescriptionDefaultfalse
Body Parameters
- EventsBatchSubmitEventsBatchSubmitrequiredDescription
- eventsBatchEvent[]Description
- typestring<helplineDisplay | helplineClick>requiredExampleDescriptionAllowedhelplineDisplayhelplineClick
- helplineIdstringExampleDescription
- sessionIdstringrequiredExampleDescription
- timestampstring<date-time>requiredExampleDescriptionFormatdate-time
- contactMethodstring<phone | sms | onlineChat | website | tty | whatsapp | reportingForm>ExampleDescriptionAllowedphonesmsonlineChatwebsitettywhatsappreportingForm
- noDisplaybooleanDescription
Responses
202
400
401
413
503
javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"events": [
{
"type": "helplineDisplay",
"sessionId": "3f0c8a2e-1d4b-4c9a-9e2f-7a1b2c3d4e5f",
"timestamp": "2026-07-05T12:34:56Z"
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.throughlinecare.com/v2/events/batch?atomic=boolean", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.throughlinecare.com/v2/events/batch?atomic=boolean")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"events": [
{
"type": "helplineDisplay",
"sessionId": "3f0c8a2e-1d4b-4c9a-9e2f-7a1b2c3d4e5f",
"timestamp": "2026-07-05T12:34:56Z"
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.throughlinecare.com/v2/events/batch?atomic=boolean"
payload = json.dumps({
"events": [
{
"type": "helplineDisplay",
"sessionId": "3f0c8a2e-1d4b-4c9a-9e2f-7a1b2c3d4e5f",
"timestamp": "2026-07-05T12:34:56Z"
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"events\": [\n {\n \"type\": \"helplineDisplay\",\n \"sessionId\": \"3f0c8a2e-1d4b-4c9a-9e2f-7a1b2c3d4e5f\",\n \"timestamp\": \"2026-07-05T12:34:56Z\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.throughlinecare.com/v2/events/batch?atomic=boolean")
.method("POST", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();swift
let parameters = "{\n \"events\": [\n {\n \"type\": \"helplineDisplay\",\n \"sessionId\": \"3f0c8a2e-1d4b-4c9a-9e2f-7a1b2c3d4e5f\",\n \"timestamp\": \"2026-07-05T12:34:56Z\"\n }\n ]\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.throughlinecare.com/v2/events/batch?atomic=boolean")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "accept")
request.addValue("application/json", forHTTPHeaderField: "content-type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
202
// Batch accepted.
400
// Malformed request.
401
// Unauthorized.
413
// Payload too large.
503
// Storage unavailable.