CreateC2paBucketSignTask

Updated at:

Creates a batch C2PA content credential signing task for files in a specified OSS bucket.

Operation description

Creates a batch standard C2PA content credential signing task for an OSS bucket. The service recursively scans non-directory objects under SourcePrefix and supports JPEG/JPG, PNG, and MP4, as well as FLAC, M4A, MP3, and WAV audio files. By default, a single task includes up to 20,000 non-directory objects, and the size of a single file cannot exceed 800 MiB.

Before you call this operation, make sure that the AliyunServiceRoleForAIDeepSign service-linked role has been granted the OSS List and Get permissions on the source prefix, and the Get and Put permissions on the output prefix. SourceType, SoftwareAgent, and CustomAssertions are optional parameters. The values specified during creation are applied to each file in the batch.

A successful creation only indicates that the task has been accepted. Save the returned TaskId and call GetC2paSignResult to query the status and statistics. You can use PauseC2paBucketSignTask, ResumeC2paBucketSignTask, and CancelC2paBucketSignTask to control the task.

The signature files are written to ai-deepsign-signed/<TaskId>/<folder of the object relative to SourcePrefix>/<original file name>_signed.<extension> in the same bucket, preserving the relative subdirectory and source file extensions. The final JSON report is saved as ai-deepsign-signed/<TaskId>/c2pa_report.json.

This operation is metered based on the number of successfully signed files. The same account can create multiple tasks for the same bucket and prefix, and each task uses an independent output directory. Duplicate creations may result in duplicate signing and metering.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

aideepsign:CreateC2paBucketSignTask

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

BucketRegionId

string

Yes

The region where the OSS bucket is located. The value can be up to 64 characters in length and must match the actual region of the bucket. Example: cn-hangzhou.

cn-hangzhou

BucketName

string

Yes

The name of the OSS bucket. The name must be 3 to 63 characters in length. Before you call this operation, you must authorize the AliyunServiceRoleForAIDeepSign service-linked role to read the source files, and access and write the signing results and reports.

example-bucket

SourcePrefix

string

Yes

The prefix of the objects to be processed. The prefix can be up to 1,023 UTF-8 bytes in length and must be ai-deepsign/ or its subdirectory. If the trailing / is missing, the service automatically appends it, and the completed prefix must also meet the length limit. The service recursively processes non-directory objects under this prefix and supports .jpg, .jpeg, .png, .mp4, .flac, .m4a, .mp3, and .wav extensions, which are case-insensitive. Scanning the root directory of the bucket is not allowed, and the prefix cannot overlap with the output prefix ai-deepsign-signed/.

ai-deepsign/images/

SourceType

string

No

The optional content source type. The value can be up to 128 characters in length. It supports 19 short names and their corresponding full HTTP URIs, which are case-sensitive. Examples: digitalCapture and trainedAlgorithmicMedia. The source declaration is written into the content credential of the signature file. Each file in the same batch uses the value saved when the task is created. If this parameter is left empty, no additional declaration is made. The service will deny invalid values during the creation phase. For the complete enumeration and URIs, see the supplementary description of request parameters.

Valid values:

  • http://cv.iptc.org/newscodes/digitalsourcetype/humanEdits :

    http://cv.iptc.org/newscodes/digitalsourcetype/humanEdits

  • http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia :

    http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia

  • http://c2pa.org/digitalsourcetype/trainedAlgorithmicData :

    http://c2pa.org/digitalsourcetype/trainedAlgorithmicData

  • http://cv.iptc.org/newscodes/digitalsourcetype/screenCapture :

    http://cv.iptc.org/newscodes/digitalsourcetype/screenCapture

  • digitalCapture :

    digitalCapture

  • compositeCapture :

    compositeCapture

  • http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm :

    http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm

  • empty :

    empty

  • algorithmicMedia :

    algorithmicMedia

  • http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm :

    http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm

  • http://cv.iptc.org/newscodes/digitalsourcetype/compositeSynthetic :

    http://cv.iptc.org/newscodes/digitalsourcetype/compositeSynthetic

  • negativeFilm :

    negativeFilm

  • humanEdits :

    humanEdits

  • http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicallyEnhanced :

    http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicallyEnhanced

  • composite :

    composite

  • http://cv.iptc.org/newscodes/digitalsourcetype/print :

    http://cv.iptc.org/newscodes/digitalsourcetype/print

  • http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia :

    http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia

  • dataDrivenMedia :

    dataDrivenMedia

  • http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture :

    http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture

  • digitalCreation :

    digitalCreation

  • http://cv.iptc.org/newscodes/digitalsourcetype/composite :

    http://cv.iptc.org/newscodes/digitalsourcetype/composite

  • compositeWithTrainedAlgorithmicMedia :

    compositeWithTrainedAlgorithmicMedia

  • positiveFilm :

    positiveFilm

  • http://cv.iptc.org/newscodes/digitalsourcetype/dataDrivenMedia :

    http://cv.iptc.org/newscodes/digitalsourcetype/dataDrivenMedia

  • trainedAlgorithmicMedia :

    trainedAlgorithmicMedia

  • http://cv.iptc.org/newscodes/digitalsourcetype/computationalCapture :

    http://cv.iptc.org/newscodes/digitalsourcetype/computationalCapture

  • http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation :

    http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation

  • http://cv.iptc.org/newscodes/digitalsourcetype/virtualRecording :

    http://cv.iptc.org/newscodes/digitalsourcetype/virtualRecording

  • compositeSynthetic :

    compositeSynthetic

  • print :

    print

  • screenCapture :

    screenCapture

  • http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicMedia :

    http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicMedia

  • trainedAlgorithmicData :

    trainedAlgorithmicData

  • computationalCapture :

    computationalCapture

  • virtualRecording :

    virtualRecording

  • algorithmicallyEnhanced :

    algorithmicallyEnhanced

  • http://c2pa.org/digitalsourcetype/empty :

    http://c2pa.org/digitalsourcetype/empty

  • http://cv.iptc.org/newscodes/digitalsourcetype/compositeCapture :

    http://cv.iptc.org/newscodes/digitalsourcetype/compositeCapture

digitalCapture

SoftwareAgent

string

No

The optional name of the software that generated or processed the content. The value can be up to 128 characters in length. Example: Example Studio 1.0. This software information is written into the content credential of the signature file. Each file in the same batch uses the value saved when the task is created. The original value is retained after the task is paused and resumed.

Adobe Photoshop 25.0

CustomAssertions

string

No

The optional list of custom assertions. Pass a JSON array string. The original JSON text can be up to 4,096 UTF-8 bytes in length and contain up to 64 assertions. Each item must and can only contain label and data. data supports any JSON value. Objects and arrays can be nested up to 5 levels deep, and JSON integers must be within the signed 64-bit range. The assertions are written into the manifest of the signature file and can be read and authenticated for integrity by label. Each file in the same batch uses the same set of assertions. The content saved during creation continues to be used after the task is paused and resumed. For detailed formats, limits, and examples, see the supplementary description of request parameters.

[{"label":"com.example.internal","data":{"meta_id":"emp001","generation":{"modelVersion":"2.1","count":3},"tags":["AI-generated","E-commerce"],"enabled":true,"optional":null}}]

Parameter passing method

Both GET and POST are supported, and all business parameters are passed through the URL query. The parameter type of CustomAssertions is string. When you call the SDK, first serialize the assertion array into a JSON string, and then assign it to this parameter. The SDK or HTTP client performs normal URL encoding. Do not encode it repeatedly or submit the array as the request body.

SourceType: content source type

The value can be up to 128 characters in length and supports the following 19 short names and their corresponding full HTTP URIs. The matching is case-sensitive. Arbitrary strings, alternative HTTPS URIs, or additional URL parameters are not accepted. The service removes leading and trailing U+0000 to U+0020 characters and normalizes full URIs to short names. If this parameter is not passed or is empty after processing, no additional source type is declared. The corresponding standard URI is used in the content credential.

The full URI for the following 17 short names is http://cv.iptc.org/newscodes/digitalsourcetype/ followed by the short name:

digitalCapture
computationalCapture
negativeFilm
positiveFilm
print
humanEdits
algorithmicallyEnhanced
digitalCreation
dataDrivenMedia
trainedAlgorithmicMedia
algorithmicMedia
screenCapture
virtualRecording
composite
compositeCapture
compositeSynthetic
compositeWithTrainedAlgorithmicMedia

The other two values are:

Short nameFull URI
emptyhttp://c2pa.org/digitalsourcetype/empty
trainedAlgorithmicDatahttp://c2pa.org/digitalsourcetype/trainedAlgorithmicData

SoftwareAgent: software name

The optional software name, which can be up to 128 characters in length, is used to declare the software that generated or processed the content. Example: Example Studio 1.0. This value is written into the content credential and is independent of the source type and custom assertions.

CustomAssertions: custom assertions

CustomAssertions is an optional JSON array string. Each item uses a customer-defined label to identify the assertion name and data to carry the business data. The content is written into the manifest of the signature file, and readers can search by label and verify the integrity.

  • The original JSON text of the entire parameter can be up to 4,096 UTF-8 bytes in length, including outer whitespace, field names, and JSON escapes. It is calculated based on the parameter value after URL decoding, not the %xx length, and it is not 4,096 Chinese characters.

  • Up to 64 assertions are allowed. Each item must and can only contain label and data, both of which are required.

  • label uses the reverse domain name format and must contain at least two dot-separated components, such as com.example.internal. Each component must start with an ASCII letter or digit, followed by ASCII letters, digits, hyphens -, and underscores _. The service does not verify domain name ownership.

  • The first component of label cannot be c2pa, cawg, or stds. This reserved namespace check is case-insensitive. label values within the same request cannot be duplicated, and the duplicate comparison is case-sensitive. Different assertions should use different base names. Do not distinguish them only by C2PA version numbers or instance suffixes.

  • data accepts any valid JSON value: object, array, string, number, boolean, or null. data: null, empty object {}, and empty array [] are all valid. Missing the data field is invalid.

  • Objects and arrays can be nested up to 5 levels deep. The first object or array of data is counted as the first level, and mixed nesting is counted together. The outer assertion array and the wrapper object containing label and data are not counted. For example, data: {"a": [{"b": 1}]} is 3 levels.

  • JSON integers (without a decimal point or exponent) must be within the range of -9223372036854775808 to 9223372036854775807, inclusive. This limit applies to data itself, object fields, and array elements. Use strings for out-of-range business IDs. The service does not automatically convert types.

  • Duplicate keys are not allowed in any JSON object, including key names that are equivalent after Unicode escaping. Invalid Unicode is rejected. The keys of the data object follow JSON string rules, allowing empty keys and whitespace keys. @type, $ref, etc., are only processed as common business fields.

  • Business field names, JSON types, case, and internal whitespace of strings are preserved. Nested objects or arrays are not flattened into strings.

  • Not passing the parameter, passing an empty string, passing only JSON whitespace (spaces, tabs, carriage returns, line feeds), or passing a top-level empty array [] all indicate that no custom assertions are added.

These assertions do not override SourceType or SoftwareAgent. The assertion content is not encrypted and is provided to content credential readers along with the signature file. The word internal in the name does not provide access control. Do not write sensitive information such as keys.

Batch task rules

Each file in the same batch uses the SourceType, SoftwareAgent, and CustomAssertions saved during creation. The original values continue to be used after the task is paused, resumed, or taken over by the service. The resume operation does not accept modifications. If different assertions are required, create single-file tasks separately or create batch tasks grouped by the same assertions.

This operation does not accept AliUid, RoleArn, STS credentials, object lists, idempotency keys, or file content. Directory objects are not processed. Files in unsupported formats are recorded as failed, but this does not abort the processing of other files.

If the parameters are invalid, InvalidParam is returned before the service-linked role verification, OSS listing, and task creation, and no TaskId is generated.

Request parameter example

The following JSON only shows the parameter names and values. In actual calls, parameters are still passed through the URL query.

{
  "BucketRegionId": "cn-hangzhou",
  "BucketName": "example-bucket",
  "SourcePrefix": "ai-deepsign/photos/",
  "SourceType": "trainedAlgorithmicMedia",
  "SoftwareAgent": "Example Studio 1.0",
  "CustomAssertions": "[{\"label\":\"com.example.internal\",\"data\":{\"meta_id\":\"emp001\",\"generation\":{\"modelVersion\":\"2.1\",\"count\":3},\"tags\":[\"AI-generated\",\"E-commerce\"],\"enabled\":true,\"optional\":null}}]"
}

Response elements

Element

Type

Description

Example

object

The task creation result.

RequestId

string

The request ID.

01A03DCE-4091-1A91-9810-692C3D783877

TaskId

string

The ID of the batch signing task for the bucket. You can use this ID to query, pause, resume, or stop the task.

047b8305-9572-4eed-b7fb-8588b989b6e5

Success

boolean

Indicates whether the request is successful.

true

Message

string

The returned message.

success

HttpStatusCode

integer

The HTTP status code.

200

Code

string

The return code.

OK

Success=true and Code=OK indicate that the creation call is successful, but do not indicate that all files have been signed. After a successful creation, the initial status of the task is PROCESSING. Save the TaskId and call GetC2paSignResult. RequestId is only used to locate this OpenAPI request and cannot be used to query or control the task.

After the batch task is completed, check the processing status based on the number of successes, the number of failures, and the file-by-file results in the JSON report. A successful batch task does not mean that every file is signed successfully.

Examples

Success response

JSON format

{
  "RequestId": "01A03DCE-4091-1A91-9810-692C3D783877",
  "TaskId": "047b8305-9572-4eed-b7fb-8588b989b6e5",
  "Success": true,
  "Message": "success",
  "HttpStatusCode": 200,
  "Code": "OK"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.