RecoupGet a Free AuditFree Audit

API REFERENCE

Favorite Template

On this page
PUT/api/agents/templates/{id}/favorite

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).

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
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.

Parameters

Path parameters

idstringrequired

The unique identifier (UUID) of the template to favorite or unfavorite

Request body required

Desired favorite state

application/json

is_favouritebooleanrequired

Desired favorite state for the authenticated account

Responses

200Favorite state updated successfully

application/json

statusstring · enumrequired

Status of the request

Values: "success"

400Bad request - validation failed

application/json

statusstring · enumrequired

Status of the request

Values: "error"

errorstringrequired

Human-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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Human-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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Human-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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Human-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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Human-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.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}