Forms
Generate a public token
Gives the form a new public token, replacing any token it already had, so links built on the old token stop working. The token identifies the public form for the share and embed URLs in the response and the Fluid Public SDK API’s token-addressed forms operations. The form must be active, and its embed settings still apply: a password, allowed domains, an expiry date, a submission limit, and required contact details. Works for any form type. Activating a form through Update a form also creates a token when the form has none.
POST
/
api
/
forms
/
{id}
/
generate_token
Generate a public token
curl --request POST \
--url https://api.fluid.app/api/forms/{id}/generate_token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluid.app/api/forms/{id}/generate_token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluid.app/api/forms/{id}/generate_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://api.fluid.app/api/forms/{id}/generate_token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{id}/generate_token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.fluid.app/api/forms/{id}/generate_token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{id}/generate_token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Public token generated",
"form": {
"id": 4132,
"title": "Scranton Business Park open house",
"status": "active",
"description": "RSVP for the Scranton Business Park open house on November 12.",
"form_type": null,
"form_redirect": null,
"updated_at": "2026-10-07T16:03:09Z",
"form_components": null,
"countries": [
{
"id": 233,
"name": "United States",
"iso": "US"
}
],
"form_styles": null,
"form_respondents_count": 0,
"public_token": "R4mY8kTq2WzX6nLc0VbH5s",
"embed_settings": {
"password_protected": true
},
"embed_url": "https://forms.fluid.app/R4mY8kTq2WzX6nLc0VbH5s?embed=true",
"share_url": "https://forms.fluid.app/R4mY8kTq2WzX6nLc0VbH5s"
},
"meta": {
"request_id": "5b1e8d4c-9a26-4f70-b3c5-0e8d2a6f4c19",
"timestamp": "2026-10-07T16:03:09Z"
}
}⌘I
Generate a public token
curl --request POST \
--url https://api.fluid.app/api/forms/{id}/generate_token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluid.app/api/forms/{id}/generate_token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluid.app/api/forms/{id}/generate_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://api.fluid.app/api/forms/{id}/generate_token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{id}/generate_token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.fluid.app/api/forms/{id}/generate_token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{id}/generate_token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Public token generated",
"form": {
"id": 4132,
"title": "Scranton Business Park open house",
"status": "active",
"description": "RSVP for the Scranton Business Park open house on November 12.",
"form_type": null,
"form_redirect": null,
"updated_at": "2026-10-07T16:03:09Z",
"form_components": null,
"countries": [
{
"id": 233,
"name": "United States",
"iso": "US"
}
],
"form_styles": null,
"form_respondents_count": 0,
"public_token": "R4mY8kTq2WzX6nLc0VbH5s",
"embed_settings": {
"password_protected": true
},
"embed_url": "https://forms.fluid.app/R4mY8kTq2WzX6nLc0VbH5s?embed=true",
"share_url": "https://forms.fluid.app/R4mY8kTq2WzX6nLc0VbH5s"
},
"meta": {
"request_id": "5b1e8d4c-9a26-4f70-b3c5-0e8d2a6f4c19",
"timestamp": "2026-10-07T16:03:09Z"
}
}