Update the account
Sets webhook_url for every conversion that does not send its own. null removes it.
PATCH
https://api.switchfile.io/v1/accountExample
Request
curl -X PATCH "https://api.switchfile.io/v1/account" \
-H "Authorization: Bearer $SWITCHFILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"webhook_url": "https://example.com/hooks/switchfile"
}'const res = await fetch("https://api.switchfile.io/v1/account", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.SWITCHFILE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
webhook_url: "https://example.com/hooks/switchfile"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());<?php
$ch = curl_init('https://api.switchfile.io/v1/account');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => 'https://example.com/hooks/switchfile',
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWITCHFILE_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $response");
}
print_r(json_decode($response, true));import os
import requests
res = requests.patch(
"https://api.switchfile.io/v1/account",
headers={"Authorization": f"Bearer {os.environ['SWITCHFILE_API_KEY']}"},
json={
"webhook_url": "https://example.com/hooks/switchfile",
},
)
res.raise_for_status()
print(res.json())Request body
webhook_urlstring | nullrequiredat most 4096 characters · matches ^https?://
Responses
200OK
creditsstring (integer) | integerrequiredPaid credits left on the account
emailstringrequiredend_user_quotaobjectOnly with X-End-User: the free quota of the visitor
end_user_quota.files_per_daystring (integer) | integerrequiredend_user_quota.files_usedstring (integer) | integerrequiredThe higher of the counts for the visitor and for the IP address
end_user_quota.reset_atstringrequiredISO 8601 timestamp, for example 2026-11-06T18:00:00+00:00
end_user_quota.video_minutes_per_daynumberrequiredend_user_quota.video_minutes_usednumberrequiredThe higher of the counts for the visitor and for the IP address
free_quotaobjectrequiredfree_quota.compute_minutes_per_daynumberrequiredfree_quota.compute_minutes_usednumberrequiredfree_quota.conversions_per_daystring (integer) | integerrequiredfree_quota.conversions_usedstring (integer) | integerrequiredfree_quota.reset_atstringrequiredISO 8601 timestamp, for example 2026-11-06T18:00:00+00:00
idstringrequiredmax_file_sizestring (integer) | integerrequiredLargest file in bytes, for uploads and multipart requests
sandboxbooleanrequiredservicebooleanrequiredService key: may send X-End-User
webhook_signing_secretstringrequiredSecret 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
UNAUTHENTICATED401 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
END_USER_NOT_ALLOWED403 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
NOT_FOUND404 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." }411The request has a body but no Content-Length header
LENGTH_REQUIRED411 application/problem+json{ "type": "https://switchfile.io/docs/api/v1#errors-length-required", "title": "Length required", "status": 411, "code": "LENGTH_REQUIRED", "detail": "A Content-Length header is required for this request." }413The request or the file is too large
PAYLOAD_TOO_LARGE413 application/problem+json{ "type": "https://switchfile.io/docs/api/v1#errors-payload-too-large", "title": "Payload too large", "status": 413, "code": "PAYLOAD_TOO_LARGE", "detail": "The request body is larger than the allowed maximum." }422The URL is not a public http or https address
INVALID_URL422 application/problem+json{ "type": "https://switchfile.io/docs/api/v1#errors-invalid-url", "title": "Invalid url", "status": 422, "code": "INVALID_URL", "detail": "The URL must be a public http or https address." }429Too many requests or a daily quota is used up. See Retry-After
RATE_LIMIT_EXCEEDED429 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." }