리포트 템플릿 삭제
인증된 클라이언트가 소유한 사용자 지정 Smart Report 템플릿을 삭제합니다. 삭제된 템플릿 문서는 { "data": ... }로 반환됩니다.
헤드리스 워크플로 및 자동화된 테스트 파이프라인에서 임시 템플릿을 정리하거나 더 이상 사용하지 않는 리포트 디자인을 제거할 때 이 엔드포인트를 사용하세요. 기본 제공 "System" 템플릿은 삭제할 수 없으며 403 (system_template_readonly)을 반환합니다. 템플릿을 삭제해도 크레딧이 차감되지 않으며 이전에 생성된 SmartBatch 리포트도 제거되지 않습니다.
엔드포인트
DELETE https://api.verifik.co/v2/smart-report-templates/{id}
Smart-Agent 프록시(https://ai.verifik.co)도 동일한 /v2/... 경로를 제공하며 본인의 Authorization: Bearer <VERIFIK_JWT> 헤더가 필요합니다.
헤더
| 이름 | 값 |
|---|---|
| Accept | application/json |
| Authorization | Bearer <VERIFIK_JWT> |
매개변수
| 이름 | 타입 | 필수 | 설명 |
|---|---|---|---|
id | string | 예 | Smart Report 템플릿 ObjectId. |
요청
- 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"
응답
- 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"
}
참고 사항
- 기본 제공
"System"템플릿은 삭제할 수 없습니다(403system_template_readonly). - 삭제된 후 동일한
{id}를 대상으로 하는 후속GET,PUT또는DELETE요청은{ "data": null }(GET시) 또는404not_found(PUT/DELETE시)를 반환합니다.