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

# Get automation <Badge intent="info" minimal outlined>OAuth Scope: automations:read</Badge>

GET https://api.beehiiv.com/v2/publications/{publicationId}/automations/{automationId}

Retrieve a single automation for a publication.

Reference: https://developers.beehiiv.com/api-reference/automations/show

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `publicationId` (string, required) — The prefixed ID of the publication object
- `automationId` (string, required) — The prefixed ID of the automation object

### Query parameters

- `expand[]` (enum, optional) — Optional list of expandable objects.
  - Allowed values: `stats`

## Response

### 200

OK

- `data` (Automation, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 401 Unauthorized Error

Unauthorized. The API key or OAuth access token is missing, invalid, or expired.

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 404 Not Found Error

Resource Not Found

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 429 Too Many Requests Error

Rate Limit Exceeded

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 500 Internal Server Error

Internal Server Error

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

## Types

### Automation

- `id` (string, required) — A unique prefixed id of the automation
- `status` (enum, required)
  - Allowed values: `running`, `finishing`, `inactive`, `live`, `draft`
- `name` (string, required)
- `trigger_events` (list of enum, required) — The types of events that can trigger the automation.
  - Allowed values: `api`, `community_join`, `custom_field_updated`, `downgrade`, `email_submission`, `form_submission`, `group_seat_filled`, `link_click`, `manual`, `newsletter_list_subscribed`, `podcast_episode_published`, `poll_submission`, `purchased_product`, `referral_action`, `segment_action`, `shopify_sale`, `signup`, `subscriber_tag_added`, `tip_received`, `unengaged`, `upgrade`
- `description` (string, optional)
- `stats` (AutomationStats, optional) — Optional statistics for an automation. Retrievable by including `expand: [stats]` in the automation request.

### ErrorDetail

- `message` (string, required)
- `code` (string, required)

### AutomationStats

Optional statistics for an automation. Retrievable by including `expand: [stats]` in the automation request.

- `journeys` (AutomationStatsJourneys, optional) — Journey counts for the automation
- `email` (AutomationStatsEmail, optional) — Aggregate email engagement statistics

### AutomationStatsJourneys

Journey counts for an automation.

- `running` (integer, optional, default: 0) — Number of journeys currently in progress
- `completed` (integer, optional, default: 0) — Number of completed journeys
- `total` (integer, optional, default: 0) — Total number of journeys

### AutomationStatsEmail

Aggregate email engagement statistics for an automation.

- `recipients` (integer, optional, default: 0) — Total number of email recipients across all emails
- `delivered` (integer, optional, default: 0) — Total number of emails delivered
- `opens` (integer, optional, default: 0) — Total number of email opens
- `unique_opens` (integer, optional, default: 0) — Total number of unique email opens
- `open_rate` (double, optional) — The percentage of emails that have been opened
- `clicks` (integer, optional, default: 0) — Total number of email clicks
- `unique_clicks` (integer, optional, default: 0) — Unique number of email clicks
- `click_rate` (double, optional) — The percentage of emails that have been clicked
- `unsubscribes` (integer, optional, default: 0) — Total number of email unsubscribes
- `spam_reports` (integer, optional, default: 0) — The number of subscribers that reported emails as spam

## Examples

**Response**

```json
{
  "data": {
    "id": "aut_00000000-0000-0000-0000-000000000000",
    "status": "running",
    "name": "Custom welcome series",
    "trigger_events": [
      "api"
    ],
    "description": "Sends 2 days after signing up"
  }
}
```

**SDK Code**

```typescript
import { BeehiivClient } from "beehiiv";

const client = new BeehiivClient({ token: "YOUR_TOKEN" });
await client.automations.get("pub_00000000-0000-0000-0000-000000000000", "aut_00000000-0000-0000-0000-000000000000");

```

```python
import requests

url = "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/automations/aut_00000000-0000-0000-0000-000000000000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```