curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "certificate-corrected.docx",
"fileBase64": "UEsDBBQABgAIAAAAIQ..."
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}"
payload = {
"fileName": "certificate-corrected.docx",
"fileBase64": "UEsDBBQABgAIAAAAIQ..."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'certificate-corrected.docx', fileBase64: 'UEsDBBQABgAIAAAAIQ...'})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}', 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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}",
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([
'fileName' => 'certificate-corrected.docx',
'fileBase64' => 'UEsDBBQABgAIAAAAIQ...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}"
payload := strings.NewReader("{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}"
response = http.request(request)
puts response.read_body{
"templateKey": "550e8400-e29b-41d4-a716-446655440040",
"checkpointId": "550e8400-e29b-41d4-a716-446655440042",
"companyId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Certificate of Insurance",
"number": "FM-0010",
"category": "event",
"storagePath": "acme/550e8400-.../formTemplates/550e8400-.../V-001/550e8400-....docx",
"createdAt": "2026-07-01T12:00:00.000Z",
"createdBy": "550e8400-e29b-41d4-a716-446655440099",
"updatedAt": "2026-07-01T12:00:00.000Z",
"updatedBy": "550e8400-e29b-41d4-a716-446655440099"
}Replace Form Template
Replaces an existing DOCX template’s content in place, addressed by its
stable FM-XXXX number. The uploaded file becomes a new version under the
SAME template — same number, templateKey, display name, and category — so
the template’s identity is unchanged and forms-logic rules (which reference
the number) keep working. Use this to correct or update an existing
template without re-pointing the rules that depend on it.
Same-type only. The target number must be a .docx template and the
replacement must be .docx; a static PDF form is replaced via
PUT /forms/static/{number}. This prevents a replace from silently flipping a
form’s file type under the same number.
Validation otherwise matches Upload Form Template: every embedded smart tag
must resolve to an available, smart-tag-enabled field for the template’s
category, named by its current hashed identity (the retired legacy
AIIFmv1<ReferenceId> naming is rejected with an error naming the
replacement) — otherwise the entire replace is rejected with a per-tag 400
and no new version is written. category is not part of the request — a
replace never re-scopes; the new content is validated against the template’s
existing category.
Required permission: form-template.edit
curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "certificate-corrected.docx",
"fileBase64": "UEsDBBQABgAIAAAAIQ..."
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}"
payload = {
"fileName": "certificate-corrected.docx",
"fileBase64": "UEsDBBQABgAIAAAAIQ..."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'certificate-corrected.docx', fileBase64: 'UEsDBBQABgAIAAAAIQ...'})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}', 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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}",
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([
'fileName' => 'certificate-corrected.docx',
'fileBase64' => 'UEsDBBQABgAIAAAAIQ...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}"
payload := strings.NewReader("{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/forms/template/{number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"certificate-corrected.docx\",\n \"fileBase64\": \"UEsDBBQABgAIAAAAIQ...\"\n}"
response = http.request(request)
puts response.read_body{
"templateKey": "550e8400-e29b-41d4-a716-446655440040",
"checkpointId": "550e8400-e29b-41d4-a716-446655440042",
"companyId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Certificate of Insurance",
"number": "FM-0010",
"category": "event",
"storagePath": "acme/550e8400-.../formTemplates/550e8400-.../V-001/550e8400-....docx",
"createdAt": "2026-07-01T12:00:00.000Z",
"createdBy": "550e8400-e29b-41d4-a716-446655440099",
"updatedAt": "2026-07-01T12:00:00.000Z",
"updatedBy": "550e8400-e29b-41d4-a716-446655440099"
}Authorizations
API key authentication. Send your raw API key as the Authorization header value with NO scheme prefix — Authorization: YOUR-API-KEY. Do NOT prefix it with Bearer or ApiKey, and do not use an X-API-Key header; those are not accepted.
Path Parameters
Company identifier
The form template's stable FM-XXXX number (as returned by the Upload Form
Template endpoint). It identifies the template across all of its versions and
is the same value forms-logic rules reference.
Body
Response
New version created. The response is the new checkpoint's summary — note
number and templateKey are unchanged from the previous version.
A single form-template checkpoint.
Stable identifier of the template across its versions.
Identifier of this specific checkpoint (version) of the template.
Display name (derived from the uploaded file name).
Human-facing form number (e.g. FM-0010).
The form category assigned to the template.
event, quote-flow, quote-bind-flow, unknown Internal storage key of the checkpoint's document.
