Record a scan
curl --request POST \
--url https://attend.hackclub.com/api/v1/events/{event_id}/scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participant_id": 123,
"scan_context_id": 123,
"badge_token": "<string>",
"client_scan_id": "<string>",
"source": "<string>",
"scanned_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://attend.hackclub.com/api/v1/events/{event_id}/scans"
payload = {
"participant_id": 123,
"scan_context_id": 123,
"badge_token": "<string>",
"client_scan_id": "<string>",
"source": "<string>",
"scanned_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
participant_id: 123,
scan_context_id: 123,
badge_token: '<string>',
client_scan_id: '<string>',
source: '<string>',
scanned_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://attend.hackclub.com/api/v1/events/{event_id}/scans', 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://attend.hackclub.com/api/v1/events/{event_id}/scans",
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([
'participant_id' => 123,
'scan_context_id' => 123,
'badge_token' => '<string>',
'client_scan_id' => '<string>',
'source' => '<string>',
'scanned_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://attend.hackclub.com/api/v1/events/{event_id}/scans"
payload := strings.NewReader("{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://attend.hackclub.com/api/v1/events/{event_id}/scans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://attend.hackclub.com/api/v1/events/{event_id}/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"deduplicated": true,
"first_scan_in_context": true,
"scan": {
"id": 123,
"participant_id": 123,
"participant_event_id": 123,
"scanned_at": "2023-11-07T05:31:56Z",
"scanned_by": "Jane Staff",
"client_scan_id": "<string>",
"source": "qr",
"scan_context": {
"id": 4,
"name": "Check-in",
"checks_in": true,
"is_travel_pickup": true,
"is_airport": true,
"position": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z"
},
"participant": {
"participant_id": 123,
"participant_event_id": 123,
"display_name": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"slack_user_id": "<string>",
"phone": "<string>",
"pronouns": "<string>",
"tshirt_size": "<string>",
"status": "invited",
"has_anaphylaxis_risk": true,
"requires_refrigeration": true,
"allergies": "<string>",
"medical_conditions": "<string>",
"medications": "<string>",
"diet_type": "<string>",
"life_threatening_allergies": "<string>",
"cross_contamination_risk": true,
"freedom_waiver_granted": true,
"high_support_flag": true,
"can_leave_unaccompanied": true,
"waiver_signed": true,
"nfc_badge_token": "<string>",
"nfc_badge_assigned": true,
"groups": [
{
"id": 123,
"name": "<string>",
"color": "<string>"
}
]
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Scans
Record a scan
Record a QR / NFC / manual scan for a participant. Pass client_scan_id for idempotency — a repeat returns the existing scan with deduplicated: true. badge_token accepts either an assigned NFC badge belonging to the selected event or an active Hack Club passport. Passport scans work regardless of the event’s NFC badge issuance setting. The participant can also be identified by participant_id (matched as a participant_event id first, then a participant id).
POST
/
events
/
{event_id}
/
scans
Record a scan
curl --request POST \
--url https://attend.hackclub.com/api/v1/events/{event_id}/scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participant_id": 123,
"scan_context_id": 123,
"badge_token": "<string>",
"client_scan_id": "<string>",
"source": "<string>",
"scanned_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://attend.hackclub.com/api/v1/events/{event_id}/scans"
payload = {
"participant_id": 123,
"scan_context_id": 123,
"badge_token": "<string>",
"client_scan_id": "<string>",
"source": "<string>",
"scanned_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
participant_id: 123,
scan_context_id: 123,
badge_token: '<string>',
client_scan_id: '<string>',
source: '<string>',
scanned_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://attend.hackclub.com/api/v1/events/{event_id}/scans', 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://attend.hackclub.com/api/v1/events/{event_id}/scans",
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([
'participant_id' => 123,
'scan_context_id' => 123,
'badge_token' => '<string>',
'client_scan_id' => '<string>',
'source' => '<string>',
'scanned_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://attend.hackclub.com/api/v1/events/{event_id}/scans"
payload := strings.NewReader("{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://attend.hackclub.com/api/v1/events/{event_id}/scans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://attend.hackclub.com/api/v1/events/{event_id}/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"participant_id\": 123,\n \"scan_context_id\": 123,\n \"badge_token\": \"<string>\",\n \"client_scan_id\": \"<string>\",\n \"source\": \"<string>\",\n \"scanned_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"deduplicated": true,
"first_scan_in_context": true,
"scan": {
"id": 123,
"participant_id": 123,
"participant_event_id": 123,
"scanned_at": "2023-11-07T05:31:56Z",
"scanned_by": "Jane Staff",
"client_scan_id": "<string>",
"source": "qr",
"scan_context": {
"id": 4,
"name": "Check-in",
"checks_in": true,
"is_travel_pickup": true,
"is_airport": true,
"position": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z"
},
"participant": {
"participant_id": 123,
"participant_event_id": 123,
"display_name": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"slack_user_id": "<string>",
"phone": "<string>",
"pronouns": "<string>",
"tshirt_size": "<string>",
"status": "invited",
"has_anaphylaxis_risk": true,
"requires_refrigeration": true,
"allergies": "<string>",
"medical_conditions": "<string>",
"medications": "<string>",
"diet_type": "<string>",
"life_threatening_allergies": "<string>",
"cross_contamination_risk": true,
"freedom_waiver_granted": true,
"high_support_flag": true,
"can_leave_unaccompanied": true,
"waiver_signed": true,
"nfc_badge_token": "<string>",
"nfc_badge_assigned": true,
"groups": [
{
"id": 123,
"name": "<string>",
"color": "<string>"
}
]
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Authorizations
Mobile token, global API token, series API key, or event API key. See Authentication above for which endpoints each one reaches.
Path Parameters
Event id.
Body
application/json
Response
Scan recorded (or an existing scan returned when deduplicated).
Was this page helpful?