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

# Worksite document update



## OpenAPI

````yaml /api-reference/partners/api.json put /v1/worksites/{id}/documents/{document_id}
openapi: 3.1.0
info:
  title: Laravel
  version: 0.0.1
servers:
  - url: https://api.opx.co/partners
    description: Production
security: []
paths:
  /v1/worksites/{id}/documents/{document_id}:
    put:
      tags:
        - WorksitesDocuments
      summary: Worksite document update
      operationId: partners.worksites.documents.update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
        - name: document_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WorksitesDocumentsUpdateRequest'
      responses:
        '200':
          description: '`WorksiteDocumentResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorksiteDocumentResource'
                required:
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    WorksitesDocumentsUpdateRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        url:
          type:
            - string
            - 'null'
          format: uri
        file:
          type:
            - string
            - 'null'
          format: binary
          contentMediaType: application/octet-stream
          maxLength: 10240
      required:
        - name
      title: WorksitesDocumentsUpdateRequest
    WorksiteDocumentResource:
      type: object
      properties:
        id:
          type: integer
        worksite_operation_id:
          type:
            - integer
            - 'null'
          description: null if directly attached to a worksite
        type_id:
          type: string
        type:
          type: string
          description: AH, CC, Photo, ...
        file_name:
          type: string
        url:
          type:
            - string
            - 'null'
        status_id:
          type: string
        status:
          type: string
        notes:
          type: string
        non_compliance:
          anyOf:
            - type: string
            - type: array
              items:
                type: string
              minItems: 0
              maxItems: 0
              additionalItems: false
        required:
          type: string
        created_at:
          type: string
      required:
        - id
        - worksite_operation_id
        - type_id
        - type
        - file_name
        - url
        - status_id
        - status
        - notes
        - non_compliance
        - required
        - created_at
      title: WorksiteDocumentResource
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````