curl --request POST \
--url https://api-sandbox.endl.io/api/v0/terms/links \
--header 'API-KEY: <api-key>' \
--header 'Api-Version: <api-version>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://partner.example/endl/done"
}
'import requests
url = "https://api-sandbox.endl.io/api/v0/terms/links"
payload = { "redirect_uri": "https://partner.example/endl/done" }
headers = {
"Api-Version": "<api-version>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Version': '<api-version>',
'API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({redirect_uri: 'https://partner.example/endl/done'})
};
fetch('https://api-sandbox.endl.io/api/v0/terms/links', 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.endl.io/api/v0/terms/links",
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([
'redirect_uri' => 'https://partner.example/endl/done'
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Api-Version: <api-version>",
"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://api-sandbox.endl.io/api/v0/terms/links"
payload := strings.NewReader("{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Version", "<api-version>")
req.Header.Add("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.endl.io/api/v0/terms/links")
.header("Api-Version", "<api-version>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.endl.io/api/v0/terms/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Version"] = '<api-version>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}"
response = http.request(request)
puts response.read_body{
"code": 201,
"message": "Terms link created",
"status": "SUCCESS",
"data": {
"url": "https://www.endl.io/legal/terms?link=tos_3f9c2a71-8d4e-4b6a-9e1f-0c5d7a2b8e64&env=sandbox",
"expires_at": "2026-11-05T10:15:00Z"
}
}{
"code": 400,
"message": "Onboarding validation failed",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "ERRCUS_1712",
"message": "redirect_uri must not be blank; leave it out for the iframe flow",
"field": "redirect_uri"
}
]
}{
"code": 400,
"message": "<string>",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"code": 400,
"message": "<string>",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}Create terms link
Creates a single-use link to Endl’s hosted terms page for a customer you haven’t created yet. The customer accepts there, and you receive a signed agreement id to send as termsAcceptance.signed_agreement_id on Create customer.
- The document (Endl platform terms) and its version are chosen by Endl. You don’t send them.
- A link works only once and expires.
expires_atsays when; links currently last 15 minutes. - Use the
urlexactly as Endl returns it. Sandbox and QA links include&env=sandboxor&env=qa; production links have noenv. Don’t add, remove or change it. Don’t addredirect_urito the page URL yourself: Endl stores it with the link, and aredirect_uriadded to the page URL is ignored.
Unlike other onboarding responses, this one is wrapped in { code, message, status, data }.
Api-Version is required, as on every /api/v0 request: if it’s missing or the value isn’t supported, the request fails with 400 and field: "Api-Version".
See the hosted terms page guide for showing the url in an iframe or by redirect, and Terms acceptance for sending the result on Create customer.
curl --request POST \
--url https://api-sandbox.endl.io/api/v0/terms/links \
--header 'API-KEY: <api-key>' \
--header 'Api-Version: <api-version>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://partner.example/endl/done"
}
'import requests
url = "https://api-sandbox.endl.io/api/v0/terms/links"
payload = { "redirect_uri": "https://partner.example/endl/done" }
headers = {
"Api-Version": "<api-version>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Version': '<api-version>',
'API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({redirect_uri: 'https://partner.example/endl/done'})
};
fetch('https://api-sandbox.endl.io/api/v0/terms/links', 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.endl.io/api/v0/terms/links",
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([
'redirect_uri' => 'https://partner.example/endl/done'
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Api-Version: <api-version>",
"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://api-sandbox.endl.io/api/v0/terms/links"
payload := strings.NewReader("{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Version", "<api-version>")
req.Header.Add("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.endl.io/api/v0/terms/links")
.header("Api-Version", "<api-version>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.endl.io/api/v0/terms/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Version"] = '<api-version>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirect_uri\": \"https://partner.example/endl/done\"\n}"
response = http.request(request)
puts response.read_body{
"code": 201,
"message": "Terms link created",
"status": "SUCCESS",
"data": {
"url": "https://www.endl.io/legal/terms?link=tos_3f9c2a71-8d4e-4b6a-9e1f-0c5d7a2b8e64&env=sandbox",
"expires_at": "2026-11-05T10:15:00Z"
}
}{
"code": 400,
"message": "Onboarding validation failed",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "ERRCUS_1712",
"message": "redirect_uri must not be blank; leave it out for the iframe flow",
"field": "redirect_uri"
}
]
}{
"code": 400,
"message": "<string>",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"code": 400,
"message": "<string>",
"status": "ERROR",
"data": null,
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}Authorizations
Headers
The API version this request targets. Required on every /api/v0/* call. Format YYYY-MM.<release>; 2026-09.1 is the latest. The version that served the request is echoed back on the response. Missing, malformed or unsupported values are rejected with 400.
^\d{4}-\d{2}\.\d+$