Skip to main content

Specs (Architect)

Search specifications

Search original specification inputs with a case-insensitive regular expression.

gethttps://api.pre.dev/find-specsTry it

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'
QueryMatches
paymentInputs containing payment, case-insensitively
^BuildInputs starting with Build
export|reportInputs 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

StatusWhen
400query is missing or empty
401Missing or invalid key, or a personal key without a paid plan
500The 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}
GET
/find-specs

Authorization

AuthorizationBearer <token>

Your pre.dev workspace API key (pdk_...) from Integrations, Built-in tab: https://pre.dev/projects/integrations?tab=built-in

In: header

Query Parameters

query*string

Case-insensitive regular expression matched against spec input. Invalid syntax returns 500.

Length1 <= length
limit?integer
Range1 <= value <= 100
Default20
skip?integer
Range0 <= value
Default0
endpoint?string

Value in

  • "fast_spec"
  • "deep_spec"
status?string

Value in

  • "pending"
  • "processing"
  • "completed"
  • "failed"

Response Body

application/json

Paginated spec summaries.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

application/json

application/json

application/json

Was this page helpful?