Skip to main content

Notes API

Create Note

POST /notes-create

Create a new personal note
Base URL: https://rzqklwfhwqmviintncqh.supabase.co/functions/v1

Request

Authorization
string
required
Bearer token from authentication
Content-Type
string
required
application/json
title
string
Note title (optional, but title or content required)
content
string
Note content (optional, but title or content required)
status
string
default:"DRAFT"
Note status: DRAFT or PUBLISHED

Response

message
string
Success message
success
boolean
Request success indicator
data
object
curl -X POST https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Daily Reflection",
    "content": "Today I learned about the importance of gratitude in my spiritual journey.",
    "status": "DRAFT"
  }'
{
  "message": "Note created successfully",
  "data": {
    "id": "42f688be-1751-4935-8572-78039910b6fe",
    "title": "My Daily Reflection",
    "content": "Today I learned about the importance of gratitude in my spiritual journey.",
    "status": "DRAFT",
    "createdBy": "f9cc094c-ba9c-4a0a-82b9-e40d589e97db",
    "createdAt": "2025-10-14T07:19:33.294Z",
    "updatedAt": "2025-10-14T07:19:33.294Z"
  },
  "success": true
}

Fetch Notes

GET /notes-fetch

Retrieve user’s personal notes with pagination

Request

Authorization
string
required
Bearer token from authentication
limit
number
default:"10"
Maximum number of notes to return (1-100)
offset
number
default:"0"
Number of notes to skip for pagination

Response

message
string
Success message
success
boolean
Request success indicator
data
object
curl -X GET "https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=5&offset=0" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "message": "Notes fetched successfully",
  "data": {
    "notes": [
      {
        "id": "f1e7a5ad-d405-46b3-a776-90da44252662",
        "title": "Morning Prayer",
        "content": "Grateful for this new day and the opportunities it brings.",
        "status": "DRAFT",
        "createdBy": "f9cc094c-ba9c-4a0a-82b9-e40d589e97db",
        "createdAt": "2025-10-14T09:33:33.348Z",
        "updatedAt": "2025-10-14T09:33:33.348Z"
      },
      {
        "id": "15206eac-f9b0-4bb7-9ca1-be9dc254634b",
        "title": "Bible Study Notes",
        "content": "Key insights from today's reading in Psalms.",
        "status": "PUBLISHED",
        "createdBy": "f9cc094c-ba9c-4a0a-82b9-e40d589e97db",
        "createdAt": "2025-10-14T08:31:27.705Z",
        "updatedAt": "2025-10-14T08:31:27.705Z"
      }
    ],
    "pagination": {
      "total": 2,
      "limit": 5,
      "offset": 0,
      "hasMore": false
    },
    "userId": "f9cc094c-ba9c-4a0a-82b9-e40d589e97db"
  },
  "success": true
}

Update Note

PUT /note/update/:id

Update an existing note (Backend endpoint)
Base URL: https://api.graceministries.online/api/v1

Request

id
string
required
Note ID to update
Authorization
string
required
Bearer token from authentication
Content-Type
string
required
application/json
title
string
Updated note title
content
string
Updated note content
status
string
Updated note status (DRAFT or PUBLISHED)
curl -X PUT https://api.graceministries.online/api/v1/note/update/42f688be-1751-4935-8572-78039910b6fe \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Reflection",
    "content": "Updated content with new insights."
  }'

Delete Note

DELETE /note/delete/:id

Delete a note (Backend endpoint)
Base URL: https://api.graceministries.online/api/v1

Request

id
string
required
Note ID to delete
Authorization
string
required
Bearer token from authentication
curl -X DELETE https://api.graceministries.online/api/v1/note/delete/42f688be-1751-4935-8572-78039910b6fe \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Privacy & Security

Privacy Protection: All notes endpoints automatically filter results to show only notes belonging to the authenticated user. Users cannot access other users’ notes.

Security Features

  • JWT Validation: All requests require valid authentication tokens
  • User Isolation: Notes are filtered by the authenticated user’s ID extracted from JWT
  • Dual Storage: Notes are stored in both primary database and Supabase for redundancy
  • Input Validation: All input is validated and sanitized

Data Flow

Error Codes

Status CodeErrorDescription
400Bad RequestMissing required fields or invalid data
401UnauthorizedInvalid or missing authentication token
404Not FoundNote not found or doesn’t belong to user
500Internal Server ErrorServer error occurred
Notes are automatically backed up to both your primary PostgreSQL database and Supabase for maximum data reliability.