Delete a report template
Delete a custom Smart Report template owned by the authenticated client. The deleted template document is returned in { "data": ... }.
In headless workflows and automated test pipelines, use this endpoint to clean up temporary templates or retire deprecated report designs. Built-in "System" templates cannot be deleted and return 403 (system_template_readonly). Deleting a template does not spend credits and does not remove previously generated SmartBatch reports.
Endpoint
DELETE https://api.verifik.co/v2/smart-report-templates/{id}
The Smart-Agent proxy (https://ai.verifik.co) exposes the same /v2/... paths and requires your own Authorization: Bearer <VERIFIK_JWT> header.
Headers
| Name | Value |
|---|---|
| Accept | application/json |
| Authorization | Bearer <VERIFIK_JWT> |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Smart Report template ObjectId. |
Request
- Node.js
- PHP
- Python
- Go
- cURL
const fetch = require("node-fetch");
async function run() {
const id = "67c1f94b2d8a1c0012a4b301";
const res = await fetch(
`https://api.verifik.co/v2/smart-report-templates/${id}`,
{
method: "DELETE",
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(await res.json());
}
run();
<?php
$id = "67c1f94b2d8a1c0012a4b301";
$ch = curl_init("https://api.verifik.co/v2/smart-report-templates/" . $id);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Accept: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
import os
import requests
template_id = "67c1f94b2d8a1c0012a4b301"
url = f"https://api.verifik.co/v2/smart-report-templates/{template_id}"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
r = requests.delete(url, headers=headers)
print(r.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
id := "67c1f94b2d8a1c0012a4b301"
req, _ := http.NewRequest("DELETE", "https://api.verifik.co/v2/smart-report-templates/"+id, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X DELETE "https://api.verifik.co/v2/smart-report-templates/67c1f94b2d8a1c0012a4b301" \
-H "Accept: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
Response
- 200
- 401
- 403
- 404
- 409
{
"data": {
"_id": "67c1f94b2d8a1c0012a4b301",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Driver Onboarding Report v2",
"country": "CO",
"category": "citizen",
"isActive": true
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "system_template_readonly",
"code": "Forbidden"
}
{
"message": "not_found",
"code": "NotFound"
}
{
"message": "\"id\" must be a valid ObjectId",
"code": "MissingParameter"
}
Notes
- Built-in
"System"templates cannot be deleted (403system_template_readonly). - Once deleted, subsequent
GET,PUT, orDELETErequests targeting the same{id}return{ "data": null }(onGET) or404not_found(onPUT/DELETE).