Create a template
curl --request POST \
--url https://api.recoupable.dev/api/agents/templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": [
"<string>"
],
"is_private": true,
"share_emails": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.recoupable.dev/api/agents/templates"
payload = {
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": ["<string>"],
"is_private": True,
"share_emails": ["jsmith@example.com"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
prompt: '<string>',
tags: ['<string>'],
is_private: true,
share_emails: ['jsmith@example.com']
})
};
fetch('https://api.recoupable.dev/api/agents/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.recoupable.dev/api/agents/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([
'title' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'tags' => [
'<string>'
],
'is_private' => true,
'share_emails' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/agents/templates"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.post("https://api.recoupable.dev/api/agents/templates")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/agents/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": [
"<string>"
],
"creator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"image": "<string>",
"is_admin": true
},
"is_private": true,
"is_favourite": true,
"favorites_count": 123,
"shared_emails": [
"jsmith@example.com"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}Templates
Create Template
Create a new template owned by the authenticated account. When is_private is true, the optional share_emails array grants explicit read access to the listed accounts; for public templates the field is ignored.
POST
/
api
/
agents
/
templates
Create a template
curl --request POST \
--url https://api.recoupable.dev/api/agents/templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": [
"<string>"
],
"is_private": true,
"share_emails": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.recoupable.dev/api/agents/templates"
payload = {
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": ["<string>"],
"is_private": True,
"share_emails": ["jsmith@example.com"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
prompt: '<string>',
tags: ['<string>'],
is_private: true,
share_emails: ['jsmith@example.com']
})
};
fetch('https://api.recoupable.dev/api/agents/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.recoupable.dev/api/agents/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([
'title' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'tags' => [
'<string>'
],
'is_private' => true,
'share_emails' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/agents/templates"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.post("https://api.recoupable.dev/api/agents/templates")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/agents/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_private\": true,\n \"share_emails\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"prompt": "<string>",
"tags": [
"<string>"
],
"creator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"image": "<string>",
"is_admin": true
},
"is_private": true,
"is_favourite": true,
"favorites_count": 123,
"shared_emails": [
"jsmith@example.com"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}Authorizations
apiKeyAuthbearerAuth
Your Recoup API key. Learn more.
Body
application/json
Template fields
Short human-readable title for the template
Required string length:
3 - 50Description of what the template does
Required string length:
10 - 200The agent prompt body
Required string length:
20 - 10000Free-form tags used to categorize the template. Pass an empty array if there are no tags.
When true, the template is restricted to the creator and the accounts listed in share_emails
Emails to grant access to. Only applied when is_private is true. Defaults to an empty array when omitted.
Was this page helpful?
⌘I
