Auth
Disable MFA
Verify a TOTP or unused backup code, then disable MFA and wipe the secret and backup codes.
POST
/
v1
/
auth
/
mfa
/
disable
Disable TOTP MFA
curl --request POST \
--url https://billing.example.com/v1/auth/mfa/disable \
--header 'Content-Type: application/json' \
--cookie recurso_session= \
--data '
{
"code": "<string>"
}
'import requests
url = "https://billing.example.com/v1/auth/mfa/disable"
payload = { "code": "<string>" }
headers = {
"cookie": "recurso_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'recurso_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('https://billing.example.com/v1/auth/mfa/disable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/auth/mfa/disable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>'
]),
CURLOPT_COOKIE => "recurso_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/auth/mfa/disable"
payload := strings.NewReader("{\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "recurso_session=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/auth/mfa/disable")
.header("cookie", "recurso_session=")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/auth/mfa/disable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'recurso_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"mfa_enabled": true
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Turns off MFA for the logged-in user after verifying a current TOTP code or an
unused backup code. The stored secret and all backup codes are deleted; to
re-enable, start again with Begin MFA Setup
and Verify MFA.
Requires a logged-in user session; API-key callers receive
Errors use the standard envelope — see Errors.
401.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | A current TOTP code or an unused backup code (XXXXX-XXXXX; case and separator are ignored). |
Example Request
curl -X POST https://api.recurso.dev/v1/auth/mfa/disable \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"code": "482913"
}'
Example Response
{
"mfa_enabled": false
}
Fields
| Field | Type | Description |
|---|---|---|
mfa_enabled | boolean | Always false on success. |
Errors
| Status | Code | When | Fix |
|---|---|---|---|
| 400 | validation_failed | code is missing, or it is neither a valid TOTP code nor an unused backup code (invalid code). | Send a current authenticator code or an unused backup code. |
| 401 | unauthorized | No live session cookie, or the caller authenticated with an API key rather than a user session. | Sign in via /auth/login and send the recurso_session cookie. |
| 409 | conflict | MFA is not enabled for this user. | Nothing to disable. |
| 500 | internal_error | MFA state could not be updated. | Retry; contact support if it persists. |
⌘I
Disable TOTP MFA
curl --request POST \
--url https://billing.example.com/v1/auth/mfa/disable \
--header 'Content-Type: application/json' \
--cookie recurso_session= \
--data '
{
"code": "<string>"
}
'import requests
url = "https://billing.example.com/v1/auth/mfa/disable"
payload = { "code": "<string>" }
headers = {
"cookie": "recurso_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'recurso_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('https://billing.example.com/v1/auth/mfa/disable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/auth/mfa/disable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>'
]),
CURLOPT_COOKIE => "recurso_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/auth/mfa/disable"
payload := strings.NewReader("{\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "recurso_session=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/auth/mfa/disable")
.header("cookie", "recurso_session=")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/auth/mfa/disable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'recurso_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"mfa_enabled": true
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}