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

# POST /v1/{+parent}/jobs

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

Creates a batch job.

## Path parameters

- `parent` string, required

## Query parameters

- `jobId` string
- `requestId` string

## Request body

- Job — The storage batch operations job description.
  - `putMetadata` PutMetadata — Describes options for object metadata update.
    - `contentDisposition` string — Optional. Updates objects `Content-Disposition` fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see [Content-Disposition](https://cloud.google.com/storage/docs/metadata#content-disposition).
    - `customMetadata` object — Optional. Updates the object's custom metadata. This operation adds or sets individual custom metadata key-value pairs. Keys specified with empty values have their values cleared. Existing custom metadata keys not included in the request remain unchanged. For details, see [Custom metadata](https://cloud.google.com/storage/docs/metadata#custom-metadata).
    - `contentEncoding` string — Optional. Updates the objects `Content-Encoding` fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see [Content-Encoding](https://cloud.google.com/storage/docs/metadata#content-encoding).
    - `contentType` string — Optional. Updates objects `Content-Type` fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see [Content-Type](https://cloud.google.com/storage/docs/metadata#content-type).
    - `cacheControl` string — Optional. Updates the objects `Cache-Control` fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. Additionally, the value for `Custom-Time` can't decrease. For details, see [Cache-Control](https://cloud.google.com/storage/docs/metadata#caching_data).
    - `customTime` string — Optional. Updates the objects `Custom-Time` fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. The time must be specified in RFC 3339 format, for example `YYYY-MM-DD'T'HH:MM:SS'Z'` or `YYYY-MM-DD'T'HH:MM:SS.SS'Z'`. For details, see [Custom-Time](https://cloud.google.com/storage/docs/metadata#custom-time).
    - `objectRetention` ObjectRetention — Describes options for object retention update.
      - `retainUntilTime` string — Required. The object's retention expiration time, during which, the object is protected from being deleted or overwritten. The time must be specified in RFC 3339 format, for example `YYYY-MM-DD'T'HH:MM:SS'Z'` or `YYYY-MM-DD'T'HH:MM:SS.SS'Z'`. To clear an object's retention, both `retentionMode` and `retainUntilTime` must be left unset (omitted). Setting `retentionMode` to `RETENTION_MODE_UNSPECIFIED` is treated as a no-op. Unlike an unset field, it doesn't modify or clear the retention settings.
      - `retentionMode` 'RETENTION_MODE_UNSPECIFIED' | 'LOCKED' | 'UNLOCKED' — Required. The retention mode.
    - `contentLanguage` string — Optional. Updates the objects `Content-Language` fixed metadata. Metadata values must use ISO 639-1 language codes. The maximum length for metadata values is 100 characters. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see [Content-Language](https://cloud.google.com/storage/docs/metadata#content-language).
  - `dryRun` boolean — Optional. If true, the job runs in dry run mode, returning the total object count and, if the object configuration is a prefix list, the bytes found from source. No transformations are performed.
  - `state` 'STATE_UNSPECIFIED' | 'RUNNING' | 'SUCCEEDED' | 'CANCELED' | 'FAILED' | 'QUEUED' — Output only. State of the job.
  - `bucketList` BucketList — Describes list of buckets and their objects to be transformed.
    - `buckets` Bucket[] — Required. List of buckets and their objects to be transformed. You can specify only one bucket per job. If multiple buckets are specified, an error occurs.
      - `prefixList` PrefixList — Describes prefixes of objects to be transformed.
        - `includedObjectPrefixes` string[] — Optional. Specify one or more object prefixes. For example: * To match one object, use a single prefix, `prefix1`. * To match multiple objects, use comma-separated prefixes, `prefix1, prefix2`. * To match all objects, use an empty prefix, `''`
      - `manifest` Manifest — Describes list of objects to be transformed.
        - `manifestLocation` string — Required. Specify the manifest file location. The format of manifest location can be an absolute path to the object in the format of `gs://bucket_name/path/object_name`. For example, `gs://bucket_name/path/object_name.csv`. Alternatively, you can specify an absolute path with a single wildcard character in the file name, for example `gs://bucket_name/path/file_name*.csv`. If the manifest location is specified with a wildcard, objects in all manifest files matching the pattern will be acted upon. The manifest is a CSV file, uploaded to Cloud Storage, that contains one object or a list of objects that you want to process. Each row in the manifest must include the `bucket` and `name` of the object. You can optionally specify the `generation` of the object. If you don't specify the `generation`, the current version of the object is used. You can optionally include a header row with the following format: `bucket,name,generation`. For example, bucket,name,generation bucket_1,object_1,generation_1 bucket_1,object_2,generation_2 bucket_1,object_3,generation_3 Note: The manifest file must specify only objects within the bucket provided to the job. Rows referencing objects in other buckets are ignored.
      - `bucket` string — Required. Bucket name for the objects to be transformed.
  - `rewriteObject` RewriteObject — Describes options for object rewrite.
    - `kmsKey` string — Optional. Resource name of the Cloud KMS key that is used to encrypt the object. The Cloud KMS key must be located in same location as the object. For details, see https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key Format: `projects/{project_id}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` For example: `projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key`. The object will be rewritten and set with the specified KMS key.
    - `storageClass` 'STORAGE_CLASS_UNSPECIFIED' | 'STANDARD' | 'NEARLINE' | 'COLDLINE' | 'ARCHIVE' — Optional. Rewrites the object to the specified storage class. Setting this field will perform a full byte copy of the object if the storage class is different from the object's current storage class. If Autoclass is enabled on the bucket, storage class changes are ignored by Cloud Storage.
  - `setObjectAcls` SetObjectAcls — Describes options for setting object ACLs.
    - `accessControlsUpdates` AccessControlsUpdates — Represents updates to existing access-control entries on an object.
      - `grants` ObjectAccessControl[] — Optional. Grants to add or update. If a grant for same entity exists, its role is updated.
        - `entity` string — Required. The entity holding the permission, in one of the following forms: * `allUsers` * `allAuthenticatedUsers`
        - `role` string — Required. The role to grant. Acceptable values are: * `READER` - gives read access to the object. * `OWNER` - gives owner access to the object.
      - `removeEntities` string[] — Optional. Entities for which all grants should be removed. An entity can't be in both `grants` and `remove_entities`.
  - `deleteObject` DeleteObject — Describes options to delete an object.
    - `permanentObjectDeletionEnabled` boolean — Required. Controls deletion behavior when versioning is enabled for the object's bucket. If true, both live and noncurrent objects will be permanently deleted. Otherwise live objects in versioned buckets will become noncurrent and objects that were already noncurrent will be skipped. This setting doesn't have any impact on the Soft Delete feature. All objects deleted by this service can be be restored for the duration of the Soft Delete retention duration if enabled. If enabled and the manifest doesn't specify an object's generation, a `GetObjectMetadata` call is made to determine the live object generation.
  - `projectSource` ProjectSource — Describes the project source where the objects satisfying the filters will be transformed.
    - `dryRunJobId` string — Optional. The unique identifier of a dry run job to use as the baseline for the current job. Specifying this ID ensures the job is executed against the same set of objects validated during the dry run. The value corresponds to the {job_id} segment of the resource name: `projects/{project_id}/locations/{location}/jobs/{job_id}`.
    - `targetLocations` TargetLocations — Describes the Cloud Storage locations to include in a ProjectSource job.
      - `locations` string[] — Required. REQUIRED. A list of Cloud Storage locations (e.g., `us-central1`) to include in the job. If `snapshot_time` is omitted, the job automatically defaults to the most recent snapshot timestamp that is successfully populated in BOTH the `object_attributes_view` and `bucket_attributes_view` across ALL specified locations. For details on Storage Insights dataset snapshots and views, see: https://docs.cloud.google.com/storage/docs/insights/dataset-tables-and-schemas#schema
      - `snapshotTime` string, google-datetime — Optional. OPTIONAL. The exact Storage Insights snapshot timestamp to use for the job compatible with the RFC 3339 format (e.g., `2024-01-02T03:04:05Z`). If specified, this exact snapshot must exist in BOTH the `object_attributes_view` and `bucket_attributes_view` for every location listed in `locations`. If the snapshot is missing from either view in any of the locations, the job fails.
    - `project` string — Required. Project name of the objects to be transformed. e.g. projects/my-project or projects/123456.
    - `bucketFilters` Expr — Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
      - `expression` string — Textual representation of an expression in Common Expression Language syntax.
      - `title` string — Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
      - `description` string — Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
      - `location` string — Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    - `insightsDatasetConfig` string — Required. The resource identifier of the Storage Insights dataset configuration. Storage batch operations uses the latest snapshot from this dataset as the source to list and filter target objects. Format: `projects/{project_id}/locations/{location}/datasetConfigs/{dataset_config}`.
    - `snapshotTime` string, google-datetime — Output only. The snapshot time used by the job to read the Storage Insights dataset for bucket and object discovery. This field is populated by the service and reflects the exact timestamp of the dataset snapshot used.
    - `objectFilters` Expr — Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
      - `expression` string — Textual representation of an expression in Common Expression Language syntax.
      - `title` string — Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
      - `description` string — Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
      - `location` string — Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
  - `createTime` string, google-datetime — Output only. The time that the job was created.
  - `loggingConfig` LoggingConfig — Specifies the Cloud Logging behavior.
    - `logActions` string[] — Required. Specifies the actions to be logged.
    - `logActionStates` string[] — Required. States in which Action are logged.If empty, no logs are generated.
  - `isMultiBucketJob` boolean — Output only. If true, this job operates on multiple buckets. Multi-bucket jobs are subject to different quota limits than single-bucket jobs.
  - `putObjectHold` PutObjectHold — Describes options to update object hold.
    - `temporaryHold` 'HOLD_STATUS_UNSPECIFIED' | 'SET' | 'UNSET' — Required. Updates object temporary holds state. When object temporary hold is set, object can't be deleted or replaced.
    - `eventBasedHold` 'HOLD_STATUS_UNSPECIFIED' | 'SET' | 'UNSET' — Required. Updates object event based holds state. When object event based hold is set, object can't be deleted or replaced. Resets object's time in the bucket for the purposes of the retention period.
  - `name` string — Identifier. The resource name of the job. Format: `projects/{project_id}/locations/global/jobs/{job_id}`. For example: `projects/123456/locations/global/jobs/job01`. `job_id` is unique in a given project.
  - `updateObjectCustomContext` UpdateObjectCustomContext — Describes options to update object custom contexts.
    - `customContextUpdates` CustomContextUpdates — Describes a collection of updates to apply to custom contexts identified by key.
      - `updates` object — Optional. Insert or update the existing custom contexts.
      - `keysToClear` string[] — Optional. Custom contexts to clear by key. A key can't be present in both `updates` and `keys_to_clear`.
    - `clearAll` boolean — If set, must be set to true and all existing object custom contexts are deleted.
  - `counters` Counters — Describes details about the progress of the job.
    - `totalObjectCount` string, int64 — Output only. Number of objects listed.
    - `totalBytesTransformed` string, int64 — Output only. The total number of bytes affected by the transformation. For example, this counts bytes deleted for `DeleteObject` operations and bytes rewritten for `RewriteObject` operations.
    - `succeededObjectCount` string, int64 — Output only. Number of objects completed.
    - `failedObjectCount` string, int64 — Output only. The number of objects that failed due to user errors or service errors.
    - `objectCustomContextsUpdated` string, int64 — Output only. Number of object custom contexts updated. This counter tracks custom contexts where the key already existed, but the payload was modified. This field is only populated for jobs with the UpdateObjectCustomContext transformation.
    - `objectCustomContextsDeleted` string, int64 — Output only. Number of object custom contexts deleted. This field is only populated for jobs with the UpdateObjectCustomContext transformation.
    - `totalBytesFound` string, int64 — Output only. Number of bytes found from source. This field is only populated for jobs with a prefix list object configuration.
    - `objectCustomContextsCreated` string, int64 — Output only. Number of object custom contexts created. This field is only populated for jobs with the UpdateObjectCustomContext transformation.
  - `scheduleTime` string, google-datetime — Output only. The time that the job was scheduled.
  - `completeTime` string, google-datetime — Output only. The time that the job was completed.
  - `description` string — Optional. A user-provided description for the job. Maximum length: 1024 bytes when unicode-encoded.
  - `errorSummaries` ErrorSummary[] — Output only. Summarizes errors encountered with sample error log entries.
    - `errorCode` 'OK' | 'CANCELLED' | 'UNKNOWN' | 'INVALID_ARGUMENT' | 'DEADLINE_EXCEEDED' | 'NOT_FOUND' | 'ALREADY_EXISTS' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'RESOURCE_EXHAUSTED' | 'FAILED_PRECONDITION' | 'ABORTED' | 'OUT_OF_RANGE' | 'UNIMPLEMENTED' | 'INTERNAL' | 'UNAVAILABLE' | 'DATA_LOSS' — Required. The canonical error code.
    - `errorCount` string, int64 — Required. Number of errors encountered per `error_code`.
    - `errorLogEntries` ErrorLogEntry[] — Required. Sample error logs.
      - `objectUri` string — Required. Output only. Object URL. e.g. gs://my_bucket/object.txt
      - `errorDetails` string[] — Optional. Output only. At most 5 error log entries are recorded for a given error code for a job.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/storagebatchoperations.md) · [All operations](https://skmtc.dev/google/apis/storagebatchoperations/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/storagebatchoperations/revisions/eff63b4c320d/schema)
