> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Update the status of an automation workflow

PUT https://api.brevo.com/v3/automation/workflows/{workflowId}/status
Content-Type: application/json

Activates (`active`), pauses (`pause`) or stops (`inactive`) an automation workflow.

* `active` starts it for real contacts. Before activating, resolve the warnings returned when the workflow was created (for example an email template with no sender).
* `pause` stops new contacts from entering. The contacts already in the workflow continue through it.
* `inactive` stops the workflow, and every contact still in it leaves it. This cannot be undone for those contacts.

A status change is applied asynchronously: while the previous one is still running, the request is refused with 409 `status_change_in_progress`; wait the `Retry-After` seconds and read the workflow to see its status.

Some refusals currently come back as `{"error": "<text>"}`, without `code` and `message`: see the 400 and 500 responses.

Reference: https://developers.brevo.com/reference/update-workflow-status

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.
- `Authorization` header (bearer token, required) — OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app's client_id/client_secret for a short-lived Bearer token.

## Request

### Path parameters

- `workflowId` (long, required) — ID of the automation workflow

### Body (application/json)

This endpoint expects an object.

- `status` (enum, required) — active starts the automation for real contacts; pause stops new contacts from entering while the contacts already in it continue; inactive stops it, and every contact still in it leaves the automation
  - Allowed values: `active`, `pause`, `inactive`

## Response

### 200

Status updated

- `status` (boolean, optional) — True when the status changed
- `reason` (string, optional) — Why the status was not changed, when it was not

## Errors

### 400 Bad Request Error

The body is not `{"status": "active"}`, `{"status": "pause"}` or `{"status": "inactive"}`, or the change is not possible from the current status (code `invalid_state`, for example pausing a stopped or never-activated workflow). Other refusals currently come back as `{"error": "<text>"}` without `code` or `message`: activating a workflow with no complete trigger or no complete step, pausing a workflow that is already paused, or a failed lookup.

- `UpdateWorkflowStatusRequestBadRequestError`
  - errorModel: errorModel
  - any

### 401 Unauthorized Error

Authentication failed

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 403 Forbidden Error

The API key or OAuth token is not allowed to activate automations: the OAuth token lacks the `automation:write` scope, the user lacks the automation permission, or the API key is restricted.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 404 Not Found Error

No automation workflow with this ID in the account (code `not_found`).

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 409 Conflict Error

A previous status change of this workflow is still being applied (code `status_change_in_progress`). Retry after the `Retry-After` seconds.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 500 Internal Server Error

The status change failed. Currently returned as `{"error": "<text>"}`. Try again later.

- `error` (string, required)

### 503 Service Unavailable Error

A lookup the request needs is unavailable. Try again later.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

## Types

### errorModel

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

## Examples

**Request**

```json
{
  "status": "active"
}
```

**Response**

```json
{
  "status": true,
  "reason": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.brevo.com/v3/automation/workflows/1/status"

payload = { "status": "active" }
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.brevo.com/v3/automation/workflows/1/status';
const options = {
  method: 'PUT',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"status":"active"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/automation/workflows/1/status"

	payload := strings.NewReader("{\n  \"status\": \"active\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/automation/workflows/1/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"active\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.brevo.com/v3/automation/workflows/1/status")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"active\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.brevo.com/v3/automation/workflows/1/status', [
  'body' => '{
  "status": "active"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/automation/workflows/1/status");
var request = new RestRequest(Method.PUT);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"active\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = ["status": "active"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/automation/workflows/1/status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```