Create a draft customer request
POST
/api/requests
const url = 'https://example.com/api/requests';const options = { method: 'POST', headers: { cookie: 'better-auth.session_token=<better-auth.session_token>', 'Content-Type': 'application/json' }, body: '{"customerName":"example","customerText":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/requests \ --header 'Content-Type: application/json' \ --cookie better-auth.session_token=<better-auth.session_token> \ --data '{ "customerName": "example", "customerText": "example" }'Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Raw customer request text for mocked requirement extraction.
Media type application/json
Draft request input accepted by the mocked intake boundary.
object
customerName
string
customerText
string
Example generated
{ "customerName": "example", "customerText": "example"}Responses
Section titled “ Responses ”A mocked request object with extracted requirements.
Media type application/json
object
request
required
Raw customer request captured at intake.
object
id
required
string
customerId
required
string | null
rawText
required
string
source
required
string
Example
{ "request": { "id": "request-demo-001" }}The request body could not be parsed or validated.
Media type application/json
Standard API error payload.
object
error
required
object
code
required
string
message
required
string
issues
Array<string>
Example generated
{ "error": { "code": "example", "message": "example", "issues": [ "example" ] }}No valid Better Auth session was present.
Media type application/json
Returned when no valid Better Auth session is present.
object
error
required
string
Example generated
{ "error": "example"}