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

# Create photo

> Create a gallery photo from an uploaded imageAttachment reference, or an approved HTTPS image URL.

Requires `write:photos`. Creates a gallery photo record from JSON with an uploaded `imageAttachment` reference or an approved `imageUrl`.

Upload image bytes first with `POST /builders/{builderId}/attachments/upload`, then pass the returned `{ key, regionId, type }` as `imageAttachment`.

Approved HTTPS `imageUrl` imports are supported only for hosts reviewed and enabled by BuildPass. If you want to import photos from your own image URL hosts, please contact BuildPass.


## OpenAPI

````yaml POST /builders/{builderId}/photos
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}/photos:
    post:
      tags:
        - Photos
      summary: Create photo
      description: >-
        Create a gallery photo from an uploaded imageAttachment reference, or an
        approved HTTPS image URL.
      parameters:
        - name: builderId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhotoInput'
      responses:
        '201':
          description: Photo created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Photo'
      security:
        - OAuth2:
            - write:photos
components:
  schemas:
    PhotoInput:
      type: object
      required:
        - fileName
      properties:
        projectId:
          type: string
          example: proj_ckproject123456789012345678
        folderId:
          type: string
        imageAttachment:
          $ref: '#/components/schemas/AttachmentUploadReference'
        imageUrl:
          type: string
          format: uri
          description: >-
            Approved HTTPS URL to import. To import photos from your own image
            URL hosts, contact BuildPass so those hosts can be reviewed and
            enabled.
        fileName:
          type: string
        contentType:
          type: string
          default: image/jpeg
        capturedAt:
          type: string
          format: date-time
        description:
          type: string
        externalSourceId:
          type: string
    Photo:
      type: object
      properties:
        id:
          type: string
        builderId:
          type: string
          nullable: true
        projectId:
          type: string
          nullable: true
        source:
          type: string
          description: The BuildPass UI source that owns the photo attachment.
          enum:
            - GALLERY
            - SITE_DIARY
            - PRE_START
            - CHECKLIST
            - ITP
            - PLATFORM_ACTION
            - DEFECT
        folderId:
          type: string
          nullable: true
        fileName:
          type: string
        contentType:
          type: string
        key:
          type: string
        fileSize:
          type: string
        description:
          type: string
          nullable: true
        photoTakenDate:
          type: string
          format: date-time
          nullable: true
        sortDate:
          type: string
          format: date-time
          nullable: true
        metadata:
          type: object
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        archivedAt:
          type: string
          format: date-time
          nullable: true
        imageUrl:
          type: string
          format: uri
          nullable: true
          description: Short-lived signed URL for downloading the photo image.
    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

````