Skip to content
Docs menu

Show the account

Credits, today's free quota, the webhook settings and the largest allowed file. With a service key and X-End-User, end_user_quota adds the free quota of that visitor.

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

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

Example

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

Parameters

Headers

  • X-End-Userstring

    Service keys only: an ID for the visitor you act for (1 to 128 characters: letters, digits and . _ : @ -). Quotas and rate limits then count per visitor.

  • X-End-User-Ipstring

    Required with X-End-User: the IP address of the visitor.

Responses

  • 200OK
    • creditsstring (integer) | integerrequired

      Paid credits left on the account

    • emailstringrequired
    • end_user_quotaobject

      Only with X-End-User: the free quota of the visitor

    • end_user_quota.files_per_daystring (integer) | integerrequired
    • end_user_quota.files_usedstring (integer) | integerrequired

      The higher of the counts for the visitor and for the IP address

    • end_user_quota.reset_atstringrequired

      ISO 8601 timestamp, for example 2026-11-06T18:00:00+00:00

    • end_user_quota.video_minutes_per_daynumberrequired
    • end_user_quota.video_minutes_usednumberrequired

      The higher of the counts for the visitor and for the IP address

    • free_quotaobjectrequired
    • free_quota.compute_minutes_per_daynumberrequired
    • free_quota.compute_minutes_usednumberrequired
    • free_quota.conversions_per_daystring (integer) | integerrequired
    • free_quota.conversions_usedstring (integer) | integerrequired
    • free_quota.reset_atstringrequired

      ISO 8601 timestamp, for example 2026-11-06T18:00:00+00:00

    • idstringrequired
    • max_file_sizestring (integer) | integerrequired

      Largest file in bytes, for uploads and multipart requests

    • sandboxbooleanrequired
    • servicebooleanrequired

      Service key: may send X-End-User

    • webhook_signing_secretstringrequired

      Secret for checking the Switchfile-Signature header of webhooks

    • webhook_urlstring | nullrequired
    200 application/json
    {
      "id": "4f8a2c6e-1b3d-4e5f-8a7c-9d0b2e4f6a18",
      "email": "[email protected]",
      "credits": 1200,
      "free_quota": {
        "conversions_per_day": 50,
        "conversions_used": 3,
        "compute_minutes_per_day": 20,
        "compute_minutes_used": 0.4,
        "reset_at": "2026-11-07T00:00:00+00:00"
      },
      "webhook_url": "https://example.com/hooks/switchfile",
      "webhook_signing_secret": "whsec_6b1d2f3a4c5e6f708192a3b4c5d6e7f8",
      "sandbox": false,
      "service": false,
      "max_file_size": 1073741824
    }
  • 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 allowed: a signed URL is wrong or expired, or X-End-User was sent without a service key
    403 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-end-user-not-allowed",
      "title": "End user not allowed",
      "status": 403,
      "code": "END_USER_NOT_ALLOWED",
      "detail": "The X-End-User header is only allowed with a service key."
    }
  • 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": "Conversion not found."
    }
  • 422X-End-User or X-End-User-Ip is not valid
    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": {
        "X-End-User-Ip": [
          "A valid IPv4 or IPv6 address of the visitor is required with X-End-User."
        ]
      }
    }
  • 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.