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



## OpenAPI

````yaml /api-reference/partners/api.json put /v1/worksites/{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}:
    put:
      tags:
        - Worksites
      summary: Worksite update
      operationId: partners.worksites.update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksitesUpdateRequest'
      responses:
        '200':
          description: '`WorksiteResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorksiteResource'
                required:
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    WorksitesUpdateRequest:
      type: object
      properties:
        external_reference:
          type:
            - string
            - 'null'
        address:
          type: string
        city:
          type: string
        zipcode:
          type: string
        country:
          type:
            - string
            - 'null'
        additional_address:
          type:
            - string
            - 'null'
        indivision:
          type:
            - boolean
            - 'null'
        fiscal_informations:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              firstname:
                type: string
              lastname:
                type: string
              fiscal_number:
                type:
                  - string
                  - 'null'
              fiscal_reference:
                type:
                  - string
                  - 'null'
            required:
              - firstname
              - lastname
      required:
        - address
        - city
        - zipcode
      title: WorksitesUpdateRequest
    WorksiteResource:
      type: object
      properties:
        id:
          type: integer
        reference:
          type: string
        external_reference:
          type:
            - string
            - 'null'
        convention_id:
          type: integer
        beneficiary_id:
          type: integer
        installer_name:
          type: string
        zipcode:
          type: string
        address:
          type: string
        city:
          type: string
        status:
          type: string
        created_at:
          type: string
        precarity_type:
          type: string
        fiscal_informations:
          $ref: '#/components/schemas/FiscalDeclarationCollection'
        indivision:
          type: boolean
      required:
        - id
        - reference
        - external_reference
        - convention_id
        - beneficiary_id
        - installer_name
        - zipcode
        - address
        - city
        - status
        - created_at
        - precarity_type
        - fiscal_informations
        - indivision
      title: WorksiteResource
    FiscalDeclarationCollection:
      type: array
      items:
        $ref: '#/components/schemas/FiscalDeclarationResource'
      title: FiscalDeclarationCollection
    FiscalDeclarationResource:
      type: object
      properties:
        firstname:
          type: string
        lastname:
          type: string
        fiscal_number:
          type: string
        fiscal_reference:
          type: string
      required:
        - firstname
        - lastname
        - fiscal_number
        - fiscal_reference
      title: FiscalDeclarationResource
  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

````