Method: projects.locations.documents.create

Creates a document.

HTTP request

POST https://contentwarehouse.googleapis.com/v1/{parent}/documents

Path parameters

Parameters
parent

string

Required. The parent name. Format: projects/{projectNumber}/locations/{location}. It takes the form projects/{project}/locations/{location}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "document": {
    object (Document)
  },
  "requestMetadata": {
    object (RequestMetadata)
  },
  "policy": {
    object (Policy)
  },
  "cloudAiDocumentOption": {
    object (CloudAIDocumentOption)
  },
  "createMask": string
}
Fields
document

object (Document)

Required. The document to create.

requestMetadata

object (RequestMetadata)

The meta information collected about the end user, used to enforce access control for the service.

policy

object (Policy)

Default document policy during creation. This refers to an Identity and Access (IAM) policy, which specifies access controls for the Document. Conditions defined in the policy will be ignored.

cloudAiDocumentOption

object (CloudAIDocumentOption)

Request Option for processing Cloud AI Document in Document Warehouse. This field offers limited support for mapping entities from Cloud AI Document to Warehouse Document. Please consult with product team before using this field and other available options.

createMask

string (FieldMask format)

Field mask for creating Document fields. If mask path is empty, it means all fields are masked. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Response body

Response message for DocumentService.CreateDocument.

If successful, the response body contains data with the following structure:

JSON representation
{
  "document": {
    object (Document)
  },
  "ruleEngineOutput": {
    object (RuleEngineOutput)
  },
  "metadata": {
    object (ResponseMetadata)
  },
  "longRunningOperations": [
    {
      object (Operation)
    }
  ]
}
Fields
document

object (Document)

Document created after executing create request.

ruleEngineOutput

object (RuleEngineOutput)

Output from Rule Engine recording the rule evaluator and action executor's output.

Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto

metadata

object (ResponseMetadata)

Additional information for the API invocation, such as the request tracking id.

longRunningOperations[]

object (Operation)

post-processing LROs

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • contentwarehouse.documents.create

For more information, see the IAM documentation.