Skip to main content
POST
Create a prompt
Creates a prompt in your workspace. The API key creator becomes the prompt owner and can manage it in the Prompt Library.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Required Scopes

This endpoint requires the PROMPT_API scope.
Sharing the prompt with the workspace requires the sharePrompts permission. Assigning a folder requires write access to that folder.

Parameters

Example

Response Format

Success Response (201 Created)

Error Handling

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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Body

application/json
title
string
required

Prompt title.

Required string length: 2 - 100
prompt
string
required

Prompt content.

Required string length: 2 - 120000
promptFolderId
string<uuid>

Folder UUID to assign. Cannot be set when sharedWithWorkspace is true.

sharedWithWorkspace
boolean

Share the prompt with the workspace. Cannot be true when promptFolderId is set.

Response

Prompt created successfully

prompt
object
required