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
Replace the content of an existing DOCX form template with a new version,
keeping its FM-XXXX number so forms-logic rules keep pointing at it. Get
the number from List Forms (listForms). For a static PDF form, use
Replace Static Form (replaceStaticForm).
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
Headers
Optional key for a safe retry of this upload or replacement. Send a new value, 1 to 255 printable ASCII characters, for each operation. A successful attempt reserves the key for 30 days from admission. Retries do not extend that window. After 30 days the same key runs as a new request, even if its body differs. Within that window, retry the same path, query and JSON body with the same key to receive the original checkpoint's current summary and status without uploading again. A failed attempt stores no key. Keys belong to the calling credential. Within 30 days, reusing one with a different request returns 422 IDEMPOTENCY_KEY_REUSED; an invalid key returns 400 INVALID_IDEMPOTENCY_KEY.
1 - 255^[\x20-\x7E]{1,255}$Path Parameters
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.
