Skip to content

AVF Status

Check the processing status and retrieve results for a previously submitted AVF inference request. This endpoint supports both regular JSON responses and Server-Sent Events (SSE) for real-time updates.

Endpoint

GET /api-gateway/avf/status/:request_id

Authentication

Requires a valid JWT token in the Authorization header.

Authorization: Bearer <your-jwt-token>

Path Parameters

ParameterTypeDescription
request_idstringThe unique request ID returned from the AVF Infer endpoint

Example Request

Terminal window
curl -N 'https://api.biometrysolutions.com/api-gateway/avf/status/246fcaf1-0c88-4b21-a96c-05cabefcef55' \
-H 'Authorization: Bearer <your-jwt-token>'

Response Behaviour

The endpoint behaviour depends on the request status:

If already completed or failed: Returns a standard JSON response immediately.

If still processing: Establishes an SSE connection and streams status updates until completion or timeout.

JSON Response (Completed)

Status: 200 OK

{
"request_id": "246fcaf1-0c88-4b21-a96c-05cabefcef55",
"project_id": "your-project",
"source_filename": "video.mp4",
"status": "completed",
"created_at": 1763007610,
"completed_at": 1763008367,
"result": {
"success": true,
"message": "Inference completed successfully",
"prediction": "fake",
"confidence": 1.35,
"score": 1.35,
"metadata": {
"video_path": "/tmp/avf_4ps32fdq/video.mp4",
"sequence_length": 50,
"video_frames": 134,
"request_id": "246fcaf1-0c88-4b21-a96c-05cabefcef55",
"source_filename": "video.mp4"
}
}
}

SSE Response (Processing)

When the request is still being processed, the endpoint streams status updates:

data: {"request_id":"246fcaf1-0c88-4b21-a96c-05cabefcef55","status":"pending","created_at":1763007610}
data: {"request_id":"246fcaf1-0c88-4b21-a96c-05cabefcef55","status":"completed","result":{...}}

Response Fields

FieldTypeDescription
request_idstringUnique identifier for the request
project_idstringYour project identifier
source_filenamestringOriginal filename of the uploaded video
statusstringCurrent status: pending, processing, completed, or failed
created_atnumberUnix timestamp when request was created
completed_atnumberUnix timestamp when processing completed (only present when completed)
resultobjectAnalysis results (only present when completed)
result.predictionstringClassification: real or fake
result.confidencenumberConfidence score
result.scorenumberNumerical forgery score

Status Values

StatusDescription
pendingRequest received, queued for processing
processingVideo is currently being analysed
completedAnalysis finished successfully
failedAnalysis failed (check error message)

Error Responses

StatusDescription
401 UnauthorizedMissing or invalid JWT token
404 Not FoundRequest ID not found
500 Internal Server ErrorServer error

Timeout

  • SSE connections timeout after 5 minutes
  • Processing typically completes within 1-2 minutes

Client Implementation Tips

  1. For web clients: Use the EventSource API to handle SSE streams
  2. For mobile/backend: Poll every 2-5 seconds if SSE is not supported
  3. Always handle: Both immediate JSON responses and SSE streams
// JavaScript example using EventSource
const eventSource = new EventSource(
'https://api.biometrysolutions.com/api-gateway/avf/status/request-id',
{ headers: { 'Authorization': 'Bearer token' } }
);
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.status === 'completed') {
console.log('Result:', data.result);
eventSource.close();
}
};