Create or upsert a content draft for an opportunity
POST
/studies/{slug}/drafts
const url = 'https://app.discotrace.com/api/v1/studies/core-discovery/drafts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”slug
required
string
Example
core-discoveryLowercase study slug within the authenticated workspace.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
opportunity_id
required
string
Example
opp-pricing-claritytitle
required
string
Example
Transparent Enterprise Pricing & SLA Guidetarget_url_slug
string
Example
/pricingmeta_title
string
meta_description
string
draft_markdown
string
status
string
Responses
Section titled “Responses”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" }}