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

# List defects

> List defects for a builder. Archived defects are excluded by default. Results are paginated with a default and maximum limit of 25.

Requires `read:defects`. Returns defects for the authenticated builder with
project, location, assigner, assignee, and signed attachment data. Defect IDs
use the `defect_` prefix, and project location IDs use the `loc_` prefix.
Assignees are exposed as `USER` (`wkr_` or `user_` IDs), `COMPANY` (`sub_`
IDs), or `TAG` (`tag_` IDs); assigner IDs use the `user_` prefix. Supply the
prefixed project location ID when filtering with `locationId`.


## OpenAPI

````yaml GET /builders/{builderId}/defects
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}/defects:
    get:
      tags:
        - Defects
      summary: List defects
      description: >-
        List defects for a builder. Archived defects are excluded by default.
        Results are paginated with a default and maximum limit of 25.
      operationId: listDefects
      parameters:
        - name: builderId
          in: path
          required: true
          schema:
            type: string
            example: buil_clgbsb90b001qjy0f0eo1hspp
        - name: projectId
          description: Filter by a proj_-prefixed project ID
          in: query
          required: false
          schema:
            type: string
            example: proj_clgbsb90b001qjy0f0eo1hscp
        - name: status
          description: Filter by defect status. Repeat the parameter for multiple values.
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - TO_DO
                - IN_PROGRESS
                - WAITING_REVIEW
                - BLOCKED
                - RESOLVED
                - CANCELLED
        - name: priority
          description: Filter by defect priority. Repeat the parameter for multiple values.
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - LOW
                - MEDIUM
                - HIGH
                - CRITICAL
        - name: locationId
          description: Filter by a loc_-prefixed project location ID
          in: query
          required: false
          schema:
            type: string
            example: loc_extapiprojectlocation01
        - name: offset
          description: >-
            The number of items to skip before starting to collect the result
            set
          in: query
          required: false
          schema:
            type: integer
            default: 0
            example: 0
        - name: limit
          description: The number of items to return.
          in: query
          required: false
          schema:
            type: integer
            default: 25
            example: 25
            maximum: 25
      responses:
        '200':
          description: A list of defects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseDefect'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '429':
          description: Too Many Requests
        '500':
          description: Internal Server Error
      security:
        - OAuth2:
            - read:defects
components:
  schemas:
    PaginatedResponseDefect:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Defect'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              fieldName:
                type: string
                example: name
              message:
                type: string
                example: This field is required.
    Defect:
      type: object
      properties:
        id:
          type: string
          description: A defect_-prefixed defect ID
          example: defect_extapidefect01
        builderId:
          type: string
          example: buil_clgbsb90b001qjy0f0eo1hspp
        projectId:
          type: string
          example: proj_clgbsb90b001qjy0f0eo1hscp
        projectName:
          type: string
          example: Downtown Mall Construction
        number:
          type: integer
          description: The human-facing sequence number within the project and defect type
          example: 1
        title:
          type: string
          nullable: true
          example: Damaged wall finish
        description:
          type: string
          nullable: true
          example: Repair the damaged wall finish on Level 1.
        status:
          type: string
          enum:
            - TO_DO
            - IN_PROGRESS
            - WAITING_REVIEW
            - BLOCKED
            - RESOLVED
            - CANCELLED
        priority:
          type: string
          nullable: true
          enum:
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
        type:
          type: string
          nullable: true
          description: Builder-defined defect type
          example: BUILDER_DEFECT
        dueDate:
          type: string
          format: date-time
          nullable: true
        tags:
          type: array
          items:
            type: string
        location:
          allOf:
            - $ref: '#/components/schemas/DefectLocation'
          nullable: true
        assigner:
          type: object
          nullable: true
          description: The assigning admin user, identified by a user_-prefixed ID
          properties:
            id:
              type: string
              example: user_clgbsb90b001qjy0f0eo1hsau
            name:
              type: string
              example: Alex Builder
        assignees:
          type: array
          items:
            $ref: '#/components/schemas/DefectAssignee'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/DefectAttachment'
        distributedAt:
          type: string
          format: date-time
          nullable: true
        completedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PaginationMeta:
      type: object
      properties:
        totalCount:
          type: integer
          description: How many total items there are.
          example: 100
        totalPages:
          type: integer
          description: How many pages there are based on your offset and limit.
          example: 4
        offset:
          type: integer
          description: How many items skipped before starting to collect the result set.
          example: 0
        limit:
          type: integer
          description: How many items you requested to return.
          example: 25
    DefectLocation:
      type: object
      properties:
        id:
          type: string
          description: A loc_-prefixed project location ID
          example: loc_extapiprojectlocation01
        name:
          type: string
          example: Level 1
        parentId:
          type: string
          nullable: true
          description: >-
            The loc_-prefixed parent project location ID, or null for a root
            location
          example: loc_extapiprojectlocation00
    DefectAssignee:
      type: object
      properties:
        type:
          type: string
          enum:
            - USER
            - COMPANY
            - TAG
          example: USER
        id:
          type: string
          description: >-
            USER IDs are wkr_-prefixed workers or user_-prefixed admin users;
            COMPANY IDs are sub_-prefixed subcontractors; TAG IDs are
            tag_-prefixed resource tags
          example: wkr_fsf1r0nqlcirkxlz1gzbw7oh
        name:
          type: string
          example: John Smith
    DefectAttachment:
      type: object
      properties:
        id:
          type: string
          example: extapidefectattachment01
        fileName:
          type: string
          example: defect-photo.jpg
        contentType:
          type: string
          example: image/jpeg
        url:
          type: string
          format: uri
          nullable: true
          description: A short-lived signed attachment URL
  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

````