---
title: Run Deployment Now
url: https://platform.claude.com/docs/en/api/php/beta/deployments/run
---

# Run Deployment Now

`$client->beta->deployments->run(string deploymentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsDeploymentRun`

**POST** `/v1/deployments/{deployment_id}/run`

Run Deployment Now

## Parameters

- `deploymentID: string` (path parameter)

  Unique identifier of the deployment to run.

- `betas?: optional list<AnthropicBeta>` (header parameter)

  This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

- `workspaceID?: optional string` (header parameter)

  Optional header to select the Workspace for this request. The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).

  Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

## Returns

- `class BetaManagedAgentsDeploymentRun`

  - `"deployment_run" type`

  - `string id`

    Unique identifier for this run (`drun_...`).

  - `BetaManagedAgentsAgentReference agent`

    Snapshot of the agent at fire time. Always fully resolved — deployments pin agent + version.

  - `\Datetime createdAt`

    Time this run record was persisted.

  - `string deploymentID`

    ID of the deployment that produced this run.

  - `?Error error`

    Populated on creation failure. Null on success. Exactly one of `session_id` or `error` is non-null.

  - `?string sessionID`

    Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null.

  - `BetaManagedAgentsTriggerContext triggerContext`

    What triggered this run and trigger-specific metadata.

## Example

```php
<?php

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

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;

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

$betaManagedAgentsDeploymentRun = $client->beta->deployments->run(
  'depl_011CZkZcDH3vPqd7xnEfwTai',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaManagedAgentsDeploymentRun);
```

### Response (200)

```json
{
  "id": "id",
  "agent": {
    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
    "type": "agent",
    "version": 1
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "deployment_id": "deployment_id",
  "error": {
    "message": "message",
    "type": "environment_archived_error"
  },
  "session_id": "session_id",
  "trigger_context": {
    "scheduled_at": "2019-12-27T18:11:19.117Z",
    "type": "schedule"
  },
  "type": "deployment_run"
}
```
