# List prompt templates div strong 🔨 In Development — This section is still being developed and may change. Retrieves a list of prompt templates for the specified organization. Supports pagination and filtering to manage large collections of templates. Use this endpoint to discover available prompt templates, search by name or tags, and manage your template library. #### Query Parameters **`organizationId`** string *required* The unique identifier of the organization whose prompt templates to list. All API requests must be scoped to an organization for access control and resource management. **`limit`** integer *optional* · Defaults to `20` The maximum number of prompt templates to return in the response. Must be between 1 and 100. **`offset`** integer *optional* · Defaults to `0` The number of prompt templates to skip before starting to return results. Used for pagination. **`name`** string *optional* Filter templates by exact name match. **`tags`** array *optional* Filter templates that contain all of the specified tags. Each tag must be present in the template's tags array. **`isPublic`** boolean *optional* Filter templates by public status. When `true`, returns only public templates. When `false`, returns only private templates. When omitted, returns both. **`search`** string *optional* Free-text search across template names and descriptions. Performs fuzzy matching to find relevant templates. **`sort`** string *optional* · Defaults to `createdAt` Sort the results by the specified field. Available options: `name` (alphabetical), `createdAt` (creation date), `updatedAt` (last modified), `usageCount` (most used first). **`order`** string *optional* · Defaults to `desc` Sort order direction. Available options: `asc` (ascending), `desc` (descending). Only applicable when `sort` is specified. #### Response **`object`** string Always set to `"list"`. **`data`** array Array of prompt template objects. **`hasMore`** boolean Whether there are additional prompt templates to retrieve (for pagination). **`limit`** integer The limit that was applied to this request. **`offset`** integer The offset that was applied to this request. **`total`** integer The total number of prompt templates matching the query (may be approximate for large collections). Each prompt template in the `data` array includes: - `id` string - The unique identifier - `name` string - The template name - `description` string - The template description - `tags` array - The assigned tags - `isPublic` boolean - Public status - `createdAt` integer - Creation timestamp - `updatedAt` integer - Last modified timestamp - `version` string - Current version - `usageCount` integer - Number of times used (approximate) ## Returns A [PromptsResponse](#promptsresponse) object containing the API response data. List all templates ```bash curl "https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&limit=10" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python import requests import os response = requests.get( "https://api.freddy.aitronos.com/v1/prompts", headers={ "Authorization": f"Bearer {os.environ['FREDDY_API_KEY']}" }, params={ "organizationId": "org_abc123", "limit": 10 } ) print(response.json()) ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&limit=10', { headers: { 'Authorization': `Bearer ${process.env.FREDDY_API_KEY}` } }); const result = await response.json(); console.log(result); ``` Filter by tags ```bash curl "https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&tags=code-review&tags=development&limit=5" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python response = requests.get( "https://api.freddy.aitronos.com/v1/prompts", headers={"Authorization": f"Bearer {api_key}"}, params={ "organizationId": "org_abc123", "tags": ["code-review", "development"], "limit": 5 } ) ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&tags=code-review&tags=development&limit=5', { headers: { 'Authorization': `Bearer ${apiKey}` } }); ``` Search templates ```bash curl "https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&search=support&limit=20&sort=name&order=asc" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python response = requests.get( "https://api.freddy.aitronos.com/v1/prompts", headers={"Authorization": f"Bearer {api_key}"}, params={ "organizationId": "org_abc123", "search": "support", "limit": 20, "sort": "name", "order": "asc" } ) ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&search=support&limit=20&sort=name&order=asc', { headers: { 'Authorization': `Bearer ${apiKey}` } }); ``` Paginated results ```bash # First page curl "https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&limit=10&offset=0" \ -H "Authorization: Bearer $FREDDY_API_KEY" # Second page curl "https://api.freddy.aitronos.com/v1/prompts?organizationId=org_abc123&limit=10&offset=10" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python def list_prompts_paginated(organization_id, limit=10, offset=0): response = requests.get( "https://api.freddy.aitronos.com/v1/prompts", headers={"Authorization": f"Bearer {api_key}"}, params={ "organizationId": organization_id, "limit": limit, "offset": offset } ) return response.json() # First page first_page = list_prompts_paginated("org_abc123", offset=0) # Second page second_page = list_prompts_paginated("org_abc123", offset=10) print(f"Total templates: {first_page.get('total', 0)}") print(f"First page has more: {first_page.get('hasMore', False)}") ``` ```javascript async function listPromptsPaginated(organizationId, limit = 10, offset = 0) { const response = await fetch(`https://api.freddy.aitronos.com/v1/prompts?organizationId=${organizationId}&limit=${limit}&offset=${offset}`, { headers: { 'Authorization': `Bearer ${apiKey}` } }); return await response.json(); } // First page const firstPage = await listPromptsPaginated('org_abc123', 10, 0); // Second page const secondPage = await listPromptsPaginated('org_abc123', 10, 10); console.log(`Total templates: ${firstPage.total}`); console.log(`First page has more: ${firstPage.hasMore}`); ``` #### Example Response ```json { "object": "list", "data": [ { "id": "prompt_abc123", "object": "prompt", "name": "Code Review Assistant", "description": "Reviews code pull requests and provides improvement suggestions", "tags": ["code-review", "development", "quality"], "isPublic": false, "createdAt": 1735689600, "updatedAt": 1735689600, "version": "1.0.0", "usageCount": 45 }, { "id": "prompt_def456", "object": "prompt", "name": "Customer Support Bot", "description": "Standard customer support responses with escalation options", "tags": ["support", "customer-service"], "isPublic": true, "createdAt": 1735603200, "updatedAt": 1735689600, "version": "2.1.0", "usageCount": 127 } ], "hasMore": true, "limit": 10, "offset": 0, "total": 23 } ``` ## Related Resources - [Create Prompt](/docs/api-reference/prompts/create) - [Retrieve Prompt](/docs/api-reference/prompts/retrieve) - [Update Prompt](/docs/api-reference/prompts/update) - [Delete Prompt](/docs/api-reference/prompts/delete) - [Using Prompt Templates](/docs/api-reference/responses/create#prompt)