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

# Update a document

> Update a document for the user.




## OpenAPI

````yaml https://production.hifi.com/api/v2/openapi.json post /v2/users/{userId}/kyc/documents/{documentId}
openapi: 3.0.0
info:
  title: Hifi API
  version: 2.0.0
  description: API documentation for Hifi
servers:
  - url: https://production.hifibridge.com
    description: Production server
  - url: https://sandbox.hifibridge.com
    description: Sandbox server
security:
  - bearerAuth: []
tags:
  - name: Common
    description: Common endpoints
  - name: User
    description: User endpoints
  - name: Kyc
    description: Kyc endpoints
  - name: Wallet
    description: Wallet endpoints
  - name: Account
    description: Account endpoints
  - name: External Account
    description: External Account endpoints for managing beneficiary bank accounts
  - name: Fiat Account
    description: Fiat Account endpoints
  - name: Virtual Account
    description: Virtual Account endpoints
  - name: Onramp
    description: Onramp endpoints
  - name: Offramp
    description: Offramp endpoints
  - name: Orchestration Address
    description: >-
      Orchestration Address endpoints — persistent on-chain wallets that
      automatically off-ramp incoming stablecoin deposits to a USD bank account
  - name: Crypto Transfer
    description: Crypto Transfer endpoints
  - name: Cross-Chain Bridge
    description: Cross-Chain Bridge endpoints
  - name: Token Swap
    description: Token Swap endpoints
  - name: Canton Offers
    description: Canton Offers endpoints
  - name: Transfer Rules
    description: Transfer approval rules and configuration
  - name: Transfer Approvals
    description: Transfer approval workflow and admin actions
  - name: File
    description: File endpoints
  - name: Reporting
    description: Reporting and metrics endpoints
paths:
  /v2/users/{userId}/kyc/documents/{documentId}:
    post:
      tags:
        - Kyc
      summary: Update a document
      description: |
        Update a document for the user.
      parameters:
        - $ref: '#/components/parameters/UserIdPathParameter'
        - $ref: '#/components/parameters/DocumentIdPathParameter'
      requestBody:
        $ref: '#/components/requestBodies/UpdateDocumentBody'
      responses:
        '200':
          $ref: '#/components/responses/DocumentObjectResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  parameters:
    UserIdPathParameter:
      name: userId
      in: path
      schema:
        type: string
      description: ID of the user
      required: true
    DocumentIdPathParameter:
      name: documentId
      in: path
      schema:
        type: string
      description: The ID of the document.
      required: true
  requestBodies:
    UpdateDocumentBody:
      required: true
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/IndividualDocumentUpdate'
              - $ref: '#/components/schemas/BusinessDocumentUpdate'
  responses:
    DocumentObjectResponse:
      description: Success
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentObject'
          examples:
            DocumentObjectIndividualExample:
              $ref: '#/components/examples/DocumentObjectIndividualExample'
            DocumentObjectBusinessExample:
              $ref: '#/components/examples/DocumentObjectBusinessExample'
            DocumentObjectUboExample:
              $ref: '#/components/examples/DocumentObjectUboExample'
    UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              error:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
  schemas:
    IndividualDocumentUpdate:
      type: object
      title: Update Individual Document
      properties:
        issuedCountry:
          type: string
          description: Three-letter alpha-3 country code as defined in the ISO 3166-1 spec.
        issuedDate:
          type: string
          description: Date of issue of the document.
          format: date
        expiryDate:
          type: string
          description: Expiry date of the document.
          format: date
        number:
          type: string
          description: If applicable, unique identification number of the document.
        description:
          type: string
          description: Description of the document. Required if type is `OTHER`.
        url:
          type: string
          deprecated: true
          description: >
            URL of the document. Either `url` or `fileId` is required, but not
            both.


            *Maximum file size 10MB and minimum file size 10KB


            *Valid file types: .pdf, .jpeg, .jpg, .png, .heic, .tif
        fileId:
          type: string
          description: >-
            The file ID returned from the file upload endpoint. Either `url` or
            `fileId` is required, but not both.
    BusinessDocumentUpdate:
      type: object
      title: Update Business Document
      properties:
        issuedCountry:
          type: string
          description: Three-letter alpha-3 country code as defined in the ISO 3166-1 spec.
        issuedDate:
          type: string
          description: Date of issue of the document.
          format: date
        expiryDate:
          type: string
          description: Expiry date of the document.
          format: date
        number:
          type: string
          description: If applicable, unique identification number of the document.
        description:
          type: string
          description: Description of the document. Required if type is `OTHER`.
        url:
          type: string
          deprecated: true
          description: >
            URL of the document. Either `url` or `fileId` is required, but not
            both.


            *Maximum file size 10MB and minimum file size 10KB


            *Valid file types: .pdf, .jpeg, .jpg, .png, .heic, .tif
        fileId:
          type: string
          description: >-
            The file ID returned from the file upload endpoint. Either `url` or
            `fileId` is required, but not both.
    DocumentObject:
      type: object
      title: Document Object
      properties:
        type:
          type: string
        subType:
          type: string
        issuedCountry:
          type: string
        issuedDate:
          type: string
          format: date
        expiryDate:
          type: string
          format: date
        number:
          type: string
        description:
          type: string
        url:
          type: string
          deprecated: true
        fileId:
          type: string
        uboId:
          type: string
    Unauthorized:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        error:
          type: string
          description: Error type
        errorDetails:
          type: string
          description: Detailed error message
    InternalServerError:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        error:
          type: string
          description: Error type
        errorDetails:
          type: string
          description: Detailed error message
  examples:
    DocumentObjectIndividualExample:
      summary: Document Object (Individual)
      value:
        id: d9f38450-ec16-4a4b-bf69-f8c88bb73a94
        type: PASSPORT
        subType: SINGLE_SIDE
        issuedCountry: USA
        issuedDate: null
        expiryDate: null
        number: null
        description: null
        url: https://example.com/doc_123
        fileId: file_zEFpbPhk71NaQfEVMR544
    DocumentObjectBusinessExample:
      summary: Document Object (Business)
      value:
        id: 7c9439f6-655b-4aeb-9b32-e17759ee9134
        type: CERTIFICATE_OF_INCORPORATION
        subType: SINGLE_SIDE
        issuedCountry: USA
        issuedDate: null
        expiryDate: null
        number: null
        description: null
        url: https://example.com/doc_123
        fileId: file_zEFpbPhk71NaQfEVMR544
        uboId: null
    DocumentObjectUboExample:
      summary: Document Object (UBO)
      value:
        id: 7a9dc485-3216-47fd-baa4-a7ab4085b723
        type: PASSPORT
        subType: SINGLE_SIDE
        issuedCountry: USA
        issuedDate: null
        expiryDate: null
        number: null
        description: null
        url: https://example.com/doc_123
        fileId: file_zEFpbPhk71NaQfEVMR544
        uboId: 3285c3be-ef36-4f01-bf95-578d3116f0ff
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````