Exchange a personal access token for a scoped host token
curl --request POST \
--url https://app.felan.ai/api/v1/hosts/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"installId": "<string>",
"name": "<string>",
"daemonVersion": "<string>",
"protocol": 1,
"rowSchemaVersion": 4503599627370495
}
'import requests
url = "https://app.felan.ai/api/v1/hosts/token"
payload = {
"installId": "<string>",
"name": "<string>",
"daemonVersion": "<string>",
"protocol": 1,
"rowSchemaVersion": 4503599627370495
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
installId: '<string>',
name: '<string>',
daemonVersion: '<string>',
protocol: 1,
rowSchemaVersion: 4503599627370495
})
};
fetch('https://app.felan.ai/api/v1/hosts/token', 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://app.felan.ai/api/v1/hosts/token",
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([
'installId' => '<string>',
'name' => '<string>',
'daemonVersion' => '<string>',
'protocol' => 1,
'rowSchemaVersion' => 4503599627370495
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.felan.ai/api/v1/hosts/token"
payload := strings.NewReader("{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.felan.ai/api/v1/hosts/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.felan.ai/api/v1/hosts/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"expiresAt": 4503599627370495,
"refreshAt": 4503599627370495,
"host": {
"id": "<string>",
"teamId": "<string>",
"userId": "<string>"
},
"supabase": {
"url": "<string>",
"publishableKey": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}Hosts
Exchange a personal access token for a scoped host token
Creates or reuses a host for the (PAT, installId) pair. A new PAT creates a new host. Rechecks team membership, PAT and host revocation, and schema support on every exchange. All responses use Cache-Control: no-store. The name is limited to 128 UTF-8 bytes.
POST
/
hosts
/
token
Exchange a personal access token for a scoped host token
curl --request POST \
--url https://app.felan.ai/api/v1/hosts/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"installId": "<string>",
"name": "<string>",
"daemonVersion": "<string>",
"protocol": 1,
"rowSchemaVersion": 4503599627370495
}
'import requests
url = "https://app.felan.ai/api/v1/hosts/token"
payload = {
"installId": "<string>",
"name": "<string>",
"daemonVersion": "<string>",
"protocol": 1,
"rowSchemaVersion": 4503599627370495
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
installId: '<string>',
name: '<string>',
daemonVersion: '<string>',
protocol: 1,
rowSchemaVersion: 4503599627370495
})
};
fetch('https://app.felan.ai/api/v1/hosts/token', 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://app.felan.ai/api/v1/hosts/token",
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([
'installId' => '<string>',
'name' => '<string>',
'daemonVersion' => '<string>',
'protocol' => 1,
'rowSchemaVersion' => 4503599627370495
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.felan.ai/api/v1/hosts/token"
payload := strings.NewReader("{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.felan.ai/api/v1/hosts/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.felan.ai/api/v1/hosts/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"installId\": \"<string>\",\n \"name\": \"<string>\",\n \"daemonVersion\": \"<string>\",\n \"protocol\": 1,\n \"rowSchemaVersion\": 4503599627370495\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"expiresAt": 4503599627370495,
"refreshAt": 4503599627370495,
"host": {
"id": "<string>",
"teamId": "<string>",
"userId": "<string>"
},
"supabase": {
"url": "<string>",
"publishableKey": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}{
"code": "<string>",
"message": "<string>",
"supported": {
"protocol": [
4503599627370495
],
"rowSchemaVersion": [
4503599627370495
]
}
}Authorizations
Personal access token (fln_pat_…). Only accepted by the host token exchange.
Body
application/json
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Required string length:
1 - 128Required string length:
1 - 128Required range:
0 <= x <= 9007199254740991Response
Scoped ES256 host token, valid for at most 15 minutes. Never cache this response.
