---
title: "get_pending_action"
canonical_url: "https://tweetstream.io/docs/api/agent-action-get-pending-action"
last_updated: 2026-11-05
---

# get_pending_action

Read a held change: what it does, whether a code was sent, and, once confirmed, its outcome. pendingActionId is the id a held change returned. A confirmed change with no outcome yet finishes when confirm_action is called again. Tier read: the API key alone. The MCP tool of the same name needs the tweetstream:billing scope.

Canonical URL: https://tweetstream.io/docs/api/agent-action-get-pending-action

## `POST /api/agent/actions/get_pending_action`

`https://tweetstream.io/api/agent/actions/get_pending_action`

## Authorization

| Name | Type | Description |
| --- | --- | --- |
| `Authorization` | `string`, required | Bearer authentication with your TweetStream API key: `Bearer <key>`. |

## Body

| Name | Type | Description |
| --- | --- | --- |
| `pendingActionId` | `string`, required | a string at most 64 character(s) long |

### Body example

```json
{
  "pendingActionId": "pa_7Rk2mQ9xL4"
}
```

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `outcome` | `object`, required |  |
| `outcome.chargedCents` | `number` |  |
| `outcome.effectiveAt` | `string`, required | a string to be decoded into a Date |
| `outcome.kind` | `enum<string>`, required |  |
| `outcome.refund` | `enum<string>` |  |
| `pendingAction` | `object`, required |  |
| `pendingAction.action` | `string`, required |  |
| `pendingAction.expiresAt` | `string`, required | a string to be decoded into a Date |
| `pendingAction.id` | `string`, required |  |
| `pendingAction.quote` | `object`, required |  |
| `pendingAction.quote.amountDueCents` | `integer`, required | an integer |
| `pendingAction.quote.effectiveAt` | `string`, required | a string to be decoded into a Date |
| `pendingAction.quote.renewal` | `object`, required |  |
| `pendingAction.quote.renewal.amountCents` | `integer`, required | an integer |
| `pendingAction.quote.renewal.at` | `string`, required | a string to be decoded into a Date |
| `pendingAction.quote.renewal.termMonths` | `integer`, required | an integer |
| `pendingAction.quote.saveOffer` | `object`, required |  |
| `pendingAction.quote.saveOffer.description` | `string`, required |  |
| `pendingAction.quote.saveOffer.offer` | `object`, required |  |
| `pendingAction.summary` | `string`, required |  |
| `status` | `enum<string>`, required |  |

## Responses

| Status | Description | Headers |
| --- | --- | --- |
| `200` | Success |  |
| `400` | The input does not match the action's schema (INVALID_REQUEST) |  |
| `401` | Missing or invalid API key |  |
| `403` | The request carried a foreign Origin |  |
| `404` | No held change with that pendingActionId for this API key (CONFIRMATION_NOT_FOUND) |  |
| `429` | Rate limit reached (RATE_LIMITED); retry after retryAfterSeconds |  |
| `503` | Temporarily unavailable; retry later |  |

### 200

```json
{
  "outcome": null,
  "pendingAction": {
    "action": "change_billing",
    "expiresAt": "2026-11-05T12:05:00.000Z",
    "id": "pa_7Rk2mQ9xL4",
    "quote": {
      "amountDueCents": 0,
      "effectiveAt": "2026-11-29T12:00:00.000Z",
      "renewal": {
        "amountCents": 19900,
        "at": "2026-11-29T12:00:00.000Z",
        "termMonths": 1
      },
      "saveOffer": null
    },
    "summary": "Change your plan to Minimum, billed monthly. Takes effect Nov 29, 2026. Nothing is charged now."
  },
  "status": "code_sent"
}
```

### 400

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 401

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 403

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 404

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 429

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 503

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://tweetstream.io/api/agent/actions/get_pending_action \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "pendingActionId": "pa_7Rk2mQ9xL4"
}'
```

### JavaScript

```javascript
const response = await fetch("https://tweetstream.io/api/agent/actions/get_pending_action", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "pendingActionId": "pa_7Rk2mQ9xL4"
  }),
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.post(
    "https://tweetstream.io/api/agent/actions/get_pending_action",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "pendingActionId": "pa_7Rk2mQ9xL4",
    },
)

print(response.status_code, response.json())
```
