---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/metadataJobs"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/metadataJobs"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/metadataJobs

`POST /v1/projects/{projectsId}/locations/{locationsId}/metadataJobs`

## Request

- Base URL: `https://dataplex.googleapis.com`
- URL: `https://dataplex.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/metadataJobs`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/dataplex.read-write`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/dataplex.read-write`

Creates a metadata job. For example, use a metadata job to import metadata from a third-party system into Dataplex Universal Catalog.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `metadataJobId` string
- `validateOnly` boolean

## Request body

- GoogleCloudDataplexV1MetadataJob: A metadata job resource.
  - `createTime` string, google-datetime: Output only. The time when the metadata job was created.
  - `exportResult` GoogleCloudDataplexV1MetadataJobExportJobResult: Summary results from a metadata export job. The results are a snapshot of the metadata at the time when the job was created. The exported entries are saved to a Cloud Storage bucket.
    - `errorMessage` string: Output only. The error message if the metadata export job failed.
    - `exportedEntries` string, int64: Output only. The number of entries that were exported.
  - `exportSpec` GoogleCloudDataplexV1MetadataJobExportJobSpec: Job specification for a metadata export job.
    - `outputPath` string: Required. The root path of the Cloud Storage bucket to export the metadata to, in the format gs://{bucket}/. You can optionally specify a custom prefix after the bucket name, in the format gs://{bucket}/{prefix}/. The maximum length of the custom prefix is 128 characters. Dataplex Universal Catalog constructs the object path for the exported files by using the bucket name and prefix that you provide, followed by a system-generated path.The bucket must be in the same VPC Service Controls perimeter as the job.
    - `scope` GoogleCloudDataplexV1MetadataJobExportJobSpecExportJobScope: The scope of the export job.
      - `aspectTypes` string[]: The aspect types that are in scope for the export job, specified as relative resource names in the format projects/{project_id_or_number}/locations/{location}/aspectTypes/{aspect_type_id}. Only aspects that belong to the specified aspect types are affected by the job.
      - `entryGroups` string[]: The entry groups whose metadata you want to export, in the format projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}. Only the entries in the specified entry groups are exported.The entry groups must be in the same location and the same VPC Service Controls perimeter as the job.If you set the job scope to be a list of entry groups, then set the organization-level export flag to false and don't provide a list of projects.
      - `entryTypes` string[]: The entry types that are in scope for the export job, specified as relative resource names in the format projects/{project_id_or_number}/locations/{location}/entryTypes/{entry_type_id}. Only entries that belong to the specified entry types are affected by the job.
      - `organizationLevel` boolean: Whether the metadata export job is an organization-level export job. If true, the job exports the entries from the same organization and VPC Service Controls perimeter as the job. The project that the job belongs to determines the VPC Service Controls perimeter. If you set the job scope to be at the organization level, then don't provide a list of projects or entry groups. If false, you must specify a list of projects or a list of entry groups whose entries you want to export.The default is false.
      - `projects` string[]: The projects whose metadata you want to export, in the format projects/{project_id_or_number}. Only the entries from the specified projects are exported.The projects must be in the same organization and VPC Service Controls perimeter as the job.If you set the job scope to be a list of projects, then set the organization-level export flag to false and don't provide a list of entry groups.
  - `importResult` GoogleCloudDataplexV1MetadataJobImportJobResult: Results from a metadata import job.
    - `createdEntries` string, int64: Output only. The total number of entries that were created.
    - `createdEntryLinks` string, int64: Output only. The total number of entry links that were successfully created.
    - `deletedEntries` string, int64: Output only. The total number of entries that were deleted.
    - `deletedEntryLinks` string, int64: Output only. The total number of entry links that were successfully deleted.
    - `recreatedEntries` string, int64: Output only. The total number of entries that were recreated.
    - `unchangedEntries` string, int64: Output only. The total number of entries that were unchanged.
    - `unchangedEntryLinks` string, int64: Output only. The total number of entry links that were left unchanged.
    - `updateTime` string, google-datetime: Output only. The time when the status was updated.
    - `updatedEntries` string, int64: Output only. The total number of entries that were updated.
  - `importSpec` GoogleCloudDataplexV1MetadataJobImportJobSpec: Job specification for a metadata import job.You can run the following kinds of metadata import jobs: Full sync of entries with incremental import of their aspects. Supported for custom entries. Incremental import of aspects only. Supported for aspects that belong to custom entries and system entries. For custom entries, you can modify both optional aspects and required aspects. For system entries, you can modify optional aspects.
    - `aspectSyncMode` 'SYNC_MODE_UNSPECIFIED' | 'FULL' | 'INCREMENTAL' | 'NONE': Required. The sync mode for aspects.
    - `entrySyncMode` 'SYNC_MODE_UNSPECIFIED' | 'FULL' | 'INCREMENTAL' | 'NONE': Required. The sync mode for entries.
    - `logLevel` 'LOG_LEVEL_UNSPECIFIED' | 'DEBUG' | 'INFO': Optional. The level of logs to write to Cloud Logging for this job.Debug-level logs provide highly-detailed information for troubleshooting, but their increased verbosity could incur additional costs (https://cloud.google.com/stackdriver/pricing) that might not be merited for all jobs.If unspecified, defaults to INFO.
    - `scope` GoogleCloudDataplexV1MetadataJobImportJobSpecImportJobScope: A boundary on the scope of impact that the metadata import job can have.
      - `aspectTypes` string[]: Optional. The aspect types that are in scope for the import job, specified as relative resource names in the format projects/{project_number_or_id}/locations/{location_id}/aspectTypes/{aspect_type_id}. The job modifies only the aspects that belong to these aspect types.This field is required when creating an aspect-only import job.If the metadata import file attempts to modify an aspect whose type isn't included in this list, the import job is halted before modifying any entries or aspects.The location of an aspect type must either match the location of the job, or the aspect type must be global.
      - `entryGroups` string[]: Required. The entry groups that are in scope for the import job, specified as relative resource names in the format projects/{project_number_or_id}/locations/{location_id}/entryGroups/{entry_group_id}. Only entries and aspects that belong to the specified entry groups are affected by the job.The entry groups and the job must be in the same location.
      - `entryLinkTypes` string[]: Optional. The entry link types that are in scope for the import job, specified as relative resource names in the format projects/{project_number_or_id}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}. The job modifies only the entryLinks that belong to these entry link types.If the metadata import file attempts to create or delete an entry link whose entry link type isn't included in this list, the import job will skip those entry links.
      - `entryTypes` string[]: Required. The entry types that are in scope for the import job, specified as relative resource names in the format projects/{project_number_or_id}/locations/{location_id}/entryTypes/{entry_type_id}. The job modifies only the entries and aspects that belong to these entry types.If the metadata import file attempts to modify an entry whose type isn't included in this list, the import job is halted before modifying any entries or aspects.The location of an entry type must either match the location of the job, or the entry type must be global.
      - `glossaries` string[]: Optional. The glossaries that are in scope for the import job, specified as relative resource names in the format projects/{project_number_or_id}/locations/{location_id}/glossaries/{glossary_id}.While importing Business Glossary entries, the user must provide glossaries. While importing entries, the user does not have to provide glossaries. If the metadata import file attempts to modify Business Glossary entries whose glossary isn't included in this list, the import job will skip those entries.The location of a glossary must either match the location of the job, or the glossary must be global.
      - `referencedEntryScopes` string[]: Optional. Defines the scope of entries that can be referenced in the entry links.Currently, projects are supported as valid scopes. Format: projects/{project_number_or_id}If the metadata import file attempts to create an entry link which references an entry that is not in the scope, the import job will skip that entry link.
    - `sourceCreateTime` string, google-datetime: Optional. The time when the process that created the metadata import files began.
    - `sourceStorageUri` string: Optional. The URI of a Cloud Storage bucket or folder (beginning with gs:// and ending with /) that contains the metadata import files for this job.A metadata import file defines the values to set for each of the entries and aspects in a metadata import job. For more information about how to create a metadata import file and the file requirements, see Metadata import file (https://cloud.google.com/dataplex/docs/import-metadata#metadata-import-file).You can provide multiple metadata import files in the same metadata job. The bucket or folder must contain at least one metadata import file, in JSON Lines format (either .json or .jsonl file extension).In FULL entry sync mode, don't save the metadata import file in a folder named SOURCE_STORAGE_URI/deletions/.Caution: If the metadata import file contains no data, all entries and aspects that belong to the job's scope are deleted.
  - `labels` object: Optional. User-defined labels.
  - `name` string: Output only. Identifier. The name of the resource that the configuration is applied to, in the format projects/{project_number}/locations/{location_id}/metadataJobs/{metadata_job_id}.
  - `status` GoogleCloudDataplexV1MetadataJobStatus: Metadata job status.
    - `completionPercent` integer: Output only. Progress tracking.
    - `message` string: Output only. Message relating to the progression of a metadata job.
    - `state` 'STATE_UNSPECIFIED' | 'QUEUED' | 'RUNNING' | 'CANCELING' | 'CANCELED' | 'SUCCEEDED' | 'FAILED' | 'SUCCEEDED_WITH_ERRORS': Output only. State of the metadata job.
    - `updateTime` string, google-datetime: Output only. The time when the status was updated.
  - `type` 'TYPE_UNSPECIFIED' | 'IMPORT' | 'EXPORT': Required. Metadata job type.
  - `uid` string: Output only. A system-generated, globally unique ID for the metadata job. If the metadata job is deleted and then re-created with the same name, this ID is different.
  - `updateTime` string, google-datetime: Output only. The time when the metadata job was updated.

## Response `200`

Successful response

- GoogleLongrunningOperation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
  - `error` GoogleRpcStatus: The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.

## Changes

- **2026-12-05** `5d0894669d35`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-09** `a87e571d134a`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/dataplex/changes/v1/projects/:projectsId/locations/:locationsId/metadataJobs/post.md)

---

[API](https://skmtc.dev/google/apis/dataplex.md) - [All operations](https://skmtc.dev/google/apis/dataplex/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/dataplex/revisions/5d0894669d35?raw)
