-
Notifications
You must be signed in to change notification settings - Fork 0
API Specification
William Garneau edited this page Oct 7, 2024
·
5 revisions
This document outlines the API specification for the Veri-Fact.ai misinformation detection and mitigation system.
-
Base URL:
https://api.veri-fact.ai/v1
- Authentication: Bearer Token (JWT)
All endpoints require Bearer token authentication unless specified otherwise.
-
POST
/users/
- Auth required: No
- Request Body:
{ "username": "string", "email": "string" }
- Response:
{ "id": "uuid", "username": "string", "email": "string", "auth0_id": "string", "created_at": "timestamp", "last_login": "timestamp" }
-
GET
/users/{user_id}
- Response: Same as Create User response
-
POST
/claims/
- Request Body:
{ "user_id": "uuid", "claim_text": "string", "context": "string" }
- Response:
{ "id": "uuid", "user_id": "uuid", "claim_text": "string", "context": "string", "created_at": "timestamp" }
-
GET
/claims/{claim_id}
- Response: Same as Create Claim response
-
POST
/analysis/
- Request Body:
{ "claim_id": "uuid", "veracity_score": 0.0, "confidence_score": 0.0, "analysis_text": "string" }
- Response:
{ "id": "uuid", "claim_id": "uuid", "veracity_score": 0.0, "confidence_score": 0.0, "analysis_text": "string", "created_at": "timestamp" }
-
GET
/analysis/{analysis_id}
- Response: Same as Create Analysis response
-
POST
/sources/
- Request Body:
{ "analysis_id": "uuid", "url": "string", "title": "string", "snippet": "string", "credibility_score": 0.0 }
- Response:
{ "id": "uuid", "analysis_id": "uuid", "url": "string", "title": "string", "snippet": "string", "credibility_score": 0.0 }
-
GET
/sources/{source_id}
- Response: Same as Create Source response
-
POST
/feedback/
- Request Body:
{ "analysis_id": "uuid", "user_id": "uuid", "rating": 0.0, "comment": "string" }
- Response:
{ "id": "uuid", "analysis_id": "uuid", "user_id": "uuid", "rating": 0.0, "comment": "string", "created_at": "timestamp" }
-
GET
/feedback/{feedback_id}
- Response: Same as Create Feedback response
-
POST
/conversations/
- Request Body:
{ "user_id": "uuid" }
- Response:
{ "id": "uuid", "user_id": "uuid", "start_time": "timestamp", "end_time": "timestamp or null", "status": "string" }
-
GET
/conversations/{conversation_id}
- Response: Same as Create Conversation response
-
POST
/messages/
- Request Body:
{ "conversation_id": "uuid", "sender_type": "string", "content": "string", "claim_id": "uuid or null", "analysis_id": "uuid or null" }
- Response:
{ "id": "uuid", "conversation_id": "uuid", "sender_type": "string", "content": "string", "timestamp": "timestamp", "claim_id": "uuid or null", "analysis_id": "uuid or null" }
-
GET
/messages/{message_id}
- Response: Same as Create Message response
-
GET
/messages/conversation/{conversation_id}
- Response:
[ { "id": "uuid", "conversation_id": "uuid", "sender_type": "string", "content": "string", "timestamp": "timestamp", "claim_id": "uuid or null", "analysis_id": "uuid or null" } ]
-
POST
/domains/
- Request Body:
{ "domain_name": "string", "credibility_score": 0.0, "is_reliable": true, "description": "string or null" }
- Response:
{ "id": "uuid", "domain_name": "string", "credibility_score": 0.0, "is_reliable": true, "description": "string or null", "created_at": "timestamp", "updated_at": "timestamp" }
-
GET
/domains/{domain_id}
- Response: Same as Create Domain response
-
GET
/domains/name/{domain_name}
- Response: Same as Create Domain response
-
PUT
/domains/{domain_id}
- Request Body: Same as Create Domain request
- Response: Same as Create Domain response
-
DELETE
/domains/{domain_id}
- Response:
{ "success": true }
All endpoints can return the following error responses:
- 404 Not Found: When the requested resource is not found.
- 422 Unprocessable Entity: When the request body fails validation.
Error response body:
{
"detail": "Error description"
}
This API specification reflects the current implementation of the misinformation mitigation system's backend, including all endpoints for users, claims, analysis, sources, feedback, conversations, messages, and domains.