PATCH /api/documents//rename
Updates the filename of an existing document. This only changes the stored filename metadata, not the physical file on disk.Authentication
This endpoint requires authentication using Laravel Sanctum. Include the bearer token in the Authorization header.Path parameters
The ID of the document to rename
Headers
Bearer token obtained from login endpoint
Set to
application/jsonSet to
application/jsonBody parameters
The new filename for the documentValidation rules:
- Required
- Must be a string
- Maximum length: 255 characters
Authorization
Users can only rename their own documents. Attempting to rename another user’s document will return a 404 error.Response
Returns a success message and the updated document object.Success message confirming the rename operation
The updated document object
Unique identifier for the document
ID of the user who owns the document
Updated filename of the document
MIME type of the document
Storage path of the document file (unchanged)
Processing status of the document
ID of the vector representation in the vector database
ISO 8601 timestamp when the document was created
ISO 8601 timestamp when the document was last updated
Renaming a document only updates the filename metadata. The physical file path and storage location remain unchanged.
Example request
Example response
200 - Success
401 - Unauthorized
404 - Not found
422 - Validation error
422 - Filename too long