Skip to main content

GET /api/documents

Returns a list of all documents uploaded by the authenticated user, ordered by creation date (newest first).

Authentication

This endpoint requires authentication using Laravel Sanctum. Include the bearer token in the Authorization header.

Headers

Authorization
string
required
Bearer token obtained from login endpoint
Accept
string
Set to application/json

Response

Returns an array of document objects.
id
integer
Unique identifier for the document
user_id
integer
ID of the user who owns the document
filename
string
Original filename of the uploaded document
mime_type
string
MIME type of the document (e.g., application/pdf, text/plain)
path
string
Storage path of the document file
status
string
Processing status of the document. Possible values: pending, processing, completed, failed
vector_id
string
ID of the vector representation in the vector database (null until processing completes)
created_at
string
ISO 8601 timestamp when the document was created
updated_at
string
ISO 8601 timestamp when the document was last updated

Example request

curl -X GET https://api.filebright.com/api/documents \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Example response

200 - Success
[
  {
    "id": 1,
    "user_id": 42,
    "filename": "contract.pdf",
    "mime_type": "application/pdf",
    "path": "documents/abc123.pdf",
    "status": "completed",
    "vector_id": "vec_xyz789",
    "created_at": "2026-03-01T10:30:00.000000Z",
    "updated_at": "2026-03-01T10:31:15.000000Z"
  },
  {
    "id": 2,
    "user_id": 42,
    "filename": "notes.txt",
    "mime_type": "text/plain",
    "path": "documents/def456.txt",
    "status": "pending",
    "vector_id": null,
    "created_at": "2026-03-02T14:20:00.000000Z",
    "updated_at": "2026-03-02T14:20:00.000000Z"
  }
]
401 - Unauthorized
{
  "message": "Unauthenticated."
}

Build docs developers (and LLMs) love