Specs (Architect)
Search specifications
Search original specification inputs with a case-insensitive regular expression.
Pass the required query parameter as a regular expression. Search applies to the original input text, not the generated specification body.
curl --fail-with-body --get https://api.pre.dev/find-specs \
-H "Authorization: Bearer $PREDEV_API_KEY" \
--data-urlencode 'query=export|report' \
--data-urlencode 'status=completed' \
--data-urlencode 'limit=20'| Query | Matches |
|---|---|
payment | Inputs containing payment, case-insensitively |
^Build | Inputs starting with Build |
export|report | Inputs containing either word |
Use --data-urlencode or your HTTP library’s query encoder so regex characters reach the API intact. Escape regex metacharacters when you intend a literal search.
The specs, total, and hasMore envelope uses the same summary format and pagination as list specifications. Use spec status for full bodies.
Errors
| Status | When |
|---|---|
400 | query is missing or empty |
401 | Missing or invalid key, or a personal key without a paid plan |
500 | The regular expression is invalid, or an unexpected error. Correct the pattern instead of retrying it |
Each status has an example body in the response examples. See errors and retries.
curl -X GET "https://api.pre.dev/find-specs?query=string"fetch("https://api.pre.dev/find-specs?query=string", { method: "GET"})package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.pre.dev/find-specs?query=string" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}import requestsurl = "https://api.pre.dev/find-specs?query=string"response = requests.request("GET", url)print(response.text)import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.http.HttpResponse.BodyHandlers;import java.time.Duration;HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build();HttpRequest.Builder requestBuilder = HttpRequest.newBuilder() .uri(URI.create("https://api.pre.dev/find-specs?query=string")) .GET() .build();try { HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString()); System.out.println("Status code: " + response.statusCode()); System.out.println("Response body: " + response.body());} catch (Exception e) { e.printStackTrace();}using System;using System.Net.Http;using System.Text;var client = new HttpClient();var response = await client.GetAsync("https://api.pre.dev/find-specs?query=string");var responseBody = await response.Content.ReadAsStringAsync();use reqwest::{Result, Client};async fn main() -> Result<()> { let client = Client::new(); let url = "https://api.pre.dev/find-specs?query=string"; let res = client .get(url) .send() .await? .text() .await?; println!("{}", res); Ok(())}{ "specs": [ { "_id": "507f1f77bcf86cd799439011", "endpoint": "deep_spec", "status": "completed", "success": true, "input": "Add Stripe billing to the task manager." } ], "total": 1, "hasMore": false}Your pre.dev workspace API key (pdk_...) from Integrations, Built-in tab: https://pre.dev/projects/integrations?tab=built-in
In: header
Query Parameters
Case-insensitive regular expression matched against spec input. Invalid syntax returns 500.
1 <= length1 <= value <= 100200 <= value0Value in
- "fast_spec"
- "deep_spec"
Value in
- "pending"
- "processing"
- "completed"
- "failed"
Response Body
application/json
Paginated spec summaries.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Invalid request.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Missing, invalid, or ineligible authentication.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Access or trial eligibility denied.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Request failed.
TypeScript Definitions
Use the response body type in TypeScript.