Skip to main content
GET
Get Spec Status
Check the status of an asynchronous specification processing request.

Overview

When you make an async request ("async": true), use this endpoint to poll for completion status.

Endpoint

Parameters

Example Request

The specId in the URL is the value returned as specId from the async spec generation request.

Response

Pending

Processing

Completed

Failed

Response Fields

Fetching the spec URLs

humanSpecUrl and codingAgentSpecUrl are public short links (https://api.pre.dev/s/...). They need no auth header and return the document directly (markdown, or a zip for bundles):
The same content is also inlined in the response as humanSpecMarkdown / codingAgentSpecMarkdown, so you rarely need to fetch the URLs at all.

Polling Best Practices

Polling Interval

  • Recommended: Poll every 10-15 seconds
  • Minimum: Don’t poll more frequently than every 5 seconds
  • Maximum: No need to poll more than every 30 seconds

Example Polling Script

Python Polling Example

JavaScript Polling Example

Expected Processing Times

Note: Times can vary based on input complexity and system load.

Error Handling

Common Issues

Spec ID Not Found:
Cause: Invalid spec ID or request expired Unauthorized:
Cause: Invalid or missing API key

Best Practices

User Experience

  • Show a loading indicator while polling
  • Display progress messages to users
  • Set a reasonable timeout (e.g., 30 minutes)
  • Provide a way to cancel or retry

Rate Limiting

  • Respect the polling interval recommendations
  • Implement exponential backoff for retries
  • Handle rate limit responses gracefully

Monitoring

  • Log polling attempts for debugging
  • Track completion times for performance monitoring
  • Alert on unusual failure rates

Architect API Overview

View all available API endpoints.

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

API key for authentication. Get your API key from https://pre.dev/projects/key (Solo) or https://pre.dev/enterprise/dashboard?page=api (Enterprise). Use format: Bearer YOUR_API_KEY

Path Parameters

specId
string
required

The unique ID returned from an async spec generation request

Example:

"507f1f77bcf86cd799439011"

Response

Status retrieved successfully

_id
string

MongoDB ObjectId of the spec request

created
string<date-time>

ISO timestamp when the request was created

endpoint
enum<string>

Which endpoint was used

Available options:
fast_spec,
deep_spec
input
string

Original input text provided

status
enum<string>

Current status

Available options:
pending,
processing,
completed,
failed
success
boolean

Whether the request succeeded

uploadedFileShortUrl
string

Short URL for uploaded file (if file was uploaded)

uploadedFileName
string

Name of uploaded file (if file was uploaded)

humanSpecUrl
string<uri>

URL where the human-readable spec is hosted (only when completed)

totalHumanHours
number

Estimated total hours for a human to implement the spec (only when completed)

architectureInfographicUrl
string<uri>

URL to a visual architecture infographic/diagram for the specification (only when completed)

codingAgentSpecUrl
string<uri>

URL where the coding agent spec format is hosted (only when completed)

codingAgentSpecJson
object

Structured JSON spec optimized for AI coding assistants (only when completed)

codingAgentSpecMarkdown
string

Markdown spec optimized for AI coding assistants (only when completed)

humanSpecJson
object

Full structured JSON spec with hours, personas, and roles (only when completed)

humanSpecMarkdown
string

Full markdown spec with all details for human review (only when completed)

executionTime
integer

Processing time in milliseconds (only when completed or failed)

predevUrl
string<uri>

pre.dev project URL (only when completed)

zippedDocsUrls
object[]

Array of scraped documentation archives (only when completed). Empty array if no docURLs provided or scraping fails

errorMessage
string

Error description (only when failed)

progress
number

Completion percentage (0-100) while processing

creditsUsed
number

Total credits consumed by this spec generation. Available in real-time during processing and persisted on completion. Typical values: Fast spec ~5-10, Deep spec ~10-50.

userFlowGraph
object

User flow graph with nodes representing user stories/flows and edges showing navigation paths (only when completed)

architectureGraph
object

System architecture graph with C1/C2 level nodes and their relationships (only when completed)

enrichedTechStack
object[]

Enriched tech stack with detailed reasons, descriptions, and alternatives for each technology (only when completed)

progressMessage
string

Human-readable progress description (e.g. 'Generating architecture...')