Skip to main content

Generation Status

Check the status of a connector generation process.

Get Status

GET /api/connectors/generate/{id}

Authorization

  • Analyst: Required

Response

{
"id": "gen_abc123",
"status": "analyzing",
"current_step": "Analyzing endpoint batch 3 of 5",
"platform_name": "Slack",
"spec_type": "openapi3",
"documentation_url": "https://api.slack.com/methods",
"progress": {
"endpoints_parsed": 45,
"llm_batches_completed": 3,
"llm_batches_total": 5,
"endpoints_kept": 28,
"endpoints_discarded": 12,
"llm_tokens_used": 124000
},
"error_message": null,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:05:00Z"
}

Status Values

StatusDescription
parsingFetching and parsing documentation
analyzingAI analyzing endpoints
reviewReady for analyst review
completedConnector created
failedError occurred

Example Request

curl -X GET "https://api.traces.io/api/connectors/generate/draft_abc123" \
-H "Authorization: Bearer <token>"

Stream Progress (SSE)

GET /api/connectors/generate/{id}/progress

Stream real-time progress updates via Server-Sent Events.

Connection

const eventSource = new EventSource(
'/api/connectors/generate/draft_abc123/progress',
{
headers: {
Authorization: `Bearer ${token}`
}
}
);

eventSource.addEventListener('progress', (event) => {
const data = JSON.parse(event.data);
console.log('Progress:', data.endpoints_parsed);
});

eventSource.addEventListener('endpoint_analyzed', (event) => {
const data = JSON.parse(event.data);
console.log('Endpoint:', data.endpoint_id, data.recommendation);
});

eventSource.addEventListener('completed', (event) => {
const data = JSON.parse(event.data);
console.log('Done! Draft ID:', data.draft_id);
eventSource.close();
});

eventSource.addEventListener('error', (event) => {
const data = JSON.parse(event.data);
console.error('Error:', data.message);
eventSource.close();
});

Event Types

progress

General progress update:

{
"type": "progress",
"endpoints_parsed": 25,
"current_phase": "analyzing"
}

endpoint_analyzed

Individual endpoint analysis result:

{
"type": "endpoint_analyzed",
"endpoint_id": "ep_users_list",
"recommendation": "keep"
}

completed

Generation finished successfully:

{
"type": "completed",
"draft_id": "draft_abc123",
"total_endpoints": 45
}

error

Error occurred:

{
"type": "error",
"message": "Failed to parse documentation: Invalid OpenAPI schema"
}