---
title: "POST /v1/{+parent}/documentLinks"
method: POST
path: "/v1/{+parent}/documentLinks"
tags: ["projects"]
---

# POST /v1/{+parent}/documentLinks

`POST /v1/{+parent}/documentLinks`

Create a link between a source document and a target document.

## Path parameters

- `parent` string, required

## Request body

- GoogleCloudContentwarehouseV1CreateDocumentLinkRequest — Request message for DocumentLinkService.CreateDocumentLink.
  - `requestMetadata` GoogleCloudContentwarehouseV1RequestMetadata — Meta information is used to improve the performance of the service.
    - `userInfo` GoogleCloudContentwarehouseV1UserInfo — The user information.
      - `id` string — A unique user identification string, as determined by the client. The maximum number of allowed characters is 255. Allowed characters include numbers 0 to 9, uppercase and lowercase letters, and restricted special symbols (:, @, +, -, _, ~) The format is "user:xxxx@example.com";
      - `groupIds` string[] — The unique group identifications which the user is belong to. The format is "group:yyyy@example.com";
  - `documentLink` GoogleCloudContentwarehouseV1DocumentLink — A document-link between source and target document.
    - `targetDocumentReference` GoogleCloudContentwarehouseV1DocumentReference — References to the documents.
      - `deleteTime` string, google-datetime — Output only. The time when the document is deleted.
      - `documentName` string — Required. Name of the referenced document.
      - `updateTime` string, google-datetime — Output only. The time when the document is last updated.
      - `displayName` string — display_name of the referenced document; this name does not need to be consistent to the display_name in the Document proto, depending on the ACL constraint.
      - `documentIsFolder` boolean — The document type of the document being referenced.
      - `documentIsLegalHoldFolder` boolean — Document is a folder with legal hold.
      - `documentIsRetentionFolder` boolean — Document is a folder with retention policy.
      - `snippet` string — Stores the subset of the referenced document's content. This is useful to allow user peek the information of the referenced document.
      - `createTime` string, google-datetime — Output only. The time when the document is created.
    - `updateTime` string, google-datetime — Output only. The time when the documentLink is last updated.
    - `state` 'STATE_UNSPECIFIED' | 'ACTIVE' | 'SOFT_DELETED' — The state of the documentlink. If target node has been deleted, the link is marked as invalid. Removing a source node will result in removal of all associated links.
    - `description` string — Description of this document-link.
    - `sourceDocumentReference` GoogleCloudContentwarehouseV1DocumentReference — References to the documents.
      - `deleteTime` string, google-datetime — Output only. The time when the document is deleted.
      - `documentName` string — Required. Name of the referenced document.
      - `updateTime` string, google-datetime — Output only. The time when the document is last updated.
      - `displayName` string — display_name of the referenced document; this name does not need to be consistent to the display_name in the Document proto, depending on the ACL constraint.
      - `documentIsFolder` boolean — The document type of the document being referenced.
      - `documentIsLegalHoldFolder` boolean — Document is a folder with legal hold.
      - `documentIsRetentionFolder` boolean — Document is a folder with retention policy.
      - `snippet` string — Stores the subset of the referenced document's content. This is useful to allow user peek the information of the referenced document.
      - `createTime` string, google-datetime — Output only. The time when the document is created.
    - `name` string — Name of this document-link. It is required that the parent derived form the name to be consistent with the source document reference. Otherwise an exception will be thrown. Format: projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
    - `createTime` string, google-datetime — Output only. The time when the documentLink is created.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/contentwarehouse.md) · [All operations](https://skmtc.net/google/apis/contentwarehouse/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/contentwarehouse/versions/7a5c5ed93884/schema)
