Skip to main content
POST
/
scanner
/
api
/
v1
/
sessions
Create a scan session
curl --request POST \
  --url https://www.closient.com/scanner/api/v1/sessions \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "metadata": {},
  "organization_short_id": "",
  "user_agent": "",
  "device_context": {},
  "capture_mode": "barcode_scan"
}
'
{
  "status": "ACTIVE",
  "capture_mode": "barcode_scan",
  "created": "2023-11-07T05:31:56Z",
  "modified": "2023-11-07T05:31:56Z",
  "metadata": {},
  "capture_count": 0,
  "photo_count": 0
}

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for creating a new scan session.

metadata
Metadata · object

Developer-attached key/value data. Send {} or null to clear. Empty-string values delete that key. Omitted keys are preserved.

organization_short_id
string
default:""

Organization short_id. Required for session auth; optional for API key auth (inferred from key).

user_agent
string
default:""

Browser user-agent string of the scanning device.

device_context
Device Context · object

Device metadata.

capture_mode
enum<string>
default:barcode_scan

Capture mode for this session.

Available options:
barcode_scan,
product_photography,
both

Response

201 - application/json

Created

Scan session summary.

status
enum<string>
required

Lifecycle state of the session. ACTIVE while the operator is still adding captures; COMPLETED once they explicitly end or submit it; EXPIRED if a maintenance job reaped the session after sitting idle past its TTL.

Available options:
ACTIVE,
COMPLETED,
EXPIRED
capture_mode
enum<string>
required

Session capture mode.

Available options:
barcode_scan,
product_photography,
both
created
string<date-time>
required

Timestamp when the session was created.

modified
string<date-time>
required

Timestamp when the session was last modified.

metadata
Metadata · object

Developer-attached key/value data attached to this object. Up to 50 keys; key max 40 chars, value max 500 chars.

capture_count
integer
default:0

Total number of captures.

photo_count
integer
default:0

Total number of product photos.