---
title: "Resync Subscription"
method: POST
path: "/admin/resync_subscription"
tags: ["accepts-api-key"]
---

# Resync Subscription

`POST /admin/resync_subscription`

## Request

- Base URL: `https://api.tellers.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tellers.ai/admin/resync_subscription`
- Auth: none declared

Make a user's local subscription match Stripe, by email. Admin only.

Re-resolves the Stripe customer (the stored id is kept only if Stripe still
has it, else the customer is found by its ``firebaseUID`` metadata), then
upserts the newest active subscription the way the webhooks do, or clears a
local subscription Stripe no longer has. Never grants tokens: those stay
tied to paid invoices.

## Headers

- `x-api-key` string, nullable
- `authorization` string, nullable

## Request body

- ResyncSubscriptionRequest
  - `email` string, required: Email of the user whose subscription to resync

## Response `200`

Successful Response

- ResyncSubscriptionResponse
  - `email` string, required: Email of the resynced user
  - `stripe_customer_id` string, nullable, required: Stripe customer the user is linked to, null if none exists
  - `stripe_customer_updated` boolean, required: True if the stored Stripe customer id was changed
  - `action` 'upserted' | 'cleared' | 'unchanged', required: upserted: the local subscription now mirrors Stripe; cleared: a stale local subscription was removed; unchanged: nothing to do
  - `subscription` ApiUserSubscription, required
    - `type` 'Monthly' | 'Yearly' | 'Enterprise', required: User-facing subscription cadence label. Enterprise is a plan set up by the Tellers team, billed outside the app: it unlocks every feature and cannot be changed or cancelled from the app.
    - `tier` 'basic' | 'pro' | 'expert' | 'enterprise_user', required: Named subscription offer; subscriptions that predate tiers read as basic. ``enterprise_user`` is granted by hand outside Stripe (see :mod:`tellers_common.enterprise_user_subscription`) and ranks above every paid tier.
    - `pricing_tier` string, nullable: Billing catalog plan `tier_id` the subscription is on (for example `monthly` or `pro_yearly`), including existing subscribers on retired prices; null when it matches no catalog plan.
    - `can_configure_tokens` boolean, required: True when the user can buy extra tokens on top of the plan (expert only).
    - `monthly_tokens` number, required: Subscription token amount available each month.
    - `storage_quota_gb` integer, required: Total storage quota available to the user in GB.
    - `pricing` ApiUserSubscriptionPricingLine[]: Current Stripe subscription price lines with price id and quantity.
      - `id` string, required: Stripe price id for this subscription line.
      - `quantity` integer, required: Quantity for this Stripe price line.
    - `currency` string, nullable: Lowercase ISO 4217 code the subscription is billed in. Stripe can't change it, so plan changes are priced in it. Null for a subscription not synced since this was added.
    - `cancel_at_period_end` boolean: True when Stripe will cancel the subscription at period end.
    - `cancel_at` string, nullable: UTC ISO-8601 time when Stripe will cancel the subscription.
    - `current_period_end` string, nullable: UTC ISO-8601 end of the current subscription period.
    - `tokens_renew_at` string, nullable: UTC ISO-8601 time the plan's monthly tokens are next granted: the renewal for a monthly plan, the next monthly drop for a yearly one. Null when no further grant is due (e.g. the subscription is set to cancel first).
    - `latest_payment_issue` object, nullable: When set, an invoice needs payment or customer action (e.g. 3DS). Fields may include invoice_id, invoice_status, hosted_invoice_url, customer_action_url.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tellers/apis/tellers-api.md) - [All operations](https://skmtc.dev/tellers/apis/tellers-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tellers/apis/tellers-api/revisions/fdaa0fa44a26?raw)
