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

# Post documentv1beta1 attachments

> Updates the content of an attachment (in an AODocs document). The new content can come either from an already pushed revision of the Drive file (the latest) or from another file in Drive. When updating the content, the document may be versioned to keep reference to the previous content of the attachment.



## OpenAPI

````yaml /openapis/documentId.json post /document/v1beta1/{documentId}/attachments/{attachmentDriveFileId}
openapi: 3.0.1
info:
  description: "The AODocs REST API exposes most of the features of AODocs. It can be used to implement custom applications, third-party integration, bulk tools, or\n\t\t\t\t\t\t\t\t\t\tjust to experiment with AODocs."
  version: 69.5.1
  title: AODocs REST API
servers:
  - url: https://aodocs.altirnao.com/api
security: []
tags:
  - name: documentId
    description: >-
      Lets you read and update document properties, create new documents, delete
      documents, manage document versions, ...  (beta version, subject to
      change)
paths:
  /document/v1beta1/{documentId}/attachments/{attachmentDriveFileId}:
    post:
      tags:
        - documentId
      description: >-
        Updates the content of an attachment (in an AODocs document). The new
        content can come either from an already pushed revision of the Drive
        file (the latest) or from another file in Drive. When updating the
        content, the document may be versioned to keep reference to the previous
        content of the attachment.
      operationId: documentId:v1beta1.Document.updateAttachment
      parameters:
        - $ref: '#/components/parameters/documentId_path_parameter'
        - name: attachmentDriveFileId
          in: path
          description: >-
            The ID of the file on Drive to be updated (must belong to the
            document identified by parameter documentId)
          required: true
          schema:
            type: string
        - name: createNewDocumentVersion
          in: query
          description: >-
            Whether a new version of the document should be created based on the
            new content of the attachment (else it's just an update of the
            current version)
          required: false
          schema:
            type: boolean
            default: false
        - name: versionName
          in: query
          description: >-
            The name of the new version to be created (required if
            createNewDocumentVersion = true)
          required: false
          schema:
            type: string
        - name: versionDescription
          in: query
          description: >-
            The description of the new version to be created (optional but only
            relevant if createNewDocumentVersion = true)
          required: false
          schema:
            type: string
        - name: sourceDriveFileId
          in: query
          description: >-
            The ID of a file in Drive to update the selected attachment's
            content with. Leave empty if a new revision of the attachment file
            was already uploaded in Drive.
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/securityCode_query_parameter'
        - $ref: '#/components/parameters/domain_query_parameter'
        - name: forceUpdateAttachedFileFromDrive
          in: query
          description: >-
            Retrieve the latest state of the file from Drive and update the
            document accordingly
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: A ApiJobId response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiJobId'
      security:
        - google_id_token-a99f12e0:
            - https://www.googleapis.com/auth/userinfo.email
        - google_id_token_legacy-a99f12e0:
            - https://www.googleapis.com/auth/userinfo.email
components:
  parameters:
    documentId_path_parameter:
      name: documentId
      in: path
      description: The ID of the document
      required: true
      schema:
        type: string
    securityCode_query_parameter:
      name: securityCode
      in: query
      description: The security code
      required: false
      schema:
        type: string
    domain_query_parameter:
      name: domain
      in: query
      description: The G Suite domain
      required: false
      schema:
        type: string
  schemas:
    ApiJobId:
      type: object
      properties:
        jobId:
          type: string
        kind:
          type: string
  securitySchemes:
    google_id_token-a99f12e0:
      type: oauth2
      x-google-issuer: https://accounts.google.com
      x-google-jwks_uri: https://www.googleapis.com/oauth2/v1/certs
      x-google-audiences: >-
        755040865326-h5gomu85549lkh2qf9d3lku39vnaf6ii.apps.googleusercontent.com,563231141203-231sn7f6ptedncun5h00h7ktbe3o2nd5.apps.googleusercontent.com,993707107224.apps.googleusercontent.com,ao-docs,aodocs-core-eu-1,ao-docs-staging,ao-docs-dev,aodocs-core-dev-us,aodocs-total-poc-euw3
      flows:
        implicit:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          scopes:
            https://www.googleapis.com/auth/userinfo.email: View your email address
    google_id_token_legacy-a99f12e0:
      type: oauth2
      x-google-issuer: accounts.google.com
      x-google-jwks_uri: https://www.googleapis.com/oauth2/v1/certs
      x-google-audiences: >-
        755040865326-h5gomu85549lkh2qf9d3lku39vnaf6ii.apps.googleusercontent.com,563231141203-231sn7f6ptedncun5h00h7ktbe3o2nd5.apps.googleusercontent.com,993707107224.apps.googleusercontent.com,ao-docs,aodocs-core-eu-1,ao-docs-staging,ao-docs-dev,aodocs-core-dev-us,aodocs-total-poc-euw3
      flows:
        implicit:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          scopes:
            https://www.googleapis.com/auth/userinfo.email: View your email address

````