> For the complete documentation index, see [llms.txt](https://docs.tracr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tracr.com/api-reference/tracr-api/references/bulk.md).

# Bulk

## POST /bulk/diamond-asset/delete

> Delete Diamond Assets

```json
{"openapi":"3.1.0","info":{"title":"Platform Application API","version":"1.34.0"},"servers":[{"description":"Live","url":"https://api.<id>.tracr.network"},{"description":"Sandbox","url":"https://api.<id>.uat.tracr.network"}],"paths":{"/bulk/diamond-asset/delete":{"post":{"operationId":"delete_diamond_assets_bulk_diamond_asset_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteResponse"}}},"description":"The request was processed successfully. The result of each deletion is determined by looking at individual deletion status for each diamond asset."},"401":{"description":"Unauthorized:  The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden:  The application does not have sufficient permissions for this operation."},"409":{"description":"The request was unable to be processed due to one of the diamond assets in the request (or the asset's related diamond) being updated by another process."},"422":{"description":"Unprocessable Entity, request JSON body is not as per specification"},"500":{"description":"Internal Server Error. If this error persists please contact the Platform Admin team."}},"summary":"Delete Diamond Assets","tags":["Bulk","Diamond Assets"]}}},"components":{"schemas":{"BulkDiamondAssetDeleteRequest":{"description":"A request to delete one or more diamond assets.","properties":{"assets":{"description":"The diamond assets for which to process.","items":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteRequestAsset"},"title":"Assets","type":"array"}},"required":["assets"],"title":"BulkDiamondAssetDeleteRequest","type":"object"},"BulkDiamondAssetDeleteRequestAsset":{"description":"A diamond asset contained within a bulk diamond asset deletion request.","properties":{"diamond_asset_id":{"description":"The ID of the diamond asset to delete.","title":"Diamond Asset Id","type":"string"}},"required":["diamond_asset_id"],"title":"BulkDiamondAssetDeleteRequestAsset","type":"object"},"BulkDiamondAssetDeleteResponse":{"description":"A response from the /bulk/diamond-asset/delete endpoint containing the status\nof each deleted diamond.","properties":{"results":{"description":"Results with attributed statuses.","items":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteResult"},"title":"Results","type":"array"}},"required":["results"],"title":"BulkDiamondAssetDeleteResponse","type":"object"},"BulkDiamondAssetDeleteResult":{"description":"The result of deleting a single diamond asset.","properties":{"diamond_asset_id":{"description":"The ID of the diamond asset to which this result pertains.","title":"Diamond Asset Id","type":"string"},"diamond_id":{"anyOf":[{"pattern":"^[a-z\\d]{20,98}$","type":"string"},{"type":"null"}],"description":"The ID of diamond to which this result pertains. In the case that the asset could not be found, this will be null.","title":"Diamond Id"},"errors":{"description":"Any errors preventing the deletion of the diamond asset. In the case that the error(s) are resolvable many errors may be returned. ","items":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteResultError"},"title":"Errors","type":"array"},"status":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteStatus","description":"The status of the deletion."}},"required":["diamond_asset_id","diamond_id","status"],"title":"BulkDiamondAssetDeleteResult","type":"object"},"BulkDiamondAssetDeleteResultError":{"description":"An error returned if the deletion of a diamond asset fails.","properties":{"error_code":{"$ref":"#/components/schemas/BulkDiamondAssetDeleteResultErrorCode","description":"An error code representing the error that occurred."},"message":{"description":"A human readable error message explaining the error code. Error messages can change over time.","title":"Message","type":"string"}},"required":["error_code","message"],"title":"BulkDiamondAssetDeleteResultError","type":"object"},"BulkDiamondAssetDeleteResultErrorCode":{"description":"Unique error codes representing errors that occur when deleting diamond assets.","enum":["diamond_asset_not_found","diamond_archived","diamond_in_transfer","diamond_transferred","invalid_diamond_asset_type","legacy_diamond_asset"],"title":"BulkDiamondAssetDeleteResultErrorCode","type":"string"},"BulkDiamondAssetDeleteStatus":{"description":"Overarching status of a bulk diamond asset deletion request.","enum":["success","error"],"title":"BulkDiamondAssetDeleteStatus","type":"string"}}}}
```

## Bulk Mark As Archived

> Mark diamonds as archived, if they're available to be archived.

```json
{"openapi":"3.1.0","info":{"title":"Platform Application API","version":"1.34.0"},"servers":[{"description":"Live","url":"https://api.<id>.tracr.network"},{"description":"Sandbox","url":"https://api.<id>.uat.tracr.network"}],"paths":{"/bulk/diamonds/archive":{"post":{"description":"Mark diamonds as archived, if they're available to be archived.","operationId":"bulk_mark_as_archived_bulk_diamonds_archive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveResponse"}}},"description":"Successful Response"},"401":{"description":"Unauthorized:  The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden:  The application does not have sufficient permissions for this operation."},"422":{"description":"Unprocessable Entity, request JSON body is not as per specification"},"500":{"description":"Internal Server Error. If this error persists please contact the Platform Admin team."}},"summary":"Bulk Mark As Archived","tags":["Bulk","Diamonds"]}}},"components":{"schemas":{"ArchiveRequest":{"description":"A list of diamonds to mark as archived.","properties":{"diamonds":{"description":"The diamonds for which to process.","items":{"$ref":"#/components/schemas/DiamondIDOnly"},"title":"Diamonds","type":"array"}},"required":["diamonds"],"title":"ArchiveRequest","type":"object"},"DiamondIDOnly":{"description":"An object which contains only a diamond_id field.","properties":{"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"}},"required":["diamond_id"],"title":"DiamondIDOnly","type":"object"},"ArchiveResponse":{"description":"Aggregated results of marking diamonds as archived.","properties":{"results":{"description":"Results with attributed statuses.","items":{"$ref":"#/components/schemas/ArchiveDiamondResult"},"title":"Results","type":"array"}},"required":["results"],"title":"ArchiveResponse","type":"object"},"ArchiveDiamondResult":{"description":"The result of marking a single diamond as archived.","properties":{"diamond_id":{"description":"Identifies the diamond from the request.","pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"status":{"$ref":"#/components/schemas/ArchiveStatus"}},"required":["diamond_id","status"],"title":"ArchiveDiamondResult","type":"object"},"ArchiveStatus":{"description":"Indicates that a diamond was marked as archived successfully or the reason why\nthe diamond could not be marked as archived.","enum":["success","diamond_not_found","diamond_in_terminal_state","diamond_transferred","diamond_in_active_shipment"],"title":"ArchiveStatus","type":"string"}}}}
```

## Bulk Delete Diamonds

> Permanently delete diamonds from a participant's inventory.

```json
{"openapi":"3.1.0","info":{"title":"Platform Application API","version":"1.34.0"},"servers":[{"description":"Live","url":"https://api.<id>.tracr.network"},{"description":"Sandbox","url":"https://api.<id>.uat.tracr.network"}],"paths":{"/bulk/diamonds/delete":{"post":{"description":"Permanently delete diamonds from a participant's inventory.","operationId":"bulk_delete_diamonds_bulk_diamonds_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}},"description":"Successful Response"},"401":{"description":"Unauthorized:  The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden:  The application does not have sufficient permissions for this operation."},"422":{"description":"Unprocessable Entity, request JSON body is not as per specification"},"500":{"description":"Internal Server Error. If this error persists please contact the Platform Admin team."}},"summary":"Bulk Delete Diamonds","tags":["Bulk","Diamonds"]}}},"components":{"schemas":{"DeleteRequest":{"properties":{"diamonds":{"items":{"$ref":"#/components/schemas/DeleteRequestDiamond"},"maxItems":1000,"title":"Diamonds","type":"array"},"dry_run":{"default":false,"description":"If true, no diamonds will be deleted. The API will return the response as if it did.","title":"Dry Run","type":"boolean"}},"required":["diamonds"],"title":"DeleteRequest","type":"object"},"DeleteRequestDiamond":{"properties":{"delete_descendants":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delete Descendants"},"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"}},"required":["diamond_id"],"title":"DeleteRequestDiamond","type":"object"},"DeleteResponse":{"properties":{"results":{"items":{"anyOf":[{"$ref":"#/components/schemas/DeleteResultError"},{"$ref":"#/components/schemas/DeleteResultSuccess"}]},"title":"Results","type":"array"}},"required":["results"],"title":"DeleteResponse","type":"object"},"DeleteResultError":{"properties":{"descendants":{"items":{"$ref":"#/components/schemas/DeleteResponseDiamond"},"title":"Descendants","type":"array"},"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"error":{"title":"Error","type":"string"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User supplied identifier for the diamond, specific to this Tracr instance. Synonymous with ERP ID and Stock ID.","title":"Participant Id"},"status":{"$ref":"#/components/schemas/DeleteResultErrorStatus"}},"required":["diamond_id","status","descendants","error"],"title":"DeleteResultError","type":"object"},"DeleteResponseDiamond":{"properties":{"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User supplied identifier for the diamond, specific to this Tracr instance. Synonymous with ERP ID and Stock ID.","title":"Participant Id"}},"required":["diamond_id"],"title":"DeleteResponseDiamond","type":"object"},"DeleteResultErrorStatus":{"description":"Defines the different errors possible when deleting a diamond.","enum":["descendants_in_active_shipment","descendants_transferred","descendants_unlocked","descendants_archived","diamond_has_descendants","diamond_in_active_shipment","diamond_not_found","diamond_transferred","diamond_unlocked"],"title":"DeleteResultErrorStatus","type":"string"},"DeleteResultSuccess":{"properties":{"descendants":{"items":{"$ref":"#/components/schemas/DeleteResponseDiamond"},"title":"Descendants","type":"array"},"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User supplied identifier for the diamond, specific to this Tracr instance. Synonymous with ERP ID and Stock ID.","title":"Participant Id"},"status":{"$ref":"#/components/schemas/DeleteResultSuccessStatus","default":"success"}},"required":["diamond_id","descendants"],"title":"DeleteResultSuccess","type":"object"},"DeleteResultSuccessStatus":{"description":"Defines the possible statuses when a diamond has been successfully\ndeleted.","enum":["success"],"title":"DeleteResultSuccessStatus","type":"string"}}}}
```

## Bulk Unarchive

> Un-archive diamonds, if they're available to be un-archived.

```json
{"openapi":"3.1.0","info":{"title":"Platform Application API","version":"1.34.0"},"servers":[{"description":"Live","url":"https://api.<id>.tracr.network"},{"description":"Sandbox","url":"https://api.<id>.uat.tracr.network"}],"paths":{"/bulk/diamonds/unarchive":{"post":{"description":"Un-archive diamonds, if they're available to be un-archived.","operationId":"bulk_unarchive_bulk_diamonds_unarchive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnarchiveRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnarchiveResponse"}}},"description":"Successful Response"},"401":{"description":"Unauthorized:  The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden:  The application does not have sufficient permissions for this operation."},"422":{"description":"Unprocessable Entity, request JSON body is not as per specification"},"500":{"description":"Internal Server Error. If this error persists please contact the Platform Admin team."}},"summary":"Bulk Unarchive","tags":["Bulk","Diamonds"]}}},"components":{"schemas":{"UnarchiveRequest":{"description":"A list of diamonds to un-archive.","properties":{"diamonds":{"description":"The diamonds for which to process.","items":{"$ref":"#/components/schemas/DiamondIDOnly"},"title":"Diamonds","type":"array"}},"required":["diamonds"],"title":"UnarchiveRequest","type":"object"},"DiamondIDOnly":{"description":"An object which contains only a diamond_id field.","properties":{"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"}},"required":["diamond_id"],"title":"DiamondIDOnly","type":"object"},"UnarchiveResponse":{"description":"Aggregated results of un-archiving diamonds.","properties":{"results":{"description":"Results with attributed statuses.","items":{"$ref":"#/components/schemas/UnarchiveDiamondResult"},"title":"Results","type":"array"}},"required":["results"],"title":"UnarchiveResponse","type":"object"},"UnarchiveDiamondResult":{"description":"The result of un-archiving a single diamond.","properties":{"diamond_id":{"description":"Identifies the diamond from the request.","pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"status":{"$ref":"#/components/schemas/UnarchiveStatus"}},"required":["diamond_id","status"],"title":"UnarchiveDiamondResult","type":"object"},"UnarchiveStatus":{"description":"Indicates that a diamond was successfully un-archived or the reason why\nthe diamond could not be un-archived.","enum":["success","diamond_not_found"],"title":"UnarchiveStatus","type":"string"}}}}
```

## Unlock Diamonds

> Unlock the diamonds in the request body, if they're available to unlock.

```json
{"openapi":"3.1.0","info":{"title":"Platform Application API","version":"1.34.0"},"servers":[{"description":"Live","url":"https://api.<id>.tracr.network"},{"description":"Sandbox","url":"https://api.<id>.uat.tracr.network"}],"paths":{"/bulk/diamonds/unlock":{"post":{"description":"Unlock the diamonds in the request body, if they're available to unlock.","operationId":"unlock_diamonds_bulk_diamonds_unlock_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlockRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlockResponse"}}},"description":"Successful Response"},"401":{"description":"Unauthorized:  The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden:  The application does not have sufficient permissions for this operation."},"422":{"description":"Returned if the request body is malformed or does not contain any diamonds"},"500":{"description":"Internal Server Error. If this error persists please contact the Platform Admin team."}},"summary":"Unlock Diamonds","tags":["Bulk","Diamonds"]}}},"components":{"schemas":{"UnlockRequest":{"description":"Represents a request to unlock one or more locked diamonds.","properties":{"diamonds":{"items":{"$ref":"#/components/schemas/DiamondIDOnly"},"minItems":1,"title":"Diamonds","type":"array"}},"required":["diamonds"],"title":"UnlockRequest","type":"object"},"DiamondIDOnly":{"description":"An object which contains only a diamond_id field.","properties":{"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"}},"required":["diamond_id"],"title":"DiamondIDOnly","type":"object"},"UnlockResponse":{"description":"Represents the response to an UnlockRequest.","properties":{"diamonds":{"items":{"$ref":"#/components/schemas/DiamondUnlockResult"},"title":"Diamonds","type":"array"}},"required":["diamonds"],"title":"UnlockResponse","type":"object"},"DiamondUnlockResult":{"description":"Represents the result of an attempt to unlock a single diamond.","properties":{"diamond_id":{"pattern":"^[a-z\\d]{20,98}$","title":"Diamond Id","type":"string"},"status":{"$ref":"#/components/schemas/DiamondUnlockResultStatus"}},"required":["diamond_id","status"],"title":"DiamondUnlockResult","type":"object"},"DiamondUnlockResultStatus":{"description":"Represents the possible responses to an attempt to unlock a diamond.","enum":["diamond_does_not_exist","diamond_cannot_be_unlocked","missing_unlock_requirement","success"],"title":"DiamondUnlockResultStatus","type":"string"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tracr.com/api-reference/tracr-api/references/bulk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
