Skip to main content
PUT
/
accounts
/
{account_id}
/
mfa
Submit an MFA response for an account
curl --request PUT \
  --url https://api.sandbox.goteal.co/accounts/{account_id}/mfa \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "mfa": "123456"
}
'
import requests

url = "https://api.sandbox.goteal.co/accounts/{account_id}/mfa"

payload = { "mfa": "123456" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({mfa: '123456'})
};

fetch('https://api.sandbox.goteal.co/accounts/{account_id}/mfa', 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://api.sandbox.goteal.co/accounts/{account_id}/mfa",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mfa' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);

$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://api.sandbox.goteal.co/accounts/{account_id}/mfa"

payload := strings.NewReader("{\n \"mfa\": \"123456\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("X-API-KEY", "<api-key>")
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.put("https://api.sandbox.goteal.co/accounts/{account_id}/mfa")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mfa\": \"123456\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.goteal.co/accounts/{account_id}/mfa")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mfa\": \"123456\"\n}"

response = http.request(request)
puts response.read_body
{
  "account_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
  "payroll_provider": "quickbooks",
  "user_name": "john.smith@company.com",
  "created_at": "2019-05-17T00:00:00.000Z",
  "status": "PENDING",
  "mfa_enabled": true,
  "latest_pay_date": "2019-05-17T00:00:00.000Z"
}
{
"errors": [
"The request is missing the required field `name`"
]
}
{
"errors": [
"Not Authorization: Bearer <token> provided or wrong value"
]
}
{
"errors": [
"The resource with id [8be3bb60-5ab4-4bd2-90e6-3b015691a827] does not exist"
]
}
This endpoint requires a valid authorisation for the user. If no active authorisation exists, the request will be rejected. You can optionally pass the x-teal-authorisation-id header to specify which authorisation to use; otherwise the system will resolve a valid authorisation automatically. See Authorisations for more details.

Authorizations

X-API-KEY
string
header
required

Headers

x-teal-authorisation-id
string<uuid>

Optional authorisation ID to associate with this request. If not provided, the system will attempt to resolve a valid authorisation for the user automatically.

Example:

"7f3b8c2a-1d4e-4f6a-8b8c-9a0b1c2d3e4f"

Path Parameters

account_id
string
required

ID of the account requiring MFA

Body

application/json
mfa
string
required

The MFA response value (code, date, or password characters depending on the MFA method)

Example:

"123456"

Response

MFA response accepted

account_id
string
required

The id of the account

Example:

"95a0e70b-fe02-4f47-aef9-2efff279df71"

payroll_provider
string
required

The payroll provider to use

Example:

"quickbooks"

user_name
string
required

The login of the user

Example:

"john.smith@company.com"

created_at
string<date-time>
required
Example:

"2019-05-17T00:00:00.000Z"

status
string

Status of account

Example:

"PENDING"

mfa_enabled
boolean

Is mfa enabled for this account

latest_pay_date
string<date-time>

The latest pay date of the payroll under this account

Example:

"2019-05-17T00:00:00.000Z"