Skip to main content
POST
/
accounts
/
direct-connections
Creates a direct connection for a user.
curl --request POST \
  --url https://api.sandbox.goteal.co/accounts/direct-connections \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71"
}
'
import requests

url = "https://api.sandbox.goteal.co/accounts/direct-connections"

payload = { "user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: '95a0e70b-fe02-4f47-aef9-2efff279df71'})
};

fetch('https://api.sandbox.goteal.co/accounts/direct-connections', 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/direct-connections",
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([
'user_id' => '95a0e70b-fe02-4f47-aef9-2efff279df71'
]),
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/direct-connections"

payload := strings.NewReader("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.goteal.co/accounts/direct-connections")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.goteal.co/accounts/direct-connections")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\"\n}"

response = http.request(request)
puts response.read_body
{
  "pagination": {
    "offset": 75,
    "limit": 25,
    "count": 14,
    "total_count": 89
  },
  "payroll_submissions": [
    {
      "id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
      "account_id": "674744df-9626-47ef-ae2b-4a491be136b5",
      "entry_id": "be770ba4-1362-46cd-8c1c-2330ce3a8b69",
      "created_at": "2019-05-17T00:00:00.000Z",
      "identity_information": {
        "name": "John Smith",
        "date_of_birth": "2019-05-17T00:00:00.000Z",
        "address": {
          "street": "123 Main Street",
          "county": "Greater London",
          "city": "London",
          "post_code": "SW1A 1AA",
          "country": "United Kingdom"
        },
        "email": "john.smith@company.com",
        "phone": 447123456789,
        "NI_number": "AB123456C"
      },
      "employment_information": {
        "employer_name": "Acme Ltd",
        "role": "Software Engineer",
        "type": "Full-time",
        "status": "active",
        "start_date": "2019-05-17T00:00:00.000Z",
        "leave_date": "2019-05-17T00:00:00.000Z"
      },
      "income_information": {
        "pay_date": "2023-05-27T00:00:00.000Z",
        "pay_interval_start": "2023-05-01T00:00:00.000Z",
        "pay_interval_end": "2023-05-31T00:00:00.000Z",
        "pay_frequency": "Monthly",
        "earnings": {
          "gross_pay": 3500,
          "net_pay": 2500,
          "base_salary": 3000,
          "bonus": 500
        },
        "deductions": {
          "income_tax": 500,
          "employee_ni": 200,
          "employee_pension": 300,
          "total_deductions": 1000
        }
      },
      "document_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
      "document_external_id": "payslip123456",
      "document_filename": "file1-payslip.pdf",
      "trust_score": "High",
      "source": "Payroll (via Direct Connection)"
    }
  ]
}
{
"errors": [
"The request is missing the required field `name`"
]
}
{
"errors": [
"No X-API-KEY header provided or wrong value"
]
}
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"

Body

application/json
user_id
string
required

The id of the user

Example:

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

Response

Created

pagination
object
required
payroll_submissions
object[]
required