Skip to content

Create Answer

POST
/v1/answers
curl --request POST \
--url https://api.uavcrew.ai/v1/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "question": "example", "context": { "page": "example" }, "history": [ { "question": "example", "answer": "example" } ] }'

Answer one question from the FAA regulatory corpus.

context.page is an untrusted framing hint (e.g. which explainer page the user is on); it filters nothing. The response’s sources list is assembled from the corpus lookups actually performed.

Media typeapplication/json
AnswerRequest
object
question
required
Question
string
>= 3 characters <= 2000 characters
context
Any of:
AnswerContext

Untrusted rendering hint from the caller’s site.

page biases framing only (“the user is on the Part 107 page”) — it filters nothing, so a forged hint can only ever yield regulatory answers from the public corpus.

object
page
Any of:
string
<= 60 characters
history
Any of:
Array<object>
<= 8 items
HistoryTurn

One prior Q&A pair, resent by the caller to give follow-ups context.

The endpoint stays stateless: the caller owns the thread and decides how much history (and therefore prompt cost) to resend.

object
question
required
Question
string
<= 1000 characters
answer
required
Answer
string
<= 4000 characters

Example generated

{
"question": "example",
"context": {
"page": "example"
},
"history": [
{
"question": "example",
"answer": "example"
}
]
}

Successful Response

Media typeapplication/json
AnswerResponse
object
answer
required
Answer
string
sources
required
Sources
Array<object>
Source

One corpus source actually consulted during the answer.

object
type
required
Type
string
citation
Any of:
string
reference
Any of:
string
status
Any of:
string
url
Any of:
string
thinking
Any of:
string

Example generated

{
"answer": "example",
"sources": [
{
"type": "example",
"citation": "example",
"reference": "example",
"status": "example",
"url": "example"
}
],
"thinking": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}