> ## Documentation Index
> Fetch the complete documentation index at: https://www.dropfans.io/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT /api/external/subscription — Set the creator’s subscription tier

> Creates or replaces the creator's subscription tier. This is a full replace: fields you leave out go back to their defaults (`trialDays` 0, no description or pitch, active).

- Source: https://www.dropfans.io/developers/reference/update-subscription
- Section: API reference
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Creates or replaces the creator's subscription tier. This is a full replace: fields you leave out go back to their defaults (`trialDays` 0, no description or pitch, active).

Same rules as the dashboard: `priceUsd` is USD **dollars**, either `0` (free) or between $5 and $750. `isActive: false` pauses new sign-ups. Existing subscribers keep the price they signed up at.

## Authentication

`Authorization: Bearer dpfn_...` — an API key generated in the dashboard (Vault → API Connect). By default the key acts for the one account it belongs to. Missing or invalid keys return 401 `{"error":"Unauthorized","code":"unauthorized"}`.

Optional `X-Dropfans-Account: <account id>` — with a verified agency's own key, act for a creator or AI persona the agency manages (ids from GET /api/external/agency/creators); the agency needs `canEditProfile` on that account. The response echoes the account acted on in the same header.

## Request body (application/json)

| Field | Type | Required | Description |
|---|---|---|---|
| `priceUsd` | number | yes | USD dollars per interval. 0 = free; otherwise $5–$750. Rounded to cents. |
| `interval` | `monthly` \\| `weekly` | yes | Billing interval. |
| `trialDays` | integer |  | Free trial length in days. |
| `description` | string |  | What subscribers get (cut at 500 characters). |
| `pitchMessage` | string |  | Short pitch shown in the subscribe sheet (cut at 500 characters). |
| `isActive` | boolean |  | false pauses new sign-ups. |

Example — $9.99 a month:

```json
{
  "priceUsd": 9.99,
  "interval": "monthly",
  "description": "All my sets, first."
}
```

## Responses

### 200

The saved tier.

| Field | Type | Required | Description |
|---|---|---|---|
| `tier` | SubscriptionTier | yes | The tier now in effect. |

```json
{
  "tier": {
    "priceUsd": 9.99,
    "currency": "USD",
    "interval": "monthly",
    "trialDays": 0,
    "description": "All my sets, first.",
    "pitchMessage": null,
    "isActive": true
  }
}
```

## Errors

| Status | Body | When |
|---|---|---|
| 400 | `{"error":"priceUsd must be 0 (free) or at least 5"}` | `priceUsd` missing, not a number or negative. |
| 400 | `{"error":"The minimum price is $5. Set the price to free or at least $5."}` | Priced above 0 but below $5. |
| 400 | `{"error":"The maximum price on Dropfans is $750. To request an increase, contact support@dropfans.io."}` | Priced above $750. |
| 400 | `{"error":"interval must be 'monthly' or 'weekly'"}` | Missing or unknown interval. |
| 400 | `{"error":"trialDays must be a whole number from 0 to 30"}` | Bad trial length. |
| 400 | `{"error":"isActive must be true or false"}` | `isActive` is not a boolean. |
| 400 | `{"error":"Invalid JSON body"}` | The body is not valid JSON. |
| 401 | `{"error":"Unauthorized","code":"unauthorized"}` | Missing or invalid API key. |
| 400 | `{"error":"X-Dropfans-Account must be an account id (from GET /api/external/agency/creators), not a username.","code":"invalid_account_header"}` | `X-Dropfans-Account` is not an account id. |
| 403 | `{"error":"This key cannot act for that account.","code":"account_not_managed"}` | `X-Dropfans-Account` names an account this key cannot act for: not an agency’s own key, no ACCEPTED management, or the agency or account is suspended, banned or deleted (an unknown id gets the same answer). |
| 403 | `{"error":"The agency does not have permission for this on that account.","code":"permission_denied","permission":"canEditProfile"}` | With `X-Dropfans-Account`: the agency lacks `canEditProfile` on that account. |

## Rate limiting

Per-key fixed windows by tier (Personal 60/min · 5,000/day; approved apps 300/min · 50,000/day; Dropfans-operated integrations exempt). Read the live values from X-RateLimit-Tier, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and their -Day variants; a 429 carries Retry-After and `{"error":"Rate limit exceeded","code":"rate_limited"}`. See [Rate limits](https://www.dropfans.io/developers/concepts/rate-limits.md).

## Code samples

### curl

```bash
curl -X PUT "https://www.dropfans.io/api/external/subscription" \
  -H "Authorization: Bearer $DROPFANS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "priceUsd": 9.99,
  "interval": "monthly",
  "description": "All my sets, first."
}'
```

### Node

```javascript
const res = await fetch(`https://www.dropfans.io/api/external/subscription`, {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "priceUsd": 9.99,
    "interval": "monthly",
    "description": "All my sets, first."
  }),
});
console.log(await res.json());
```

### Python

```python
import os
import requests

res = requests.put(
    "https://www.dropfans.io/api/external/subscription",
    headers={"Authorization": f"Bearer {os.environ['DROPFANS_API_KEY']}"},
    json={
        "priceUsd": 9.99,
        "interval": "monthly",
        "description": "All my sets, first.",
    },
)
print(res.json())
```

## OpenAPI

```json
{
  "method": "PUT",
  "path": "/api/external/subscription",
  "operationId": "updateSubscription",
  "tags": [
    "account"
  ],
  "summary": "Set the creator’s subscription tier",
  "description": "Creates or replaces the creator's subscription tier. This is a full replace: fields you leave out go back to their defaults (`trialDays` 0, no description or pitch, active).\n\nSame rules as the dashboard: `priceUsd` is USD **dollars**, either `0` (free) or between $5 and $750. `isActive: false` pauses new sign-ups. Existing subscribers keep the price they signed up at.",
  "parameters": [
    {
      "name": "X-Dropfans-Account",
      "in": "header",
      "required": false,
      "description": "Agencies only. With a verified agency’s own key, the id of a creator or AI persona the agency manages (from GET /api/external/agency/creators): the request then acts as that account, exactly as if it were sent with that account’s own key. Account ids only — usernames are refused (400 invalid_account_header). Checked on every request: the management must be ACCEPTED, nobody may be suspended, banned or deleted (else 403 account_not_managed), and the agency needs the endpoint’s permission on that account (else 403 permission_denied). Omit it to act as the key’s own account.",
      "schema": {
        "type": "string",
        "pattern": "^c[a-z0-9]{20,32}$"
      },
      "example": "cmh4v2q8k0003xy9z7w6v5u4t"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "priceUsd": {
              "type": "number",
              "description": "USD dollars per interval. 0 = free; otherwise $5–$750. Rounded to cents.",
              "example": 9.99,
              "minimum": 0,
              "maximum": 750
            },
            "interval": {
              "type": "string",
              "description": "Billing interval.",
              "enum": [
                "monthly",
                "weekly"
              ],
              "example": "monthly"
            },
            "trialDays": {
              "type": "integer",
              "description": "Free trial length in days.",
              "default": 0,
              "minimum": 0,
              "maximum": 30
            },
            "description": {
              "type": "string",
              "description": "What subscribers get (cut at 500 characters).",
              "maxLength": 500
            },
            "pitchMessage": {
              "type": "string",
              "description": "Short pitch shown in the subscribe sheet (cut at 500 characters).",
              "maxLength": 500
            },
            "isActive": {
              "type": "boolean",
              "description": "false pauses new sign-ups.",
              "default": true
            }
          },
          "required": [
            "priceUsd",
            "interval"
          ]
        },
        "examples": {
          "monthly": {
            "summary": "$9.99 a month",
            "value": {
              "priceUsd": 9.99,
              "interval": "monthly",
              "description": "All my sets, first."
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The saved tier.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-Dropfans-Account": {
          "description": "The id of the account this request acted on — the key’s own account, or the managed account named in the X-Dropfans-Account request header. Assert it when acting for several accounts.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "tier": {
                "type": "object",
                "properties": {
                  "priceUsd": {
                    "type": "number",
                    "description": "USD **dollars** per interval. 0 = free subscription.",
                    "example": 9.99
                  },
                  "currency": {
                    "type": "string",
                    "description": "Always \"USD\".",
                    "enum": [
                      "USD"
                    ]
                  },
                  "interval": {
                    "type": "string",
                    "description": "Billing interval.",
                    "enum": [
                      "monthly",
                      "weekly"
                    ]
                  },
                  "trialDays": {
                    "type": "integer",
                    "description": "Free trial length in days (0 = none).",
                    "example": 0
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "What subscribers get."
                  },
                  "pitchMessage": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Short pitch shown in the subscribe sheet."
                  },
                  "isActive": {
                    "type": "boolean",
                    "description": "False = paused: no new sign-ups. Existing subscribers are unaffected."
                  }
                },
                "required": [
                  "priceUsd",
                  "currency",
                  "interval",
                  "trialDays",
                  "isActive"
                ]
              }
            },
            "required": [
              "tier"
            ]
          },
          "example": {
            "tier": {
              "priceUsd": 9.99,
              "currency": "USD",
              "interval": "monthly",
              "trialDays": 0,
              "description": "All my sets, first.",
              "pitchMessage": null,
              "isActive": true
            }
          }
        }
      }
    },
    "400": {
      "description": "`priceUsd` missing, not a number or negative. Also: Priced above 0 but below $5. Also: Priced above $750. Also: Missing or unknown interval. Also: Bad trial length. Also: `isActive` is not a boolean. Also: The body is not valid JSON. Also: `X-Dropfans-Account` is not an account id.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "priceUsd must be 0 (free) or at least 5"
          }
        }
      }
    },
    "401": {
      "description": "Missing or invalid API key.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Unauthorized",
            "code": "unauthorized"
          }
        }
      }
    },
    "403": {
      "description": "`X-Dropfans-Account` names an account this key cannot act for: not an agency’s own key, no ACCEPTED management, or the agency or account is suspended, banned or deleted (an unknown id gets the same answer). Also: With `X-Dropfans-Account`: the agency lacks `canEditProfile` on that account.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "This key cannot act for that account.",
            "code": "account_not_managed"
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded for the current minute or day window. Wait Retry-After seconds and retry.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "Retry-After": {
          "description": "Seconds to wait before retrying (sent with 429s).",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Rate limit exceeded",
            "code": "rate_limited"
          }
        }
      }
    }
  },
  "x-codeSamples": [
    {
      "lang": "cURL",
      "label": "curl",
      "source": "curl -X PUT \"https://www.dropfans.io/api/external/subscription\" \\\n  -H \"Authorization: Bearer $DROPFANS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"priceUsd\": 9.99,\n  \"interval\": \"monthly\",\n  \"description\": \"All my sets, first.\"\n}'"
    },
    {
      "lang": "JavaScript",
      "label": "Node",
      "source": "const res = await fetch(`https://www.dropfans.io/api/external/subscription`, {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"priceUsd\": 9.99,\n    \"interval\": \"monthly\",\n    \"description\": \"All my sets, first.\"\n  }),\n});\nconsole.log(await res.json());"
    },
    {
      "lang": "Python",
      "source": "import os\nimport requests\n\nres = requests.put(\n    \"https://www.dropfans.io/api/external/subscription\",\n    headers={\"Authorization\": f\"Bearer {os.environ['DROPFANS_API_KEY']}\"},\n    json={\n        \"priceUsd\": 9.99,\n        \"interval\": \"monthly\",\n        \"description\": \"All my sets, first.\",\n    },\n)\nprint(res.json())"
    }
  ],
  "x-dropfans-docs": "https://www.dropfans.io/developers/reference/update-subscription",
  "x-dropfans-agency-permission": "canEditProfile"
}
```

---

Previous: [Read the creator’s subscription tier](https://www.dropfans.io/developers/reference/get-subscription.md) · Next: [The creator’s payout balance](https://www.dropfans.io/developers/reference/get-balance.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
