> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Prompt

> Retrieve a prompt by ID from your workspace

Retrieves a prompt by ID from your workspace.

## Base URL

```
https://api.langdock.com/prompts/v1/{promptId}
```

<Warning>
  **Dedicated deployments**

  Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.
</Warning>

## Required Scopes

This endpoint requires the `PROMPT_API` scope.

<Info>
  Requires access through ownership, workspace sharing, or a shared folder.
</Info>

## Parameters

| Parameter  | Type   | Required | Description                     |
| ---------- | ------ | -------- | ------------------------------- |
| `promptId` | string | Yes      | UUID of the prompt to retrieve. |

## Example

```javascript theme={null}
const axios = require("axios");

async function getPrompt(promptId) {
  const response = await axios.get(
    `https://api.langdock.com/prompts/v1/${promptId}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Prompt:", response.data.prompt);
}

getPrompt("550e8400-e29b-41d4-a716-446655440000");
```

## Response Format

### Success Response (200 OK)

```typescript theme={null}
{
  prompt: {
    id: string;
    title: string;
    prompt: string;
    createdBy: string | null;
    promptFolderId: string | null;
    sharedWithWorkspace: boolean;
    createdAt: string | null;
    updatedAt: string | null;
  };
}
```

## Error Handling

| Status Code | Description                                    |
| ----------- | ---------------------------------------------- |
| 400         | Invalid prompt ID format                       |
| 401         | Invalid or missing API key                     |
| 403         | Missing `PROMPT_API` scope or workspace access |
| 404         | Prompt not found or not accessible             |
| 429         | Rate limit exceeded                            |
| 500         | Internal server error                          |

<Info>
  Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>


## OpenAPI

````yaml GET /prompts/v1/{promptId}
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /prompts/v1/{promptId}:
    get:
      tags:
        - Prompts
      summary: Get a prompt
      description: Retrieves a prompt by ID from your workspace.
      operationId: getPrompt
      parameters:
        - $ref: '#/components/parameters/PromptId'
      responses:
        '200':
          description: Prompt returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '400':
          description: Invalid prompt ID
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing required scope or access
        '404':
          description: Prompt not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  parameters:
    PromptId:
      name: promptId
      in: path
      required: true
      description: UUID of the prompt.
      schema:
        type: string
        format: uuid
  schemas:
    PromptResponse:
      type: object
      required:
        - prompt
      properties:
        prompt:
          $ref: '#/components/schemas/Prompt'
    Prompt:
      type: object
      required:
        - id
        - title
        - prompt
        - sharedWithWorkspace
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the prompt.
        title:
          type: string
          minLength: 2
          maxLength: 100
          description: Prompt title.
        prompt:
          type: string
          minLength: 2
          maxLength: 120000
          description: Prompt content.
        createdBy:
          type: string
          format: uuid
          nullable: true
          description: User ID of the prompt creator.
        promptFolderId:
          type: string
          format: uuid
          nullable: true
          description: Folder ID the prompt is assigned to.
        sharedWithWorkspace:
          type: boolean
          description: Whether the prompt is shared with the workspace.
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 timestamp for prompt creation.
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 timestamp for the latest prompt update.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````