Prompt klasörü getir
Workspace'inizden ID ile bir prompt klasörü alın
Workspace'inizden ID ile bir prompt klasörü getirir.
Base URL
https://api.ajan.io/prompts/v1/folders/{folderId}Dedicated deployments Tüm isteklerde
api.ajan.com'u/api/publicile değiştirin.
Required Scopes
Bu endpoint PROMPT_API kapsamını gerektirir.
Sahiplik, workspace paylaşımı veya grup paylaşımı üzerinden erişim gerekir.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
folderId | string | Yes | Alınacak klasörün UUID'si. |
Example
javascript
const axios = require("axios");
async function getPromptFolder(folderId) {
const response = await axios.get(
`https://api.ajan.io/prompts/v1/folders/${folderId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log("Folder:", response.data.folder);
}
getPromptFolder("7c9e6679-7425-40de-944b-e07fc1f90ae7");Response Format
Success Response (200 OK)
typescript
{
folder: {
id: string;
name: string;
createdBy: string;
sharedWithWorkspace: boolean;
sharedWithGroupId: string | null;
createdAt: string;
updatedAt: string;
};
}Error Handling
| Status Code | Description |
|---|---|
| 400 | Geçersiz klasör ID biçimi |
| 401 | Geçersiz veya eksik API anahtarı |
| 403 | Eksik PROMPT_API kapsamı veya workspace erişimi |
| 404 | Prompt klasörü bulunamadı veya erişilemiyor |
| 429 | Rate limit aşıldı |
| 500 | Dahili sunucu hatası |
ajan, API anahtarınızı korumak ve uygulamalarınızın güvenliğini sağlamak için tarayıcı kaynaklı istekleri bilinçli olarak engeller. Daha fazla bilgi için API Key Best Practices kılavuzuna bakın.
OpenAPI
openapi: 3.0.0
info:
title: ajan API
version: 3.0.0
servers:
- url: https://api.ajan.io
description: Production
security:
- bearerAuth: []
paths:
/prompts/v1/folders/{folderId}:
get:
tags:
- Prompts
summary: Get a prompt folder
description: Retrieves a prompt folder by ID from your workspace.
operationId: getPromptFolder
parameters:
- $ref: '#/components/parameters/PromptFolderId'
responses:
'200':
description: Prompt folder returned successfully
content:
application/json:
schema:
$ref: '#/components/schemas/PromptFolderResponse'
'400':
description: Invalid folder ID
'401':
description: Invalid or missing API key
'403':
description: Missing required scope or access
'404':
description: Prompt folder not found
'429':
description: Rate limit exceeded
'500':
description: Internal server error
components:
parameters:
PromptFolderId:
name: folderId
in: path
required: true
description: UUID of the prompt folder.
schema:
type: string
format: uuid
schemas:
PromptFolderResponse:
type: object
required:
- folder
properties:
folder:
$ref: '#/components/schemas/PromptFolder'
PromptFolder:
type: object
required:
- id
- name
- createdBy
- sharedWithWorkspace
- createdAt
- updatedAt
properties:
id:
type: string
format: uuid
description: Unique identifier for the prompt folder.
name:
type: string
minLength: 2
maxLength: 50
description: Folder name.
createdBy:
type: string
format: uuid
description: User ID of the folder creator.
sharedWithWorkspace:
type: boolean
description: Whether the folder is shared with the workspace.
sharedWithGroupId:
type: string
format: uuid
nullable: true
description: Group ID the folder is shared with.
createdAt:
type: string
format: date-time
description: ISO 8601 timestamp for folder creation.
updatedAt:
type: string
format: date-time
description: ISO 8601 timestamp for the latest folder update.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
description: API key as Bearer token. Format "Bearer YOUR_API_KEY"