REST API · Laravel 13
A clean REST API for creating, managing, and attaching files to notes. Paginated lists, search, soft deletes, S3 file storage — all in JSON.
What it does
Full lifecycle
Create, read, update, delete. Paginated lists with full-text search across title and body. 15 per page, query string filtering.
File attachments
Upload jpg, png, or pdf (max 5 MB) to AWS S3 private buckets. Old files cleaned up automatically on replace or delete. IAM roles, no keys.
Recoverable
Notes are soft-deleted by default. Restore them with one call, or permanently delete with S3 file cleanup. Nothing lost by accident.
Form requests
Dedicated request classes validate every input. File type and size limits enforced server-side. Clean error responses.
Consistent JSON
Every response wrapped in Laravel API Resources with proper status codes, pagination meta, and a predictable structure.
EC2 + RDS + S3
Deployed on EC2, MySQL on RDS, files on S3. IAM roles for S3 access — no access keys in environment files.
Get started
Create a note
Upload a file
Search notes
Soft-delete and restore
API Reference
Returns a paginated list of all notes. Use search to filter by title or body.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
| search | string | optional | Filter by title or body |
| page | integer | optional | Page number (default: 1, 15 per page) |
Response 200
{
"data": [{
"id": 1,
"title": "Meeting notes",
"body": "Discussed Q4 targets.",
"file_url": null,
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T06:00:00Z"
}],
"meta": { "total": 1, "per_page": 15, "current_page": 1, "last_page": 1 }
}
Creates a new note. Optionally attach a file (jpg, png, pdf — max 5 MB) stored on S3.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
| title | string | required | Note title (max 255) |
| body | string | required | Note body |
| file | file | optional | Attachment (jpg, png, pdf — max 5 MB) |
Response 201
{
"data": {
"id": 1,
"title": "Meeting notes",
"body": "Discussed Q4 targets.",
"file_url": "https://haseeb-notes-files.s3.eu-north-1.amazonaws.com/notes/1/agenda.pdf",
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T06:00:00Z"
}
}
Returns a single note by ID.
Response 200
{
"data": {
"id": 1,
"title": "Meeting notes",
"body": "Discussed Q4 targets.",
"file_url": null,
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T06:00:00Z"
}
}
Error 404
{ "message": "No query results for model [App\\Models\\Note]." }
Updates title, body, or file. All fields optional. New file replaces old S3 file automatically.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
| title | string | optional | New title |
| body | string | optional | New body |
| file | file | optional | Replacement file |
Response 200
{
"data": {
"id": 1,
"title": "Updated title",
"body": "Updated body.",
"file_url": null,
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T07:00:00Z"
}
}
Soft-deletes a note. Hidden from list but can be restored.
Response 204 No content
Restores a previously soft-deleted note.
Response 200
{
"data": {
"id": 1,
"title": "Meeting notes",
"body": "Discussed Q4 targets.",
"file_url": null,
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T08:00:00Z"
}
}
Permanently deletes a soft-deleted note and removes its S3 file. Cannot be undone.
Response 204 No content
Uploads or replaces the file attachment. Stored on S3 at notes/{id}/{filename}.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
| file | file | required | jpg, png, or pdf — max 5 MB |
Response 200
{
"data": {
"id": 1,
"title": "Meeting notes",
"body": "Discussed Q4 targets.",
"file_url": "https://haseeb-notes-files.s3.eu-north-1.amazonaws.com/notes/1/agenda.pdf",
"deleted_at": null,
"created_at": "2026-09-30T06:00:00Z",
"updated_at": "2026-09-30T09:00:00Z"
}
}
Database
| Column | Type | Description | |
|---|---|---|---|
| id | bigint | PK | Auto-incrementing primary key |
| title | varchar(255) | required | Note title |
| body | text | required | Note body |
| file_url | varchar(255) | nullable | S3 path of attached file |
| created_at | timestamp | Creation time | |
| updated_at | timestamp | Last update | |
| deleted_at | timestamp | nullable | Soft-delete timestamp |