delete_mfa_factor
DELETE
/api/v1/auth/mfa/factors/{id}
const url = 'https://example.com/api/v1/auth/mfa/factors/1';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/auth/mfa/factors/1";
let payload = json!({"code": "example"});
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request DELETE \ --url https://example.com/api/v1/auth/mfa/factors/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer format: int64
MFA factor ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
string | null
Examplegenerated
{ "code": "example"}Responses
Section titled “Responses”MFA factor deleted
Unauthorized
MFA factor not found