Record a batch of gate attendance events (limited pilot)
curl --request POST \
--url https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-BuildPass-Api-Version: <x-buildpass-api-version>' \
--data '
{
"events": [
{
"sourceEventId": "<string>",
"workerId": "<string>",
"type": "SIGN_ON",
"occurredAt": "2023-11-07T05:31:56Z",
"deviceId": "<string>"
}
]
}
'import requests
url = "https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch"
payload = { "events": [
{
"sourceEventId": "<string>",
"workerId": "<string>",
"type": "SIGN_ON",
"occurredAt": "2023-11-07T05:31:56Z",
"deviceId": "<string>"
}
] }
headers = {
"X-BuildPass-Api-Version": "<x-buildpass-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-BuildPass-Api-Version': '<x-buildpass-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: [
{
sourceEventId: '<string>',
workerId: '<string>',
type: 'SIGN_ON',
occurredAt: '2023-11-07T05:31:56Z',
deviceId: '<string>'
}
]
})
};
fetch('https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch', 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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch",
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([
'events' => [
[
'sourceEventId' => '<string>',
'workerId' => '<string>',
'type' => 'SIGN_ON',
'occurredAt' => '2023-11-07T05:31:56Z',
'deviceId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-BuildPass-Api-Version: <x-buildpass-api-version>"
],
]);
$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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch"
payload := strings.NewReader("{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BuildPass-Api-Version", "<x-buildpass-api-version>")
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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch")
.header("X-BuildPass-Api-Version", "<x-buildpass-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BuildPass-Api-Version"] = '<x-buildpass-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"sourceEventId": "<string>",
"status": 200,
"data": {
"id": "saevt_example",
"sourceEventId": "<string>",
"status": "APPLIED",
"signOnId": "signon_example",
"duplicate": true
}
}
]
}{
"data": [
{
"sourceEventId": "<string>",
"status": 200,
"data": {
"id": "saevt_example",
"sourceEventId": "<string>",
"status": "APPLIED",
"signOnId": "signon_example",
"duplicate": true
}
}
]
}Site access (planned)
Record a batch of gate attendance events
Send up to 100 sign-on and sign-off events in one request.
POST
/
builders
/
{builderId}
/
projects
/
{projectId}
/
sign-on-events
/
batch
Record a batch of gate attendance events (limited pilot)
curl --request POST \
--url https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-BuildPass-Api-Version: <x-buildpass-api-version>' \
--data '
{
"events": [
{
"sourceEventId": "<string>",
"workerId": "<string>",
"type": "SIGN_ON",
"occurredAt": "2023-11-07T05:31:56Z",
"deviceId": "<string>"
}
]
}
'import requests
url = "https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch"
payload = { "events": [
{
"sourceEventId": "<string>",
"workerId": "<string>",
"type": "SIGN_ON",
"occurredAt": "2023-11-07T05:31:56Z",
"deviceId": "<string>"
}
] }
headers = {
"X-BuildPass-Api-Version": "<x-buildpass-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-BuildPass-Api-Version': '<x-buildpass-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: [
{
sourceEventId: '<string>',
workerId: '<string>',
type: 'SIGN_ON',
occurredAt: '2023-11-07T05:31:56Z',
deviceId: '<string>'
}
]
})
};
fetch('https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch', 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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch",
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([
'events' => [
[
'sourceEventId' => '<string>',
'workerId' => '<string>',
'type' => 'SIGN_ON',
'occurredAt' => '2023-11-07T05:31:56Z',
'deviceId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-BuildPass-Api-Version: <x-buildpass-api-version>"
],
]);
$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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch"
payload := strings.NewReader("{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BuildPass-Api-Version", "<x-buildpass-api-version>")
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.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch")
.header("X-BuildPass-Api-Version", "<x-buildpass-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/projects/{projectId}/sign-on-events/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BuildPass-Api-Version"] = '<x-buildpass-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"sourceEventId\": \"<string>\",\n \"workerId\": \"<string>\",\n \"type\": \"SIGN_ON\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"deviceId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"sourceEventId": "<string>",
"status": 200,
"data": {
"id": "saevt_example",
"sourceEventId": "<string>",
"status": "APPLIED",
"signOnId": "signon_example",
"duplicate": true
}
}
]
}{
"data": [
{
"sourceEventId": "<string>",
"status": 200,
"data": {
"id": "saevt_example",
"sourceEventId": "<string>",
"status": "APPLIED",
"signOnId": "signon_example",
"duplicate": true
}
}
]
}This endpoint is part of the approved attendance pilot and requires the same
scope and site-access relationship as recording a single event.
Send a JSON object with an events array of 1 to 100 single-event payloads. The
API validates the entire body before processing any event. It processes valid
payloads in array order and commits each event independently. Place sign-ons
before the sign-offs that reference them.
The response contains a data array in the same order. Every item includes
sourceEventId and the HTTP status the event would receive on the single endpoint.
Successful items include the event in data. Rejected items include code and message.
The endpoint returns HTTP 200 when every item is accepted and HTTP 207 when any
item is rejected. A malformed body returns HTTP 400 before processing starts.
After a timeout or server error, replay the original IDs and unchanged payloads
in their original order. Some events may already have committed. Replay a
pending sign-off after sending its sign-on to get its latest status. Resolve
conflicts before replaying and keep the original IDs for events already recorded.
| Item status | Meaning |
|---|---|
| 200 | The identical event was already recorded. |
| 201 | The event was applied to attendance. |
| 202 | The sign-off was recorded and is waiting for its sign-on. |
| 400 | The event occurrence time is in the future. |
| 404 | The project or worker’s relationship to it could not be found. |
| 409 | The event ID, pairing or attendance record conflicts. |
Authorizations
Headers
Path Parameters
Body
application/json