Skip to main content

Templates Search

[MODE:GREENFIELD] Read-only, idempotent. Tier: greenfield.

Searches Templates the current Player can read, own templates, public templates, team-shared templates, through GET /api/import_templates.

When to use​

  • Greenfield mode, choosing a starting template.
  • Looking up a known template by name / tag / topic before fibe_launch.
  • Surveying available capabilities ("what Postgres templates exist?").

Inputs​

FieldTypeRequiredNotes
querystringnoSearch query (full-text by default)
template_id_or_namenumber or stringnoRestrict to one specific template (variant lookup)
regexboolnoTreat query as PostgreSQL regex

Regex mode constraints​

Regex search is prefiltered with a 3+ character literal token from the regex; if no such token exists, the search errors out. Examples:

  • "^demo-": works (literal demo-).
  • ".*": rejected (no token).
  • "foo|bar": works (each alternative ≥3 chars).

Output​

{
"data": [
{
"id": 1,
"name": "fibe/postgres",
"description": "...",
"category": "...",
"owner": { ... },
"latest_version": { "id": 5, "version": 5, "public": true },
"scope": "own" | "public",
"full_access": true | false,
...
}
],
"meta": { "page": 1, "per_page": <N>, "total": <N> }
}

scope distinguishes: own (you can update), public (read-only). full_access:true means you can edit & version it.

Search padding​

When a non-empty query matches nothing in your accessible scope, Fibe searches the broader public scope. Those fallback results use mode: :public and full_access: false.

Gotchas​

  • Empty query returns the full accessible catalog (paginated by per_page from caller, defaults vary).
  • Regex without a literal token returns 422 with a hint message.
  • template_id_or_name filter is exact-match: useful for "show me all versions / variants of template 42".
  • Visibility follows the platform's authorization policies: a private template owned by another player is invisible even if its name matches.

Recipes​

  • "find Tower-style apps": { query:"tower" }.
  • Strict prefix only: { query:"^tower-", regex:true }.
  • Versions of a known template: { template_id_or_name:42 }.
  • fibe_launch: launch a found template.
  • fibe_greenfield_create: uses template_id_or_name from this output.
  • fibe_resource_list(resource:"template", params:{q:"..."}): alternative listing path.