API REFERENCE
Update Template
On this page
/api/agents/templates/{id}Update fields on an existing template owned by the authenticated account. All body fields are optional and only the supplied fields are modified. Providing share_emails replaces the existing share list for the template.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request PATCH \
--url 'https://api.recoupable.dev/api/agents/templates/YOUR_ID' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"title": "string",
"description": "string",
"prompt": "string",
"tags": [
"string"
],
"is_private": true,
"share_emails": [
"string"
]
}'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the template to update
Request body required
Fields to update on the template
application/json
titlestringShort human-readable title for the template
minLength: 3 · maxLength: 50
descriptionstringDescription of what the template does
minLength: 10 · maxLength: 200
promptstringThe agent prompt body
minLength: 20 · maxLength: 10000
tagsarray<string>Free-form tags used to categorize the template. Pass an empty array to clear tags.
Item properties for tags
string
is_privatebooleanWhen true, the template is restricted to the creator and the accounts listed in share_emails
share_emailsarray<string>Replaces the existing share list for the template. Only applied when the template is (or becomes) private.
Item properties for share_emails
string
Responses
200Template updated successfully+
application/json
statusstring · enumrequiredStatus of the request
Values: "success"
templateobjectrequiredProperties for template
idstringrequiredUnique identifier of the template
format: uuid
titlestringrequiredShort human-readable title for the template (3-50 characters)
descriptionstringrequiredDescription of what the template does (10-200 characters)
promptstringrequiredThe agent prompt body (20-10000 characters)
tagsarray<string>requiredFree-form tags used to categorize the template. Empty array when there are no tags.
Item properties for tags
string
creatorobject | nullrequiredThe account that created the template. May be null when the creator account is unavailable.
Properties for creator
idstringrequiredUnique identifier of the creator account
format: uuid
namestring | nullrequiredDisplay name of the creator account
imagestring | nullrequiredProfile image URL of the creator account
is_adminbooleanrequiredWhether the creator is a Recoup admin (their account email is on the platform admin allow-list)
is_privatebooleanrequiredWhether the template is restricted to the creator and explicitly shared accounts
is_favouritebooleanrequiredWhether the authenticated account has favorited this template
favorites_countintegerrequiredTotal number of accounts that have favorited this template
shared_emailsarray<string>requiredEmails the template has been shared with. Only populated for private templates the authenticated account owns; empty for public templates and for private templates shared with the caller.
Item properties for shared_emails
string
created_atstringrequiredISO 8601 timestamp of when the template was created
format: date-time
updated_atstring | nullrequiredISO 8601 timestamp of when the template was last updated
format: date-time
400Bad request - validation failed+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredHuman-readable error message
missing_fieldsarray<string>Names of required fields that were missing from the request, when applicable
Item properties for missing_fields
string
401Unauthorized - missing or invalid credentials+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredHuman-readable error message
missing_fieldsarray<string>Names of required fields that were missing from the request, when applicable
Item properties for missing_fields
string
403Forbidden - the authenticated account does not own this template+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredHuman-readable error message
missing_fieldsarray<string>Names of required fields that were missing from the request, when applicable
Item properties for missing_fields
string
404Template not found+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredHuman-readable error message
missing_fieldsarray<string>Names of required fields that were missing from the request, when applicable
Item properties for missing_fields
string
500Internal server error+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredHuman-readable error message
missing_fieldsarray<string>Names of required fields that were missing from the request, when applicable
Item properties for missing_fields
string
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download templates.jsonView operation source
{
"summary": "Update a template",
"description": "Update fields on an existing template owned by the authenticated account. All body fields are optional and only the supplied fields are modified. Providing `share_emails` replaces the existing share list for the template.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the template to update",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "Fields to update on the template",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateTemplateRequest"
}
}
}
},
"responses": {
"200": {
"description": "Template updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TemplateResponse"
}
}
}
},
"400": {
"description": "Bad request - validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - missing or invalid credentials",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - the authenticated account does not own this template",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"404": {
"description": "Template not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
}
}