API KeysNgười dùng

User

Lấy thông tin tài khoản và danh sách ghi chú bằng API Key.


User

User API cho phép bạn:

  • Lấy thông tin tài khoản đang sở hữu API Key.
  • Lấy danh sách ghi chú của tài khoản đó.
  • Lọc, sắp xếp và phân trang danh sách ghi chú.

Base URL:

https://api.notexapp.com

Gửi API Key trong header X-API-Key:

-H "X-API-Key: ntx_live_..."

Mọi dữ liệu trả về đều thuộc tài khoản đã tạo API Key đang được sử dụng.

Response format

Các endpoint trong tài liệu này sử dụng response wrapper chung:

interface ApiResponse<T> {
  statusCode: number;
  message?: string;
  data: T;
}

Get profile

GET /v1/user/profile

Lấy thông tin tài khoản đang được API Key đại diện.

Endpoint này hữu ích khi bạn cần:

  • Kiểm tra API Key thuộc tài khoản nào.
  • Hiển thị thông tin người dùng trong hệ thống tích hợp.
  • Đọc các thiết lập ngôn ngữ của tài khoản.

Request

Endpoint không yêu cầu query parameter hoặc request body.

curl https://api.notexapp.com/v1/user/profile \
  -H "X-API-Key: ntx_live_..."

Example response

{
  "statusCode": 200,
  "data": {
    "user_id": "665f...",
    "email": "user@example.com",
    "name": "Jane Doe",
    "image": "https://cdn.notexapp.com/avatars/...",
    "role": "normal_user",
    "preferences": {
      "display_language": "en",
      "transcription_language": "en",
      "ai_notes_language": "en"
    },
    "createdAt": "2026-01-01T00:00:00Z"
  }
}

Response fields

FieldTypeDescription
user_idstringID của tài khoản Notex
emailstringĐịa chỉ email của tài khoản
namestringTên hiển thị của người dùng
imagestring | nullURL ảnh đại diện
rolestringVai trò hiện tại của tài khoản
preferencesobjectCác thiết lập ngôn ngữ của người dùng
createdAtstringThời điểm tạo tài khoản theo ISO 8601 UTC

Preferences

FieldTypeDescription
display_languagestringNgôn ngữ hiển thị trên Notex
transcription_languagestringNgôn ngữ mặc định khi phiên âm
ai_notes_languagestringNgôn ngữ mặc định của ghi chú do AI tạo

TypeScript types


List my notes

GET /v2/user/notes

Lấy danh sách ghi chú thuộc tài khoản đang sử dụng API Key.

Endpoint hỗ trợ:

  • Lọc theo loại ghi chú.
  • Lọc theo tab.
  • Sắp xếp danh sách.
  • Phân trang theo số trang hoặc cursor.

Request

Ví dụ lấy 20 ghi chú mới nhất:

curl "https://api.notexapp.com/v2/user/notes?limit=20&sort_field=createdAt&sort_order=-1" \
  -H "X-API-Key: ntx_live_..."

Query parameters

ParameterTypeRequiredDescription
typestringNoLọc theo loại ghi chú, ví dụ youtube, pdf, audio, website
tabstringNoLọc theo tab, ví dụ summary, transcript, mindmap
limitnumberNoSố ghi chú tối đa trong một trang
cursorstringNoCursor được trả về từ request trước
pagenumberNoSố trang cần lấy
sort_fieldstringNoTrường dùng để sắp xếp, ví dụ createdAt, updatedAt, title
sort_order1 | -1No1 tăng dần, -1 giảm dần

Common examples

Lọc theo loại ghi chú

curl "https://api.notexapp.com/v2/user/notes?type=pdf&limit=20" \
  -H "X-API-Key: ntx_live_..."

Sắp xếp mới nhất trước

curl "https://api.notexapp.com/v2/user/notes?sort_field=createdAt&sort_order=-1" \
  -H "X-API-Key: ntx_live_..."

Lấy trang tiếp theo bằng cursor

curl "https://api.notexapp.com/v2/user/notes?limit=20&cursor=<next_cursor>" \
  -H "X-API-Key: ntx_live_..."

Hãy sử dụng nguyên giá trị next_cursor được trả về từ request trước. Không tự chỉnh sửa cursor.

Note fields

Mỗi ghi chú trong danh sách có thể chứa các field sau:

FieldTypeDescription
note_idstringID duy nhất của ghi chú
titlestringTiêu đề ghi chú
folder_idstring | nullID thư mục, hoặc null nếu ghi chú nằm ở root
typestringLoại ghi chú
durationnumberThời lượng tính bằng giây, nếu có
short_summarystringNội dung tóm tắt ngắn
is_publicbooleanGhi chú có đang công khai hay không
is_password_protectedbooleanGhi chú có được bảo vệ bằng mật khẩu hay không
share_linkstring | nullĐường dẫn chia sẻ, nếu có
createdAtstringThời điểm tạo theo ISO 8601 UTC
updatedAtstringThời điểm cập nhật gần nhất theo ISO 8601 UTC

Pagination fields

Tùy theo cơ chế phân trang, response có thể bao gồm:

FieldTypeDescription
notesNoteItem[]Danh sách ghi chú
total_notesnumberTổng số ghi chú
next_cursorstring | nullCursor của trang tiếp theo
has_morebooleanCó còn dữ liệu ở trang sau hay không
pagenumberTrang hiện tại
limitnumberSố item trên mỗi trang

TypeScript types

Pagination

API hỗ trợ hai kiểu phân trang:

KiểuParametersPhù hợp khi
Page-basedpage, limitCần điều hướng đến một trang cụ thể
Cursor-basedcursor, limitTải tiếp danh sách hoặc infinite scroll

Không nên truyền đồng thời pagecursor trong cùng một request.

Notes

  • Chỉ gọi API từ backend hoặc server được kiểm soát.
  • Không đưa API Key vào frontend hoặc mã nguồn công khai.
  • Dùng sort_order=-1 để lấy ghi chú mới nhất trước.
  • Các field tùy chọn có thể không xuất hiện trong mọi ghi chú.
  • Giá trị hợp lệ của typetab phụ thuộc vào các loại nội dung Notex đang hỗ trợ.