Generate content for prompts
curl --request POST \
--url https://app.promptingco.com/api/v1/content/generate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"promptIds": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({promptIds: ['<string>']})
};
fetch('https://app.promptingco.com/api/v1/content/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.promptingco.com/api/v1/content/generate"
payload = { "promptIds": ["<string>"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"data": {
"scope": {
"product": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"organization": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
},
"count": 1,
"drafts": [
{
"draftId": "<string>",
"promptId": "<string>",
"runId": "<string>",
"title": "<string>"
}
]
}
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Content
Generate content for prompts
Start the content-generation agent for one or more prompts. Each prompt gets a draft (returned with its draftId and runId); generated content lands in the review queue as pending_review, never published directly. Poll GET /api/v1/content/{draftId} until generationStatus is completed or failed.
POST
/
api
/
v1
/
content
/
generate
Generate content for prompts
curl --request POST \
--url https://app.promptingco.com/api/v1/content/generate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"promptIds": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({promptIds: ['<string>']})
};
fetch('https://app.promptingco.com/api/v1/content/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.promptingco.com/api/v1/content/generate"
payload = { "promptIds": ["<string>"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"data": {
"scope": {
"product": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"organization": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
},
"count": 1,
"drafts": [
{
"draftId": "<string>",
"promptId": "<string>",
"runId": "<string>",
"title": "<string>"
}
]
}
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"ok": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Authorizations
apiKeyAuthbearerAuthcookieAuth
Organization-scoped API key. Available scopes:
- content:read: Read site pages, markdown content, and llms.txt files
- content:write: Create, update, and delete site pages and content
- prompts:read: Read prompts, topics, prompt suggestions, and prompt analysis results
- prompts:write: Create, update, archive prompts and generate, edit, or review prompt suggestions
- simulations:read: Read agent-simulation tasks, runs, environments, and analytics
- simulations:write: Create and trigger simulation runs
- logs:read: Read AI-traffic logs and request-level audit events
- analytics:read: Read analytics aggregates (rankings, mentions, sources, SOV)
- analytics:write: Write events to analytics
- products:read: Read product metadata and competitor data
- products:write: Update product settings and competitor lists
Body
application/json
Prompts to generate content for. Prompt text is loaded server-side; ids must belong to the product.
Required array length:
1 - 25 elementsMinimum string length:
1Product ID. Provide exactly one of productId or productSlug.
Minimum string length:
1Product slug. Provide exactly one of productId or productSlug.
Minimum string length:
1Available options:
recommended, solution-recommendation, comparison, explainer, implementation-guide, decision-guide, use-case-workflow, listicle, solution-guide, code-example, code-decision-guide, compatibility, faq, custom Minimum string length:
1Available options:
soft-sell, hard-sell, neutral Maximum string length:
10000