{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailcheer-com/json-schema/mailcheer-com-account-schema.json",
  "title": "Account",
  "description": "What the key gives access to, and what is left to use. The first call to make: it gives the verified domains and the registered senders — that is, the only addresses your sends will pass with — and everything a send can be refused for: the monthly quota (queue included), the daily limit of a new workspace, the billing status.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailcheer-com-openapi.json#/components/schemas/Account",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "account"
    },
    "organization": {
      "type": "object",
      "description": "The workspace the key belongs to. `null` if the workspace has been deleted.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        }
      }
    },
    "key": {
      "type": "object",
      "description": "The key used for this call. Its secret is never returned.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The key's identifier (not its secret) — the `key_id` of a `key_quota_exceeded`."
        },
        "name": {
          "type": "string",
          "description": "The name you gave it."
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "emails:send",
              "subscribers:read",
              "subscribers:write",
              "campaigns:read",
              "campaigns:write",
              "webhooks:read",
              "webhooks:write"
            ]
          },
          "description": "The permissions of THIS key. A call outside this list returns 403."
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ],
          "description": "`live`, or `test` for a test key (`mch_test_…`): its sends are checked and simulated, nothing goes out."
        },
        "language": {
          "type": "string",
          "enum": [
            "en",
            "fr"
          ],
          "description": "The language of this key's messages when a call asks for none (`Accept-Language` absent, or not English or French). Set under Settings → API; `en` by default."
        },
        "monthly_limit": {
          "type": [
            "object",
            "null"
          ],
          "description": "The key's own monthly limit and what it used this month (its emails and the campaigns it launched, copies included, queue included). `null` when the key has none — only the workspace quota counts then. Beyond it: `402 key_quota_exceeded`.",
          "properties": {
            "limit": {
              "type": "integer"
            },
            "used": {
              "type": "integer"
            },
            "remaining": {
              "type": "integer"
            },
            "resets_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    },
    "plan": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "emails_per_month": {
          "type": [
            "integer",
            "null"
          ],
          "description": "`null` = unlimited."
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "period": {
          "type": "string",
          "description": "The current month, `YYYY-MM`."
        },
        "emails_sent": {
          "type": "integer",
          "description": "This month's sends accepted by our provider — campaigns, automations, tests and API together."
        },
        "emails_in_flight": {
          "type": "integer",
          "description": "Promised but not yet sent: campaign messages waiting in the queue or being sent, reserved automation sends. Already deducted from `emails_remaining`."
        },
        "emails_remaining": {
          "type": [
            "integer",
            "null"
          ],
          "description": "What can still be sent this month: quota − `emails_sent` − `emails_in_flight`, never negative. `null` = unlimited. A send asking for more than this returns `402 quota_exceeded`."
        },
        "resets_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the monthly counter resets: the 1st of next month at 00:00 UTC (ISO 8601)."
        }
      }
    },
    "billing": {
      "type": "object",
      "description": "The subscription as our payment provider reports it. It explains a `plan` that is not the one being paid for: when a payment fails for good, the workspace runs on the free plan's limits while `subscribed_plan` still names the plan that was bought.",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "active",
            "trialing",
            "past_due",
            "unpaid",
            "canceled",
            "incomplete",
            "incomplete_expired",
            "paused"
          ],
          "description": "`none` = never subscribed (free plan, nothing to pay). Otherwise the provider's status: `active`, `trialing`, `past_due` (a payment failed, access kept while it retries), `unpaid` (retries abandoned: free plan limits apply), `canceled`, `incomplete`, `incomplete_expired`, `paused`."
        },
        "subscribed_plan": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "starter",
            "pro",
            "agency",
            null
          ],
          "description": "The plan being billed, while a subscription is alive; `null` otherwise. It can differ from `plan.id` (see `status`)."
        },
        "current_period_end": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "End of the period already paid for; `null` without a live subscription."
        },
        "cancel_at_period_end": {
          "type": "boolean",
          "description": "`true` when the subscription has been cancelled and stops at the end of the period."
        },
        "trial_ends_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "End of the free week — offered once per workspace, on its first move to a paid plan — when `status` is `trialing`: the plan already applies and the first charge falls on this date (ISO 8601). `null` otherwise."
        },
        "scheduled_change": {
          "type": [
            "object",
            "null"
          ],
          "description": "A change that will take effect later — a downgrade, or a cancellation (`plan: \"free\"`); `null` if none.",
          "properties": {
            "plan": {
              "type": "string",
              "enum": [
                "free",
                "starter",
                "pro",
                "agency"
              ],
              "description": "The plan that will apply."
            },
            "effective_at": {
              "type": "string",
              "format": "date-time",
              "description": "When it takes effect (ISO 8601)."
            }
          }
        },
        "manage_url": {
          "type": "string",
          "format": "uri",
          "description": "The billing screen where the owner or an administrator changes plan, card or invoices. In the language of the call (`Accept-Language`)."
        }
      }
    },
    "limits": {
      "type": "object",
      "description": "The other limits of the plan, and how much of each is used.",
      "properties": {
        "members": {
          "type": "object",
          "description": "Seats in the workspace. A pending, unexpired invitation takes a seat.",
          "properties": {
            "used": {
              "type": "integer",
              "description": "Current members."
            },
            "pending_invitations": {
              "type": "integer",
              "description": "Invitations sent and still valid."
            },
            "max": {
              "type": [
                "integer",
                "null"
              ],
              "description": "The plan's maximum; `null` = unlimited."
            }
          }
        },
        "sending_domains": {
          "type": "object",
          "description": "Sending domains, verified or not.",
          "properties": {
            "used": {
              "type": "integer",
              "description": "Domains added to the workspace."
            },
            "max": {
              "type": [
                "integer",
                "null"
              ],
              "description": "The plan's maximum; `null` = unlimited."
            }
          }
        },
        "daily": {
          "type": [
            "object",
            "null"
          ],
          "description": "The daily limit of a new workspace, over a rolling 24 hours: 1,000 emails until the workspace is verified (automatically, at its first send), then none. `null` when it does not apply. A send above it returns `429 daily_quota_exceeded`.",
          "properties": {
            "limit": {
              "type": "integer",
              "description": "Emails allowed per rolling 24 hours."
            },
            "used": {
              "type": "integer",
              "description": "Accepted over the last 24 hours, plus what is waiting in the queue."
            },
            "remaining": {
              "type": "integer",
              "description": "What can still go out now; never negative."
            },
            "next_limit": {
              "type": [
                "integer",
                "null"
              ],
              "description": "The next limit (`500`), or `null` when the next step lifts it."
            },
            "changes_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "When the limit changes (ISO 8601)."
            }
          }
        }
      }
    },
    "subscribers": {
      "type": "integer",
      "description": "Subscribers with status `subscribed` — the ones a campaign would reach."
    },
    "sending_domains": {
      "type": "array",
      "description": "The workspace's domains. Only those with `verified: true` can serve as `from`.",
      "items": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        }
      }
    },
    "senders": {
      "type": "array",
      "description": "The registered senders. A CAMPAIGN can only go out from one of them; an individual email, on the other hand, accepts any address on a verified domain.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "To pass as `sender_id` when creating a campaign."
          },
          "from": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name shown in the inbox."
          },
          "default": {
            "type": "boolean",
            "description": "The one a campaign takes if you designate none."
          }
        }
      }
    }
  }
}