Create Template
curl --request POST \
--url https://api.artosai.com/api/v1/templates/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_name": "<string>",
"document_type": "<string>",
"sections": [
{
"order_index": 123,
"level": 123,
"section_name": "<string>",
"synopsis": "<string>",
"template_instructions": "<string>",
"template_text": "<string>",
"section_type": "<string>",
"section_mode": "<string>",
"is_repeating": false,
"expansion_type": "<string>",
"data_instructions": "<string>",
"guidance": "<string>",
"outline_text": "<string>",
"allowed_data_rules": [
"<string>"
],
"examples": [
{}
],
"rules": [
{
"confidence_score": 123,
"rule_type": "<string>",
"rule_mode": "<string>",
"description": "<string>",
"explanation": "<string>",
"generated_content": "<string>",
"rule_parameters": {}
}
]
}
],
"template_s3_uri": "<string>",
"template_file_name": "<string>",
"document_description": "<string>",
"tags": [
"<string>"
],
"users": [
"<string>"
]
}
'import requests
url = "https://api.artosai.com/api/v1/templates/"
payload = {
"template_name": "<string>",
"document_type": "<string>",
"sections": [
{
"order_index": 123,
"level": 123,
"section_name": "<string>",
"synopsis": "<string>",
"template_instructions": "<string>",
"template_text": "<string>",
"section_type": "<string>",
"section_mode": "<string>",
"is_repeating": False,
"expansion_type": "<string>",
"data_instructions": "<string>",
"guidance": "<string>",
"outline_text": "<string>",
"allowed_data_rules": ["<string>"],
"examples": [{}],
"rules": [
{
"confidence_score": 123,
"rule_type": "<string>",
"rule_mode": "<string>",
"description": "<string>",
"explanation": "<string>",
"generated_content": "<string>",
"rule_parameters": {}
}
]
}
],
"template_s3_uri": "<string>",
"template_file_name": "<string>",
"document_description": "<string>",
"tags": ["<string>"],
"users": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_name: '<string>',
document_type: '<string>',
sections: [
{
order_index: 123,
level: 123,
section_name: '<string>',
synopsis: '<string>',
template_instructions: '<string>',
template_text: '<string>',
section_type: '<string>',
section_mode: '<string>',
is_repeating: false,
expansion_type: '<string>',
data_instructions: '<string>',
guidance: '<string>',
outline_text: '<string>',
allowed_data_rules: ['<string>'],
examples: [{}],
rules: [
{
confidence_score: 123,
rule_type: '<string>',
rule_mode: '<string>',
description: '<string>',
explanation: '<string>',
generated_content: '<string>',
rule_parameters: {}
}
]
}
],
template_s3_uri: '<string>',
template_file_name: '<string>',
document_description: '<string>',
tags: ['<string>'],
users: ['<string>']
})
};
fetch('https://api.artosai.com/api/v1/templates/', 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.artosai.com/api/v1/templates/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_name' => '<string>',
'document_type' => '<string>',
'sections' => [
[
'order_index' => 123,
'level' => 123,
'section_name' => '<string>',
'synopsis' => '<string>',
'template_instructions' => '<string>',
'template_text' => '<string>',
'section_type' => '<string>',
'section_mode' => '<string>',
'is_repeating' => false,
'expansion_type' => '<string>',
'data_instructions' => '<string>',
'guidance' => '<string>',
'outline_text' => '<string>',
'allowed_data_rules' => [
'<string>'
],
'examples' => [
[
]
],
'rules' => [
[
'confidence_score' => 123,
'rule_type' => '<string>',
'rule_mode' => '<string>',
'description' => '<string>',
'explanation' => '<string>',
'generated_content' => '<string>',
'rule_parameters' => [
]
]
]
]
],
'template_s3_uri' => '<string>',
'template_file_name' => '<string>',
'document_description' => '<string>',
'tags' => [
'<string>'
],
'users' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.artosai.com/api/v1/templates/"
payload := strings.NewReader("{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.artosai.com/api/v1/templates/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.artosai.com/api/v1/templates/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"template_id": "<string>",
"template_name": "<string>",
"organization_id": "<string>",
"section_count": 123,
"rule_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}Templates
Create Template
Create a new template with nested sections and rules. Validates inputs and persists to database.
POST
/
api
/
v1
/
templates
/
Create Template
curl --request POST \
--url https://api.artosai.com/api/v1/templates/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_name": "<string>",
"document_type": "<string>",
"sections": [
{
"order_index": 123,
"level": 123,
"section_name": "<string>",
"synopsis": "<string>",
"template_instructions": "<string>",
"template_text": "<string>",
"section_type": "<string>",
"section_mode": "<string>",
"is_repeating": false,
"expansion_type": "<string>",
"data_instructions": "<string>",
"guidance": "<string>",
"outline_text": "<string>",
"allowed_data_rules": [
"<string>"
],
"examples": [
{}
],
"rules": [
{
"confidence_score": 123,
"rule_type": "<string>",
"rule_mode": "<string>",
"description": "<string>",
"explanation": "<string>",
"generated_content": "<string>",
"rule_parameters": {}
}
]
}
],
"template_s3_uri": "<string>",
"template_file_name": "<string>",
"document_description": "<string>",
"tags": [
"<string>"
],
"users": [
"<string>"
]
}
'import requests
url = "https://api.artosai.com/api/v1/templates/"
payload = {
"template_name": "<string>",
"document_type": "<string>",
"sections": [
{
"order_index": 123,
"level": 123,
"section_name": "<string>",
"synopsis": "<string>",
"template_instructions": "<string>",
"template_text": "<string>",
"section_type": "<string>",
"section_mode": "<string>",
"is_repeating": False,
"expansion_type": "<string>",
"data_instructions": "<string>",
"guidance": "<string>",
"outline_text": "<string>",
"allowed_data_rules": ["<string>"],
"examples": [{}],
"rules": [
{
"confidence_score": 123,
"rule_type": "<string>",
"rule_mode": "<string>",
"description": "<string>",
"explanation": "<string>",
"generated_content": "<string>",
"rule_parameters": {}
}
]
}
],
"template_s3_uri": "<string>",
"template_file_name": "<string>",
"document_description": "<string>",
"tags": ["<string>"],
"users": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_name: '<string>',
document_type: '<string>',
sections: [
{
order_index: 123,
level: 123,
section_name: '<string>',
synopsis: '<string>',
template_instructions: '<string>',
template_text: '<string>',
section_type: '<string>',
section_mode: '<string>',
is_repeating: false,
expansion_type: '<string>',
data_instructions: '<string>',
guidance: '<string>',
outline_text: '<string>',
allowed_data_rules: ['<string>'],
examples: [{}],
rules: [
{
confidence_score: 123,
rule_type: '<string>',
rule_mode: '<string>',
description: '<string>',
explanation: '<string>',
generated_content: '<string>',
rule_parameters: {}
}
]
}
],
template_s3_uri: '<string>',
template_file_name: '<string>',
document_description: '<string>',
tags: ['<string>'],
users: ['<string>']
})
};
fetch('https://api.artosai.com/api/v1/templates/', 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.artosai.com/api/v1/templates/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_name' => '<string>',
'document_type' => '<string>',
'sections' => [
[
'order_index' => 123,
'level' => 123,
'section_name' => '<string>',
'synopsis' => '<string>',
'template_instructions' => '<string>',
'template_text' => '<string>',
'section_type' => '<string>',
'section_mode' => '<string>',
'is_repeating' => false,
'expansion_type' => '<string>',
'data_instructions' => '<string>',
'guidance' => '<string>',
'outline_text' => '<string>',
'allowed_data_rules' => [
'<string>'
],
'examples' => [
[
]
],
'rules' => [
[
'confidence_score' => 123,
'rule_type' => '<string>',
'rule_mode' => '<string>',
'description' => '<string>',
'explanation' => '<string>',
'generated_content' => '<string>',
'rule_parameters' => [
]
]
]
]
],
'template_s3_uri' => '<string>',
'template_file_name' => '<string>',
'document_description' => '<string>',
'tags' => [
'<string>'
],
'users' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.artosai.com/api/v1/templates/"
payload := strings.NewReader("{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.artosai.com/api/v1/templates/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.artosai.com/api/v1/templates/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"sections\": [\n {\n \"order_index\": 123,\n \"level\": 123,\n \"section_name\": \"<string>\",\n \"synopsis\": \"<string>\",\n \"template_instructions\": \"<string>\",\n \"template_text\": \"<string>\",\n \"section_type\": \"<string>\",\n \"section_mode\": \"<string>\",\n \"is_repeating\": false,\n \"expansion_type\": \"<string>\",\n \"data_instructions\": \"<string>\",\n \"guidance\": \"<string>\",\n \"outline_text\": \"<string>\",\n \"allowed_data_rules\": [\n \"<string>\"\n ],\n \"examples\": [\n {}\n ],\n \"rules\": [\n {\n \"confidence_score\": 123,\n \"rule_type\": \"<string>\",\n \"rule_mode\": \"<string>\",\n \"description\": \"<string>\",\n \"explanation\": \"<string>\",\n \"generated_content\": \"<string>\",\n \"rule_parameters\": {}\n }\n ]\n }\n ],\n \"template_s3_uri\": \"<string>\",\n \"template_file_name\": \"<string>\",\n \"document_description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"template_id": "<string>",
"template_name": "<string>",
"organization_id": "<string>",
"section_count": 123,
"rule_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}Authorizations
Okta access-token JWT sent as a Bearer token. The token identifies the user and scopes access to the user's organization.
Body
application/json
Name of template
Document type (e.g., CSR, IND)
At least one section required
Show child attributes
Show child attributes
S3 object key for template file
Template file name
User IDs with access
⌘I