---
title: "MergeFileAndUpdateDocument"
url: "https://devportal.jilson.dev/apis/document-generator-pkce-flow-1/versions/c7bf5731-4982-4310-bcfe-512415c7d543/operations/MergeFileAndUpdateDocument"
---

> Full API specification: https://devportal.jilson.dev/apis/document-generator-pkce-flow-1/versions/c7bf5731-4982-4310-bcfe-512415c7d543.md

# MergeFileAndUpdateDocument

`POST` `/v1/documents/{documentRID}/merge`

Operation ID: `MergeFileAndUpdateDocument`

## Path parameters

- `documentRID` (string, required)

## Request body

Content types: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json`

## Responses

- `200` - Success
- `400` - Bad Request
- `401` - Unauthorized
- `404` - Not Found

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Document Generator API
  version: "1.0"
paths:
  /v1/documents/{documentRID}/merge:
    post:
      tags:
        - Documents
      operationId: MergeFileAndUpdateDocument
      parameters:
        - name: documentRID
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: "#/components/schemas/MergePayload"
          application/json:
            schema:
              $ref: "#/components/schemas/MergePayload"
          text/json:
            schema:
              $ref: "#/components/schemas/MergePayload"
          application/*+json:
            schema:
              $ref: "#/components/schemas/MergePayload"
      responses:
        "200":
          description: Success
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
        "401":
          description: Unauthorized
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
security:
  - https://auth.sharefiletest.io:
      - docgen:all.full
      - docgen:doctemplate.packaging
      - docgen:doctemplate.template-provider
      - docgen:doctemplate.permanentdelete
components:
  schemas:
    MergePayload:
      type: object
      properties:
        mergeFieldData:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        mergeFieldValues:
          type: array
          items:
            $ref: "#/components/schemas/MergeFieldKeyValuePair"
          nullable: true
        mergeAction:
          $ref: "#/components/schemas/MergeStepAction"
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    MergeFieldKeyValuePair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          nullable: true
      additionalProperties: false
    MergeStepAction:
      enum:
        - MergeData
        - MergeVariableData
        - GenerateSignerFields
        - MergeDataAndGenerateSignerFields
        - MergeVariableDataAndGenerateSignerFields
      type: string
  securitySchemes:
    https://auth.sharefiletest.io:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://auth.sharefiletest.io/connect/authorize
          tokenUrl: https://auth.sharefiletest.io/connect/token
          scopes:
            docgen:all.full: Full access to Doc Gen APIs.
            docgen:doctemplate.packaging: Doc Template Packaging APIs Access
            docgen:doctemplate.template-provider: Document Templates full access to template provider
            docgen:doctemplate.permanentdelete: Access to permanently delete document template and metadata
```
