Skip to content

Create or upsert a content draft for an opportunity

POST
/studies/{slug}/drafts
curl --request POST \
--url https://app.discotrace.com/api/v1/studies/core-discovery/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "opportunity_id": "opp-pricing-clarity", "title": "Transparent Enterprise Pricing & SLA Guide", "target_url_slug": "/pricing", "meta_title": "example", "meta_description": "example", "draft_markdown": "example", "status": "brief_only" }'

Requires write scope. Creates or updates a grounded Markdown draft linked to an opportunity_id.

slug
required
string

Example

core-discovery

Lowercase study slug within the authenticated workspace.

Media typeapplication/json
object
opportunity_id
required
string

Example

opp-pricing-clarity
title
required
string

Example

Transparent Enterprise Pricing & SLA Guide
target_url_slug
string

Example

/pricing
meta_title
string
meta_description
string
draft_markdown
string
status
string
Allowed values: brief_only draft review approved published

Draft created or updated.

Structured error payload with remediation link (resolveUrl).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any

Example

{
"error": {
"code": "insufficient_scope",
"message": "API key is missing required scope 'run'.",
"retryable": false,
"resolveUrl": "https://app.discotrace.com/w/acme/api"
}
}

Structured error payload with remediation link (resolveUrl).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any

Example

{
"error": {
"code": "insufficient_scope",
"message": "API key is missing required scope 'run'.",
"retryable": false,
"resolveUrl": "https://app.discotrace.com/w/acme/api"
}
}

Structured error payload with remediation link (resolveUrl).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any

Example

{
"error": {
"code": "insufficient_scope",
"message": "API key is missing required scope 'run'.",
"retryable": false,
"resolveUrl": "https://app.discotrace.com/w/acme/api"
}
}

Structured error payload with remediation link (resolveUrl).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any

Example

{
"error": {
"code": "insufficient_scope",
"message": "API key is missing required scope 'run'.",
"retryable": false,
"resolveUrl": "https://app.discotrace.com/w/acme/api"
}
}