The brief to write an article from
curl --request GET \
--url https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"opportunityId": "<string>",
"kind": "create_page",
"title": "<string>",
"rationale": "<string>",
"topic": "<string>",
"persona": "<string>",
"intent": "<string>",
"targetPrompts": [
"<string>"
],
"voice": {
"brand": {
"name": "<string>",
"positioning": "<string>",
"audience": "<string>",
"productDescription": "<string>",
"tone": "<string>",
"contentStyle": "<string>",
"excludedTopics": [
"<string>"
]
},
"language": {
"code": "<string>",
"name": "<string>",
"nativeName": "<string>",
"country": "<string>"
}
},
"research": {
"evidenceBundleId": "<string>",
"sources": [
{
"url": "<string>",
"facts": [
"<string>"
]
}
]
},
"articlePlan": {
"title": "<string>",
"intent": "<string>",
"persona": "<string>",
"angle": "<string>",
"evidenceIds": [
"<string>"
],
"outline": [
{
"heading": "<string>",
"intent": "<string>",
"evidenceIds": [
"<string>"
]
}
]
},
"creditsCharged": 123,
"planUnavailable": "<string>",
"delivery": {
"repository": "<string>",
"contentRoot": "<string>",
"fileExtension": "<string>",
"requiredFrontmatter": [
"<string>"
],
"publicRoutePattern": "<string>"
},
"submit": {
"method": "POST",
"path": "/v1/content",
"body": {
"opportunityId": "<string>",
"bundleId": "<string>",
"article": {
"title": "<string>",
"metaDescription": "<string>",
"slug": "<string>",
"keywords": [
"<string>"
],
"bodyMarkdown": "<string>"
}
}
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Opportunities
The brief to write an article from
Everything an agent needs to write the article: the opportunity, the prompts it answers, the brand voice, the research sources, the article plan, the frontmatter the GitHub destination requires, and the exact POST /v1/content body to store the result. The first read researches and plans the article, which is included in the plan at no credit cost (creditsCharged is 0), and takes 30 to 60 seconds, so use a client timeout of at least 90 s. Every later read returns the stored plan in under a second. While one read writes the plan, concurrent first reads answer 409; read again shortly. Requires a paid plan. To act on the Plan, start from GET /v1/actions: an opportunity is the article behind a new_page action.
GET
/
v1
/
opportunities
/
{opportunityId}
/
brief
The brief to write an article from
curl --request GET \
--url https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/opportunities/{opportunityId}/brief")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"opportunityId": "<string>",
"kind": "create_page",
"title": "<string>",
"rationale": "<string>",
"topic": "<string>",
"persona": "<string>",
"intent": "<string>",
"targetPrompts": [
"<string>"
],
"voice": {
"brand": {
"name": "<string>",
"positioning": "<string>",
"audience": "<string>",
"productDescription": "<string>",
"tone": "<string>",
"contentStyle": "<string>",
"excludedTopics": [
"<string>"
]
},
"language": {
"code": "<string>",
"name": "<string>",
"nativeName": "<string>",
"country": "<string>"
}
},
"research": {
"evidenceBundleId": "<string>",
"sources": [
{
"url": "<string>",
"facts": [
"<string>"
]
}
]
},
"articlePlan": {
"title": "<string>",
"intent": "<string>",
"persona": "<string>",
"angle": "<string>",
"evidenceIds": [
"<string>"
],
"outline": [
{
"heading": "<string>",
"intent": "<string>",
"evidenceIds": [
"<string>"
]
}
]
},
"creditsCharged": 123,
"planUnavailable": "<string>",
"delivery": {
"repository": "<string>",
"contentRoot": "<string>",
"fileExtension": "<string>",
"requiredFrontmatter": [
"<string>"
],
"publicRoutePattern": "<string>"
},
"submit": {
"method": "POST",
"path": "/v1/content",
"body": {
"opportunityId": "<string>",
"bundleId": "<string>",
"article": {
"title": "<string>",
"metaDescription": "<string>",
"slug": "<string>",
"keywords": [
"<string>"
],
"bodyMarkdown": "<string>"
}
}
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Authorizations
Response
The brief.