Skip to content

API Reference

The Check-IA REST API is built with Django REST Framework. All endpoints are prefixed with /api/.

Authentication

Most endpoints require a valid Supabase JWT token in the Authorization header:

Authorization: Bearer <supabase-access-token>

Public endpoints (no auth required) are marked below.

Endpoints

Text Verification

Submit a Fact for Verification

POST /api/submit-fact/

Submit a text claim for AI-powered fact-checking. The analysis runs asynchronously via Celery.

Auth required: Yes

Request body:

Field Type Required Description
texte string Yes The claim to verify
source string No Optional source URL

Response (201 Created):

{
  "id": 1,
  "supabase_user_id": "uuid",
  "user_email": "user@example.com",
  "texte": "...",
  "statut": "en cours",
  "task_id": "celery-task-uuid"
}

Get User Submissions

GET /api/user-submissions/

Returns the authenticated user's submission history.

Auth required: Yes


Image Verification

Verify Image Content

POST /api/verify-image-content/

Upload an image and a claim about it. The AI analyzes whether the image supports the claim.

Auth required: Yes

Request body (multipart/form-data):

Field Type Required Description
image file Yes Image file to verify
claim_text string No Claim about the image

Response (202 Accepted):

{
  "message": "Image verification started",
  "task_id": "celery-task-uuid",
  "status": "EN_COURS"
}

Detect AI-Generated Image

POST /api/detect-ai-image/

Upload an image to determine if it was generated by AI.

Auth required: Yes

Request body (multipart/form-data):

Field Type Required Description
image file Yes Image file to analyze

Response (202 Accepted):

{
  "message": "AI detection started",
  "task_id": "celery-task-uuid",
  "status": "EN_COURS"
}

Get Image Verification History

GET /api/image-verifications/

Returns the authenticated user's image verification history.

Auth required: Yes


Task Status

Check Task Status

GET /api/task-status/<task_id>/

Poll for the status of an async analysis task.

Auth required: Yes

Response:

{
  "state": "SUCCESS",
  "status": "TERMINE",
  "result": { ... }
}

Possible states: PENDING, SUCCESS, FAILURE


Public Endpoints

List Facts

GET /api/facts/

Returns verified facts from the library, ordered by date (newest first).

Auth required: No

List Keywords

GET /api/keywords/

Returns all keywords used to categorize facts.

Auth required: No


Authentication Endpoints

Login

POST /api/auth/login/

Auth required: No

Request body:

Field Type Required
email string Yes
password string Yes

Response: Access token, refresh token, and user info.

Register

POST /api/auth/register/

Auth required: No

Request body:

Field Type Required
email string Yes
password string Yes
first_name string No
last_name string No

Logout

POST /api/auth/logout/

Auth required: Yes

Get Current User

GET /api/auth/user/

Auth required: Yes

Response: Current user ID, email, and metadata.