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

# Update Document

> Updates an existing record or inserts new documents for an imported good based on the provided company ID, report ID, and item ID. The request body must include a valid JSON payload describing the supporting documents.



## OpenAPI

````yaml api-reference/openapi.json put /v1/companies/{company_id}/reports/{report_id}/items/{item_id}/documents
openapi: 3.0.0
info:
  description: Validate, store, and query compliance carbon data.
  title: NueBorder API
  termsOfService: https://nueborder.com/terms/
  contact:
    name: Jack Dunlap
    url: https://nueborder.com/support
    email: support@nueborder.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://nueborder.com/api/v1
security: []
externalDocs:
  description: OpenAPI
  url: https://nueborder.com/openapi/
paths:
  /v1/companies/{company_id}/reports/{report_id}/items/{item_id}/documents:
    put:
      tags:
        - Documents
      summary: Update Document
      description: >-
        Updates an existing record or inserts new documents for an imported good
        based on the provided company ID, report ID, and item ID. The request
        body must include a valid JSON payload describing the supporting
        documents.
      parameters:
        - description: >-
            Unique identifier for the company associated with the imported good
            documents
          name: company_id
          in: path
          required: true
          schema:
            type: string
        - description: >-
            Unique identifier for the report associated with the imported good
            documents
          name: report_id
          in: path
          required: true
          schema:
            type: string
        - description: >-
            Unique identifier for the item associated with the imported good
            documents
          name: item_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flat.SupportingDocumentsType'
        description: Payload for supporting documents
        required: true
      responses:
        '200':
          description: Successfully updated or inserted imported good documents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.SuccessResponse'
        '400':
          description: Missing or invalid company_id, report_id, or item_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.JSONPayloadErrorResponse'
        '500':
          description: Error updating/inserting imported good documents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.InternalServerErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    flat.SupportingDocumentsType:
      description: Summary of Struct
      type: object
      required:
        - binary
        - document_type
        - filename
        - item_number
        - mime
        - type
      properties:
        binary:
          description: The actual binary object. The actual binary object.
          type: array
          items:
            type: integer
        companyID:
          description: Company identifier
          type: integer
        country:
          description: >-
            The country where the supporting document was issued. The country
            where the supporting document was issued. (Min Length: 2, Max
            Length: 2)
          type: string
          example: CA
        createdAt:
          description: Creation time
          type: string
        description:
          description: >-
            A text element to describe the supporting document. A text element
            to describe the supporting document. (Min Length: 1, Max Length:
            256)
          type: string
          example: Description
        document_type:
          description: Document type
          type: string
          enum:
            - GENERAL
            - EMISSIONS
        filename:
          description: >-
            The file name of the attachment. The file name of the attachment.
            (Min Length: 1, Max Length: 256)
          type: string
          example: Supporting_document_01.docx
        internalReportID:
          description: Internal report ID
          type: integer
        issuing_auth_name:
          description: >-
            The authority that issued the supporting document. The authority
            that issued the supporting document. (Min Length: 1, Max Length: 70)
          type: string
          example: Issuing authority name
        item_number:
          description: >-
            Import Good Item Number, sequencial This element specifies the item
            number of every CBAM Good imported of the CBAM Report. It is a
            sequential number starting at 1. (1,2..)
          type: string
          example: '1'
        line_item_number:
          description: >-
            The document line item number is the number of the Goods imported
            entry in which the supporting documents corresponding to. The
            document line item number is the number of the Goods imported entry
            in which the supporting documents corresponding to. (Pattern:
            \d{1,5})
          type: integer
          example: 88888
        mime:
          description: >-
            The MIME of the attachment. The MIME of the attachment. (Min Length:
            1, Max Length: 71)
          type: string
          example: >-
            application/vnd.openxmlformats-officedocument.wordprocessingml.document
        organizationID:
          description: Organization identifier
          type: integer
        reference_number:
          description: >-
            The reference number of the supporting document. The reference
            number of the supporting document. (Min Length: 1, Max Length: 70)
          type: string
          example: 01 Reference number
        sequence_number:
          description: 'Supporting document sequence number. (Pattern: \d{1,5})'
          type: integer
          example: 1
        type:
          description: >-
            The type of supporting document This element is used to define the
            type of emissions document that is declared. It is in the Supporting
            Documents (for emissions definition). (it is in the Supporting
            Documents (for Goods)). (Min Length: 4, Max Length: 4)
          type: string
          example: '01'
        updatedAt:
          description: Last update time
          type: string
        updatedBy:
          description: Updater identifier
          type: string
        uri:
          description: >-
            The URI link of an attachment. The URI link of an attachment. (Min
            Length: 1, Max Length: 2048)
          type: string
        validity_end_date:
          description: >-
            The end date of validity of the supporting document. The end date of
            validity of the supporting document. (Pattern: \d{4}-\d\d-\d\d)
          type: string
          example: 1/1/24
        validity_start_date:
          description: >-
            The start date of validity of the supporting document. The start
            date of validity of the supporting document. (Pattern:
            \d{4}-\d\d-\d\d)
          type: string
          example: 1/1/24
        version:
          description: Report Versions
          type: string
    models.SuccessResponse:
      description: A standard successful API response.
      type: object
      properties:
        message:
          description: A detailed success message.
          type: string
          example: Operation completed successfully
        status:
          description: HTTP status code.
          type: integer
          example: 200
    models.JSONPayloadErrorResponse:
      description: A response indicating that the JSON payload is invalid.
      type: object
      properties:
        message:
          description: A detailed error message.
          type: string
          example: The JSON payload is invalid
        status:
          description: HTTP status code.
          type: integer
          example: 400
    models.InternalServerErrorResponse:
      description: A response indicating that an internal server error occurred.
      type: object
      properties:
        message:
          description: A detailed error message.
          type: string
          example: An internal server error occurred
        status:
          description: HTTP status code.
          type: integer
          example: 500
  securitySchemes:
    BearerAuth:
      description: 'Provide your Bearer token in the format: Bearer <your_api_key>'
      type: apiKey
      name: Authorization
      in: header

````