Create Note
Create a new encrypted note for the authenticated user. Note content is automatically encrypted before storage.
POST
https://api-v3.sweeppea.com/notes/create
Description
This endpoint creates a new note for the authenticated user. The note content is automatically encrypted using AES-256-CBC encryption before being stored in the database. Each note is assigned a unique NoteToken (UUID v4) for identification.
Authentication
This endpoint requires Bearer token authentication via the Authorization header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
Title |
String | Yes | Note title (max 100 characters) |
Note |
String | Yes | Note content (max 100,000 characters, will be encrypted) |
Pinned |
Boolean | No | Pin note to top (default: false) |
Code Examples
curl -X POST "https://api-v3.sweeppea.com/notes/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Title": "My Important Note",
"Note": "This is the content of my note that will be encrypted",
"Pinned": false
}'
const response = await fetch('https://api-v3.sweeppea.com/notes/create', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Title: 'My Important Note',
Note: 'This is the content of my note that will be encrypted',
Pinned: false
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api-v3.sweeppea.com/notes/create"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"Title": "My Important Note",
"Note": "This is the content of my note that will be encrypted",
"Pinned": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Response
{
"Response": true,
"Message": "Note Created Successfully",
"Data": {
"NoteToken": "uuid-v4-string",
"Title": "My Important Note",
"CreationDate": "2026-01-16T11:49:43.140Z",
"Pinned": false
}
}
Error Responses
{
"Response": false,
"Message": "Missing Required Fields: Title and Note are required",
"Help": {
"ExpectedBody": {
"Title": "string (required) \u2014 note title, max 100 characters. Must be unique in your account",
"Note": "string (required) \u2014 note body, max 100,000 characters",
"Pinned": "boolean (optional) \u2014 pin the note to the top of the list"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Title Exceeds Maximum Length of 100 Characters",
"Help": {
"ExpectedBody": {
"Title": "string (required) \u2014 note title, max 100 characters. Must be unique in your account",
"Note": "string (required) \u2014 note body, max 100,000 characters",
"Pinned": "boolean (optional) \u2014 pin the note to the top of the list"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Note Exceeds Maximum Length of 100000 Characters",
"Help": {
"ExpectedBody": {
"Title": "string (required) \u2014 note title, max 100 characters. Must be unique in your account",
"Note": "string (required) \u2014 note body, max 100,000 characters",
"Pinned": "boolean (optional) \u2014 pin the note to the top of the list"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Note Title Already Exists",
"Help": {
"ExpectedBody": {
"Title": "string (required) \u2014 note title, max 100 characters. Must be unique in your account",
"Note": "string (required) \u2014 note body, max 100,000 characters",
"Pinned": "boolean (optional) \u2014 pin the note to the top of the list"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Missing or invalid Bearer token. Send your API token in the Authorization header as: Authorization: Bearer YOUR_API_TOKEN",
"Code": 401
}
{
"Response": false,
"Message": "Invalid API token. It does not match any account.",
"Code": 403
}
{
"Response": false,
"Message": "Internal server error. Please try again; if it persists, contact support with the time of this request.",
"Code": 500
}
Important Notes
- ๐ Encryption: Note content is automatically encrypted using AES-256-CBC encryption before storage
- ๐ Unique Identifier: Each note receives a unique NoteToken (UUID v4) for identification
- ๐ Title Limit: Maximum length of 100 characters
- ๐ Content Limit: Maximum length of 100,000 characters
- ๐ซ Unique Titles: Note titles must be unique per user - duplicate titles are not allowed
- ๐ค User Association: Notes are automatically associated with the authenticated user's UserToken
- ๐ Pinned Notes: Pinned notes will appear at the top of the notes list