Claude Platform Docs

删除消息批次

$client->messages->batches->delete(string messageBatchID, ?string workspaceID): DeletedMessageBatch
DELETE/v1/messages/batches/{message_batch_id}

删除消息批次。

消息批次只有在处理完成后才能删除。如果您想删除正在处理中的批次,必须先将其取消。

在我们的用户指南中了解有关 Message Batches API 的更多信息

Parameters
messageBatchID: string

ID of the Message Batch.

workspaceID?:optional string
Returns
class DeletedMessageBatch { $type = 'message_batch_deleted'; $id; }
"message_batch_deleted" type

Deleted object type.

For Message Batches, this is always "message_batch_deleted".

string id

ID of the Message Batch.

删除消息批次
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$deletedMessageBatch = $client->messages->batches->delete(
  'message_batch_id', workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy'
);

var_dump($deletedMessageBatch);
Returns Examples
Response 200
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "type": "message_batch_deleted"
}