GET
/
alpha
/
consensus
/
{id}
curl -X GET "https://api.sully.ai/alpha/consensus/consensus_abc123def456" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "data": {
    "id": "consensus_abc123def456",
    "status": "completed",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z",
    "result": {
      "consensus_response": "Based on the clinical presentation of chest pain, shortness of breath, and elevated troponin levels in a 45-year-old patient, the most likely diagnosis is acute myocardial infarction (AMI). However, several differential diagnoses should be considered including pulmonary embolism, aortic dissection, and myocarditis. Immediate ECG and chest X-ray are recommended, along with serial troponin measurements. Consider CT pulmonary angiogram if PE is suspected, and cardiology consultation is recommended."
    },
    "metadata": {}
  }
}

Overview

Retrieve the details and results of a specific medical consensus request using its unique identifier. This endpoint returns the current status of the request and any available consensus results.

Path Parameters

id
string
required
The unique identifier of the consensus request to retrieve

Response

data
object
The consensus request object with current status and results
curl -X GET "https://api.sully.ai/alpha/consensus/consensus_abc123def456" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "data": {
    "id": "consensus_abc123def456",
    "status": "completed",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z",
    "result": {
      "consensus_response": "Based on the clinical presentation of chest pain, shortness of breath, and elevated troponin levels in a 45-year-old patient, the most likely diagnosis is acute myocardial infarction (AMI). However, several differential diagnoses should be considered including pulmonary embolism, aortic dissection, and myocarditis. Immediate ECG and chest X-ray are recommended, along with serial troponin measurements. Consider CT pulmonary angiogram if PE is suspected, and cardiology consultation is recommended."
    },
    "metadata": {}
  }
}

Status Codes

200
OK
Consensus request retrieved successfully
401
Unauthorized
Invalid or missing API key
404
Not Found
Consensus request with the specified ID was not found
500
Internal Server Error
Server error occurred while retrieving the request

Polling for Results

Since consensus requests are processed asynchronously, you may need to poll this endpoint periodically to check for completion:
async function waitForConsensus(consensusId) {
  let status = 'pending';
  
  while (status === 'pending' || status === 'processing') {
    const response = await fetch(`https://api.sully.ai/alpha/consensus/${consensusId}`, {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    });
    
    const data = await response.json();
    status = data.data.status;
    
    if (status === 'completed') {
      return data.data;
    }
    
    if (status === 'failed') {
      throw new Error('Consensus processing failed');
    }
    
    // Wait 5 seconds before polling again
    await new Promise(resolve => setTimeout(resolve, 5000));
  }
}