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

# Pause Agent

POST https://your-agent-domain.com/api/v1/pause

Pauses the agent globally and fans out pause transition messages to open conversations. Requires an API key.

Reference: https://docs.apologist.ai/agent-api/api-reference/agent/pause-agent

## Authentication

- `x-api-key` header (required) — API key for authentication
- `Authorization` header (bearer token, required) — Bearer token authentication

## Response

### 200

Agent paused

- `data` (object, optional) — Agent-wide pause or resume result, including fan-out counts.
  - `is_paused` (boolean, optional)
  - `paused_at` (string, optional, nullable)
  - `resumed_at` (string, optional, nullable)
  - `emitted` (integer, optional) — Conversations that received a transition message.
  - `skipped` (integer, optional) — Conversations skipped during fan-out.

## Errors

### 403 Forbidden Error

Forbidden - Invalid or missing API key

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

## Examples

**Response**

```json
{
  "data": {
    "is_paused": true,
    "paused_at": "string",
    "resumed_at": "string",
    "emitted": 1,
    "skipped": 1
  }
}
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.agent.pauseAgent();
}
main();

```

```python
from apologist import ApologistAgentClient

client = ApologistAgentClient(
    api_key="YOUR_API_KEY_HERE",
)

client.agent.pause_agent()

```

```java
package com.example.usage;

import ai.apologist.AgentClient;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.agent().pauseAgent();
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new(api_key: "YOUR_API_KEY_HERE")

client.agent.pause_agent

```

```csharp
using Apologist;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new AgentClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Agent.PauseAgentAsync();
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/apologist-project/apg-sdk-go/client"
    option "github.com/apologist-project/apg-sdk-go/option"
)

func do() {
    client := client.NewApologistAgentClient(
        option.WithAPIKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    client.Agent.PauseAgent(
        context.TODO(),
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;

$client = new AgentClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->agent->pauseAgent();

```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/pause")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```