> ## Documentation Index
> Fetch the complete documentation index at: https://developer.buildpass.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a batch of gate attendance events

> Send up to 100 sign-on and sign-off events in one request.

This endpoint is part of the approved attendance pilot and requires the same
scope and site-access relationship as [recording a single event](https://developer.buildpass.global/api-reference/builders/projects/site-access/events.md).

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.

| 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. |

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.


## OpenAPI

````yaml POST /builders/{builderId}/projects/{projectId}/sign-on-events/batch
openapi: 3.0.0
info:
  title: BuildPass API
  description: >-
    Approved integrators can connect to the BuildPass API on behalf of builders
    to build connections between a wide range of construction platforms.
  version: 1.0.0
servers:
  - url: https://api.buildpass.global
    description: Production server
security:
  - OAuth2: []
paths:
  /builders/{builderId}/projects/{projectId}/sign-on-events/batch:
    post:
      summary: Record a batch of gate attendance events (limited pilot)
      description: >-
        Validates the entire batch before processing events in request order.
        Each event commits independently. Keep original IDs and payloads when
        replaying.
      operationId: recordProjectSignOnEventBatch
      parameters:
        - name: builderId
          description: The ID of the builder
          in: path
          required: true
          schema:
            type: string
            example: buil_clgbsb90b001qjy0f0eo1hspp
        - name: projectId
          description: The ID of the project
          in: path
          required: true
          schema:
            type: string
            example: proj_clgbsb90b001qjy0f0eo1hspp
        - name: X-BuildPass-Api-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/X-BuildPass-Api-Version'
        - name: X-BuildPass-Region-Id
          in: header
          required: false
          description: Builder database region; defaults to au1.
          schema:
            type: string
            enum:
              - au1
              - us1
            default: au1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - events
              properties:
                events:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    $ref: '#/components/schemas/SignOnEventInput'
      responses:
        '200':
          description: All events accepted, including duplicates and pending sign-offs.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - sourceEventId
                        - status
                        - data
                      properties:
                        sourceEventId:
                          type: string
                        status:
                          type: integer
                          enum:
                            - 200
                            - 201
                            - 202
                        data:
                          $ref: '#/components/schemas/SignOnEventResult'
        '207':
          description: At least one event was rejected. Inspect each item in order.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          required:
                            - sourceEventId
                            - status
                            - data
                          properties:
                            sourceEventId:
                              type: string
                            status:
                              type: integer
                              enum:
                                - 200
                                - 201
                                - 202
                            data:
                              $ref: '#/components/schemas/SignOnEventResult'
                        - type: object
                          required:
                            - sourceEventId
                            - status
                            - code
                            - message
                          properties:
                            sourceEventId:
                              type: string
                            status:
                              type: integer
                              enum:
                                - 400
                                - 404
                                - 409
                            code:
                              type: string
                            message:
                              type: string
        '400':
          description: Invalid path, region or request body. No event processed.
        '401':
          description: Missing authorization or required write scope.
        '403':
          description: Disconnected integrator or builder mismatch.
        '500':
          description: >-
            Processing stopped. Earlier events may have committed. Replay the
            original batch.
      security:
        - OAuth2:
            - write:sign_on_events
components:
  schemas:
    X-BuildPass-Api-Version:
      type: string
      example: v1
      default: v1
      enum:
        - v1
      description: What API version to use.
    SignOnEventInput:
      oneOf:
        - type: object
          additionalProperties: false
          properties:
            sourceEventId:
              type: string
              minLength: 1
              maxLength: 200
            workerId:
              type: string
              pattern: ^wkr_[a-zA-Z0-9]+$
            type:
              type: string
              enum:
                - SIGN_ON
            occurredAt:
              type: string
              format: date-time
              description: >-
                UTC occurrence time, millisecond precision or less; cannot be in
                the future.
            deviceId:
              type: string
              minLength: 1
              maxLength: 200
          required:
            - sourceEventId
            - workerId
            - type
            - occurredAt
        - type: object
          additionalProperties: false
          properties:
            sourceEventId:
              type: string
              minLength: 1
              maxLength: 200
            workerId:
              type: string
              pattern: ^wkr_[a-zA-Z0-9]+$
            type:
              type: string
              enum:
                - SIGN_OFF
            occurredAt:
              type: string
              format: date-time
              description: >-
                UTC occurrence time, millisecond precision or less; cannot be in
                the future.
            sourceSignOnEventId:
              type: string
              minLength: 1
              maxLength: 200
              description: Required for SIGN_OFF; forbidden for SIGN_ON.
            deviceId:
              type: string
              minLength: 1
              maxLength: 200
          required:
            - sourceEventId
            - workerId
            - type
            - occurredAt
            - sourceSignOnEventId
    SignOnEventResult:
      type: object
      required:
        - id
        - sourceEventId
        - status
        - signOnId
        - duplicate
      properties:
        id:
          type: string
          example: saevt_example
        sourceEventId:
          type: string
        status:
          type: string
          enum:
            - APPLIED
            - PENDING_SIGN_ON
        signOnId:
          type: string
          nullable: true
          example: signon_example
        duplicate:
          type: boolean
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.buildpass.global/oauth/token
          scopes:
            read:subcontractors: Read subcontractors
            write:subcontractors: Write subcontractors
            read:prequalifications: Read prequalifications
            write:prequalifications: Write prequalifications
            read:insurances: Read insurances
            write:insurances: Write insurances
            read:contacts: Read contacts
            read:swms: Read SWMS
            read:timesheets: Read timesheets
            read:inductions: Read inductions
            read:meetings: Read meetings
            write:meetings: Write meetings
            read:defects: Read defects
            read:photos: Read photos and photo folders
            write:photos: Create, update, delete, and sync photos and photo folders
            read:site_access: Read worker-project site access grants (explicitly approved pilot)
            write:sign_on_events: >-
              Record worker sign-on and sign-off events (explicitly approved
              pilot)
            read:builders: Read builders and builder projects
            read:user: >-
              Read the consenting BuildPass user's identity (requires user
              authorization)
            read:phone_calls: Read phone calls
            write:phone_calls: Create and update phone calls

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.