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"
  }'
const response = await fetch('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'My Daily Reflection',
    content: 'Today I learned about the importance of gratitude in my spiritual journey.',
    status: 'DRAFT'
  })
});

const note = await response.json();
final response = await http.post(
  Uri.parse('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create'),
  headers: {
    'Authorization': 'Bearer $accessToken',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({
    'title': 'My Daily Reflection',
    'content': 'Today I learned about the importance of gratitude in my spiritual journey.',
    'status': 'DRAFT',
  }),
);

final note = jsonDecode(response.body);
{
  "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
}
{
  "error": "At least title or content is required",
  "success": false
}

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..."
const response = await fetch('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=5', {
  headers: {
    'Authorization': `Bearer ${accessToken}`
  }
});

const data = await response.json();
const notes = data.data.notes;
final response = await http.get(
  Uri.parse('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=5'),
  headers: {
    'Authorization': 'Bearer $accessToken',
  },
);

final data = jsonDecode(response.body);
final notes = data['data']['notes'];
{
  "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

POST /notes-save

Update an existing note
Base URL: https://rzqklwfhwqmviintncqh.supabase.co/functions/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 POST https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-save \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "id": "42f688be-1751-4935-8572-78039910b6fe",
    "title": "Updated Reflection",
    "content": "Updated content with new insights."
  }'

Delete Note

DELETE /notes-delete?id=:id

Delete a note
Base URL: https://rzqklwfhwqmviintncqh.supabase.co/functions/v1

Request

id
string
required
Note ID to delete
Authorization
string
required
Bearer token from authentication
curl -X DELETE "https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-delete?id=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
  • Supabase Storage: Notes are stored directly in the Supabase database
  • 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
Supabase is the source of truth for notes.