---
title: "change_billing"
canonical_url: "https://tweetstream.io/docs/api/agent-action-change-billing"
last_updated: 2026-11-05
---

# change_billing

Prepare a change to a subscription: plan, term, Instagram or Ultra Speed account limit, pause, cancel (its quote names any save offer), a save offer, resume, keep, or auto-renew off. Returns the price and date; nothing changes until confirm_action runs it with the code emailed to the person. Tier confirm: the call only holds the change and returns it. request_confirmation_code emails the person a code; confirm_action runs the change once they read it back. The MCP tool of the same name needs the tweetstream:billing scope.

Canonical URL: https://tweetstream.io/docs/api/agent-action-change-billing

## `POST /api/agent/actions/change_billing`

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

## Authorization

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

## Body

| Name | Type | Description |
| --- | --- | --- |
| `change` | `object`, required |  |
| `change.billingCycle` | `enum<string>`, required |  |
| `change.kind` | `enum<string>`, required |  |
| `change.plan` | `enum<string>`, required |  |
| `family` | `enum<string>`, required |  |

### Body example

```json
{
  "change": {
    "billingCycle": "MONTHLY",
    "kind": "change_plan",
    "plan": "BASIC"
  },
  "family": "BASE"
}
```

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `next` | `object`, required |  |
| `next.action` | `enum<string>`, required |  |
| `next.message` | `string`, required |  |
| `next.name` | `string`, required |  |
| `next.who` | `enum<string>`, required |  |
| `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 |  |
| `409` | Nothing to change, or the change is not offered (ACTION_REFUSED with reason) |  |
| `429` | Rate limit reached (RATE_LIMITED); retry after retryAfterSeconds |  |
| `503` | Temporarily unavailable; retry later |  |

### 200

```json
{
  "next": {
    "action": "call_action",
    "message": "Show the person this change. If they want it, call request_confirmation_code to email them a code.",
    "name": "request_confirmation_code",
    "who": "agent"
  },
  "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": "confirmation_required"
}
```

### 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"
  }
}
```

### 409

```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/change_billing \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "change": {
    "billingCycle": "MONTHLY",
    "kind": "change_plan",
    "plan": "BASIC"
  },
  "family": "BASE"
}'
```

### JavaScript

```javascript
const response = await fetch("https://tweetstream.io/api/agent/actions/change_billing", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "change": {
      "billingCycle": "MONTHLY",
      "kind": "change_plan",
      "plan": "BASIC"
    },
    "family": "BASE"
  }),
});

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

### Python

```python
import os
import requests

response = requests.post(
    "https://tweetstream.io/api/agent/actions/change_billing",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "change": {
            "billingCycle": "MONTHLY",
            "kind": "change_plan",
            "plan": "BASIC",
        },
        "family": "BASE",
    },
)

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