API REFERENCE
Favorite Template
On this page
/api/agents/templates/{id}/favoriteMark or unmark an template as a favorite for the authenticated account. The endpoint is idempotent - calling it repeatedly with the same is_favourite value has no additional effect. The caller must be able to see the template (own it, the template is public, or it has been shared with them).
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request PUT \
--url 'https://api.recoupable.dev/api/agents/templates/YOUR_ID/favorite' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"is_favourite": true
}'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Try it
Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.
Kept in this browser tab only and cleared when it closes.
curl --request PUT \
--url 'https://recoup-api.vercel.app/api/agents/templates/{id}/favorite' \
--header 'Content-Type: application/json' \
--data '{
"is_favourite": true
}'Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the template to favorite or unfavorite
Request body required
Desired favorite state
application/json
is_favouritebooleanrequiredDesired favorite state for the authenticated account
Responses
200Favorite state updated successfully+
application/json
statusstring · enumrequiredStatus of the request
Values: "success"
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 template is private and has not been shared with the authenticated account+
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": "Toggle favorite on a template",
"description": "Mark or unmark an template as a favorite for the authenticated account. The endpoint is idempotent - calling it repeatedly with the same `is_favourite` value has no additional effect. The caller must be able to see the template (own it, the template is public, or it has been shared with them).",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the template to favorite or unfavorite",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "Desired favorite state",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToggleFavoriteRequest"
}
}
}
},
"responses": {
"200": {
"description": "Favorite state updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessResponse"
}
}
}
},
"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 template is private and has not been shared with the authenticated account",
"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"
}
}
}
}
}
}