RAC Body Cam Logo

API Documentation

Upload evidence files programmatically using our REST API

POST
/api/upload

Upload video or image files to receive a unique evidence code. The API accepts multipart/form-data requests with the file and metadata.

Request Parameters

ParameterTypeRequiredDescription
fileFileYesVideo or image file. Supported formats: MP4, MOV, AVI, MPEG, WebM (videos), JPG, JPEG, PNG, GIF, WebP (images)
titleStringYesTitle for the evidence (max 500 characters)
descriptionStringNoOptional description of the evidence (max 2000 characters)

Success Response

{
  "success": true,
  "evidenceCode": "RAC-A1B2-C3D4"
}

Error Response

{
  "success": false,
  "error": "Error message describing what went wrong"
}

Code Examples

curl -X POST https://racbodycam.cloud/api/upload \
  -F "file=@/path/to/your/video.mp4" \
  -F "title=Evidence Title" \
  -F "description=Optional description"

HTTP Status Codes

200
Success
File uploaded successfully
400
Bad Request
Missing required parameters or invalid file type
500
Server Error
Internal server error or database connection issue
504
Timeout
Upload is taking longer than expected. Try a smaller file.

Important Notes

File Size Limits
Maximum file size depends on your hosting plan. For large video files, consider compressing before upload or using chunked uploads.
Evidence Code Format
Evidence codes follow the format: RAC-XXXX-XXXXwhere X is an alphanumeric character. Codes are automatically generated and guaranteed to be unique.
Content-Type
The API automatically detects file types. Only image and video files are accepted. Supported MIME types: image/* and video/*
GET
/api/evidence/[code]

Retrieve evidence information using an evidence code.

URL Parameters

code - The evidence code (e.g., RAC-A1B2-C3D4)

Response

{
  "success": true,
  "evidence": {
    "evidence_code": "RAC-A1B2-C3D4",
    "file_name": "video.mp4",
    "title": "Evidence Title",
    "description": "Description",
    "file_url": "https://...",
    "file_type": "video/mp4",
    "file_size": 1234567,
    "uploaded_at": "2025-01-20T10:30:00Z"
  }
}
POST
/api/report

Report inappropriate evidence content.

Request Body

{
  "evidence_code": "RAC-A1B2-C3D4",
  "reason": "Inappropriate content",
  "details": "Optional additional details"
}

Response

{
  "success": true,
  "message": "Report submitted successfully"
}