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

# Bulk upload attachments

> Upload multiple attachment files and receive attachment references for a later resource create or upsert request. Include type=attachment, or per-file type:N=attachment fields, so BuildPass can route each file to the correct storage family. For example, use the returned references to bulk upsert photos.

Requires a valid authenticated request for the builder. No resource-specific scope is required for upload.

Uploads multiple attachment files into BuildPass-managed attachment storage and returns attachment references.

Include `type=attachment` in the multipart body to apply the same type to all files, or `type:0=attachment`, `type:1=attachment`, and so on to set a type per file. The `type` tells BuildPass which storage family to use; `attachment` is the only externally supported upload type for now.

For example, you can use each returned `{ key, regionId, type }` to bulk upsert photos by passing it as `photos[].imageAttachment`.


## OpenAPI

````yaml POST /builders/{builderId}/attachments/bulk-upload
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}/attachments/bulk-upload:
    post:
      tags:
        - Attachments
      summary: Bulk upload attachments
      description: >-
        Upload multiple attachment files and receive attachment references for a
        later resource create or upsert request. Include type=attachment, or
        per-file type:N=attachment fields, so BuildPass can route each file to
        the correct storage family. For example, use the returned references to
        bulk upsert photos.
      parameters:
        - name: builderId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - attachment
                  description: Upload type to apply to every file.
                file:0:
                  type: string
                  format: binary
                type:0:
                  type: string
                  enum:
                    - attachment
                  description: Optional upload type for file:0.
                file:1:
                  type: string
                  format: binary
                type:1:
                  type: string
                  enum:
                    - attachment
                  description: Optional upload type for file:1.
      responses:
        '201':
          description: Attachments uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  uploads:
                    type: array
                    items:
                      $ref: '#/components/schemas/AttachmentUploadResponse'
      security:
        - OAuth2: []
components:
  schemas:
    AttachmentUploadResponse:
      allOf:
        - $ref: '#/components/schemas/AttachmentUploadReference'
        - type: object
          properties:
            imageUrl:
              type: string
              format: uri
            fileName:
              type: string
            contentType:
              type: string
            fieldName:
              type: string
              description: Present on bulk upload responses.
    AttachmentUploadReference:
      type: object
      required:
        - key
        - type
      properties:
        key:
          type: string
          example: external-uploads/ckbuilder123456789012345678/photo.jpg
        regionId:
          type: string
          nullable: true
          example: au1
        type:
          type: string
          enum:
            - attachment
  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:photos: Read photos and photo folders
            write:photos: Create, update, delete, and sync photos and photo folders

````