Create a pull story
curl --request POST \
--url https://pullstory.com/api/v1/stories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "How auth works in this codebase",
"summary": "JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.",
"files": [
{
"path": "src/auth/login.ts",
"role": "Login entry point",
"language": "typescript",
"excerpt": "export async function POST(req) { ... }",
"startLine": 12,
"endLine": 47
}
],
"flow": [
"<string>"
],
"highlights": [
"<string>"
]
}
'import requests
url = "https://pullstory.com/api/v1/stories"
payload = {
"title": "How auth works in this codebase",
"summary": "JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.",
"files": [
{
"path": "src/auth/login.ts",
"role": "Login entry point",
"language": "typescript",
"excerpt": "export async function POST(req) { ... }",
"startLine": 12,
"endLine": 47
}
],
"flow": ["<string>"],
"highlights": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'How auth works in this codebase',
summary: 'JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.',
files: [
{
path: 'src/auth/login.ts',
role: 'Login entry point',
language: 'typescript',
excerpt: 'export async function POST(req) { ... }',
startLine: 12,
endLine: 47
}
],
flow: ['<string>'],
highlights: ['<string>']
})
};
fetch('https://pullstory.com/api/v1/stories', 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://pullstory.com/api/v1/stories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'How auth works in this codebase',
'summary' => 'JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.',
'files' => [
[
'path' => 'src/auth/login.ts',
'role' => 'Login entry point',
'language' => 'typescript',
'excerpt' => 'export async function POST(req) { ... }',
'startLine' => 12,
'endLine' => 47
]
],
'flow' => [
'<string>'
],
'highlights' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pullstory.com/api/v1/stories"
payload := strings.NewReader("{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pullstory.com/api/v1/stories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pullstory.com/api/v1/stories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "brief_0123abcd4567ef89",
"url": "https://pullstory.com/s/brief_0123abcd4567ef89",
"cached": false,
"message": "Another request is already generating this story",
"estimated_seconds": 90,
"duration_seconds": 142,
"scenes": 8,
"title": "How auth works in this codebase",
"error": "Story generation failed. Retry with a smaller brief."
}{
"id": "brief_0123abcd4567ef89",
"url": "https://pullstory.com/s/brief_0123abcd4567ef89",
"cached": false,
"message": "Another request is already generating this story",
"estimated_seconds": 90,
"duration_seconds": 142,
"scenes": 8,
"title": "How auth works in this codebase",
"error": "Story generation failed. Retry with a smaller brief."
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Stories
Create a pull story
Generate a pull story from a structured code brief. Returns immediately
with status: generating on a cache miss. Poll GET /stories/{id}
until status: ready.
Generation can take several minutes depending on brief size.
POST
/
stories
Create a pull story
curl --request POST \
--url https://pullstory.com/api/v1/stories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "How auth works in this codebase",
"summary": "JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.",
"files": [
{
"path": "src/auth/login.ts",
"role": "Login entry point",
"language": "typescript",
"excerpt": "export async function POST(req) { ... }",
"startLine": 12,
"endLine": 47
}
],
"flow": [
"<string>"
],
"highlights": [
"<string>"
]
}
'import requests
url = "https://pullstory.com/api/v1/stories"
payload = {
"title": "How auth works in this codebase",
"summary": "JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.",
"files": [
{
"path": "src/auth/login.ts",
"role": "Login entry point",
"language": "typescript",
"excerpt": "export async function POST(req) { ... }",
"startLine": 12,
"endLine": 47
}
],
"flow": ["<string>"],
"highlights": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'How auth works in this codebase',
summary: 'JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.',
files: [
{
path: 'src/auth/login.ts',
role: 'Login entry point',
language: 'typescript',
excerpt: 'export async function POST(req) { ... }',
startLine: 12,
endLine: 47
}
],
flow: ['<string>'],
highlights: ['<string>']
})
};
fetch('https://pullstory.com/api/v1/stories', 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://pullstory.com/api/v1/stories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'How auth works in this codebase',
'summary' => 'JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.',
'files' => [
[
'path' => 'src/auth/login.ts',
'role' => 'Login entry point',
'language' => 'typescript',
'excerpt' => 'export async function POST(req) { ... }',
'startLine' => 12,
'endLine' => 47
]
],
'flow' => [
'<string>'
],
'highlights' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pullstory.com/api/v1/stories"
payload := strings.NewReader("{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pullstory.com/api/v1/stories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pullstory.com/api/v1/stories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"How auth works in this codebase\",\n \"summary\": \"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis.\",\n \"files\": [\n {\n \"path\": \"src/auth/login.ts\",\n \"role\": \"Login entry point\",\n \"language\": \"typescript\",\n \"excerpt\": \"export async function POST(req) { ... }\",\n \"startLine\": 12,\n \"endLine\": 47\n }\n ],\n \"flow\": [\n \"<string>\"\n ],\n \"highlights\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "brief_0123abcd4567ef89",
"url": "https://pullstory.com/s/brief_0123abcd4567ef89",
"cached": false,
"message": "Another request is already generating this story",
"estimated_seconds": 90,
"duration_seconds": 142,
"scenes": 8,
"title": "How auth works in this codebase",
"error": "Story generation failed. Retry with a smaller brief."
}{
"id": "brief_0123abcd4567ef89",
"url": "https://pullstory.com/s/brief_0123abcd4567ef89",
"cached": false,
"message": "Another request is already generating this story",
"estimated_seconds": 90,
"duration_seconds": 142,
"scenes": 8,
"title": "How auth works in this codebase",
"error": "Story generation failed. Retry with a smaller brief."
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
3 - 140Example:
"How auth works in this codebase"
Required string length:
10 - 2000Example:
"JWT-based auth. Client hits /login, server validates credentials, issues JWT, and stores the session in Redis."
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Required array length:
3 - 7 elementsRequired string length:
3 - 500Maximum array length:
8Required string length:
3 - 200Response
Cached story is ready
Example:
"brief_0123abcd4567ef89"
Available options:
generating, ready, failed Example:
"https://pullstory.com/s/brief_0123abcd4567ef89"
Example:
false
Example:
"Another request is already generating this story"
Example:
90
Example:
142
Example:
8
Example:
"How auth works in this codebase"
Example:
"Story generation failed. Retry with a smaller brief."
⌘I