Skip to main content
POST
/
v1
/
context
/
ask
Ask AI a question
curl --request POST \
  --url https://app.nex.ai/api/developers/v1/context/ask \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "query": "What's the status with techflow.io?"
}
EOF
{
  "answer": "Based on the available context, techflow.io appears to be a technology company. Marcus Rodriguez from techflow.io expressed interest in booking a demo on LinkedIn.",
  "entities_considered": [
    {
      "id": 25339323448557880,
      "name": "TechFlow",
      "type": "COMPANY",
      "reason": "Direct match for techflow.io domain",
      "insights_matched": 3,
      "score": 0.95
    },
    {
      "id": 25339323448557884,
      "name": "Marcus Rodriguez",
      "type": "PERSON",
      "reason": "Associated with TechFlow, recent LinkedIn activity",
      "insights_matched": 2,
      "score": 0.87
    }
  ],
  "signals_used": [
    {
      "insight_id": 38485049540083710,
      "entity_id": 25339323448557884,
      "content": "Marcus Rodriguez commented on LinkedIn: Would love to book a demo",
      "score": 0.92,
      "type": "social_activity"
    },
    {
      "insight_id": 38485049540083710,
      "entity_id": 25339323448557880,
      "content": "TechFlow is a SaaS platform for workflow automation",
      "score": 0.88,
      "type": "company_info"
    }
  ],
  "metadata": {
    "query_type": "entity_specific",
    "total_entities_searched": 156,
    "confidence": 0.89
  }
}

Authorizations

Authorization
string
header
required

API key for authentication (format: "Bearer YOUR_API_KEY")

Body

application/json

Natural language query - can be about specific entities, multiple entities, or general workspace questions

query
string
required

Natural language query - supports single entity questions (e.g., 'What's the status with techflow.io?'), multi-entity questions (e.g., 'Compare engagement levels of Acme Corp and TechFlow'), or general workspace questions (e.g., 'Which deals are most likely to close this quarter?')

Response

Query response with relevant information

answer
string

AI-generated response to the query based on available workspace context

entities_considered
object[]

Entities that were analyzed to generate the answer

signals_used
object[]

Specific signals/insights used to generate the answer

metadata
object

Query processing metadata