Get Spec
Monitor the progress of asynchronous specification processing requests.
Documentation Index
Fetch the complete documentation index at: https://docs.pre.dev/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/spec-status/:specId
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
| Parameter | Location | Required | Description |
|---|---|---|---|
specId | Path | ✅ | Spec ID returned from async spec processing |
Example Request
specId in the URL is the value returned as specId from the async spec generation request.Response
Pending
Processing
Completed
Failed
Response Fields
| Field | Type | Description |
|---|---|---|
_id | string | MongoDB ObjectId of the spec request |
created | string | ISO timestamp when the request was created |
endpoint | string | Which endpoint was used: "fast_spec" or "deep_spec" |
input | string | Original input text provided |
status | string | Current status: "pending", "processing", "completed", or "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 | URL where the human-readable spec is hosted - downloadable markdown (only when completed) |
totalHumanHours | number | Estimated total hours for a human to implement the spec (only when completed) |
architectureInfographicUrl | string | URL to a visual architecture infographic/diagram for the specification (only when completed) |
codingAgentSpecUrl | string | URL where the coding agent spec format is hosted - downloadable markdown (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 | number | Processing time in milliseconds (only when completed or failed) |
predevUrl | string | pre.dev project URL where you can view and edit the spec (only when completed) |
errorMessage | string | Error description (only when failed) |
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 |
progress | number | Overall progress percentage (0-100) |
progressMessage | string | Detailed progress message (e.g., “Generating User Stories…”) |
userFlowGraph | object | User flow graph with nodes (id, label, type, description, level) and edges (source, target, edgeType). Nodes include a numeric level (1, 2, 3…) indicating graph depth for layered rendering (only when completed) |
architectureGraph | object | System architecture graph with nodes (id, label, type, description) and edges (source, target, edgeType). Node type is one of: "frontend", "api-services", "databases", "external-services" (only when completed) |
enrichedTechStack | array | Enriched tech stack items with name, useFor, reason, description, link, helpfulLinks, and alternatives for each technology (only when completed) |
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
| Spec Type | Typical Time | Maximum Expected |
|---|---|---|
| Fast Spec | 30-40 seconds | 2 minutes |
| Deep Spec | 2-3 minutes | 5 minutes |
Error Handling
Common Issues
Spec ID Not Found: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
Back to API Reference
Authorizations
API key for authentication. Get your API key from https://pre.dev/projects/playground (Solo) or https://pre.dev/enterprise/dashboard?page=api (Enterprise). Use format: Bearer YOUR_API_KEY
Path Parameters
The unique ID returned from an async spec generation request
"507f1f77bcf86cd799439011"
Response
Status retrieved successfully
MongoDB ObjectId of the spec request
ISO timestamp when the request was created
Which endpoint was used
fast_spec, deep_spec Original input text provided
Current status
pending, processing, completed, failed Whether the request succeeded
Short URL for uploaded file (if file was uploaded)
Name of uploaded file (if file was uploaded)
URL where the human-readable spec is hosted (only when completed)
Estimated total hours for a human to implement the spec (only when completed)
URL to a visual architecture infographic/diagram for the specification (only when completed)
URL where the coding agent spec format is hosted (only when completed)
Structured JSON spec optimized for AI coding assistants (only when completed)
Markdown spec optimized for AI coding assistants (only when completed)
Full structured JSON spec with hours, personas, and roles (only when completed)
Full markdown spec with all details for human review (only when completed)
Processing time in milliseconds (only when completed or failed)
pre.dev project URL (only when completed)
Array of scraped documentation archives (only when completed). Empty array if no docURLs provided or scraping fails
Error description (only when failed)
Human-readable progress description
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.
User flow graph with nodes representing user stories/flows and edges showing navigation paths (only when completed)
System architecture graph with C1/C2 level nodes and their relationships (only when completed)
Enriched tech stack with detailed reasons, descriptions, and alternatives for each technology (only when completed)

