Skip to content
Docs menu

Copy the text

Your browser did not allow copying. The text below is selected: press Ctrl+C, or ⌘C on a Mac.

Show the plan

The monthly plan bought on the website, if any. Plans are changed and cancelled on the website.

GEThttps://api.switchfile.io/v1/account/plan

Needs an API key: Authorization: Bearer YOUR_API_KEY. See Authentication.

Example

curl "https://api.switchfile.io/v1/account/plan" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY"

Responses

  • 200OK
    • manage_urlstringrequired

      Plans are managed on the website

    • planobject | nullrequired
    • plan.amountstring (integer) | integerrequired

      Price per month in cents

    • plan.creditsstring (integer) | integerrequired

      Credits per month

    • plan.currencystringrequired
    • plan.namestringrequired
    • plan.paid_throughstring | nullrequired

      ISO 8601 timestamp

    • plan.renews_atstring | nullrequired

      ISO 8601 timestamp

    • plan.statusstringrequired

      one of "active", "suspended", "scheduled", "pending", "cancelled"

    200 application/json
    {
      "plan": null,
      "manage_url": "https://switchfile.io/dashboard/billing"
    }
  • 401The API key is missing or not valid
    401 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-unauthenticated",
      "title": "Unauthenticated",
      "status": 401,
      "code": "UNAUTHENTICATED",
      "detail": "Missing or invalid API key."
    }
  • 403Not available with a service key or a connected app
    403 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-available",
      "title": "Not available",
      "status": 403,
      "code": "NOT_AVAILABLE",
      "detail": "This endpoint is only available with your own API key or the switchfile app."
    }
  • 404Does not exist for this account
    404 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-found",
      "title": "Not found",
      "status": 404,
      "code": "NOT_FOUND",
      "detail": "Not found."
    }
  • 422Invalid data. errors names the fields
    422 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-invalid-data",
      "title": "Invalid data",
      "status": 422,
      "code": "INVALID_DATA",
      "detail": "The request contains invalid data.",
      "errors": {
        "to": [
          "Expected string"
        ]
      }
    }
  • 429Too many requests or a daily quota is used up. See Retry-After
    429 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-rate-limit-exceeded",
      "title": "Rate limit exceeded",
      "status": 429,
      "code": "RATE_LIMIT_EXCEEDED",
      "detail": "Too many requests. Try again in 12 seconds."
    }

Error bodies and codes are explained in Errors.