Create a Note
Endpoint
POST /contacts/:contactId/notes
Description
This endpoint allows creating a new note associated with a specific contact.
Base URL
https://api.swipeone.com/api
Authentication
Method: API Key Authentication
Header:
x-api-key: {your_api_key}
Headers
Header | Type | Required | Description |
|
| Yes | Your API key for authentication. |
Request Parameters
Parameter | Type | Location | Required | Description |
|
|
| Yes | The unique ID of the contact for which the note is created. |
Request Body
A JSON object containing the note details.
Body Parameters
Parameter | Type | Required | Description |
|
| Yes | The title of the note. |
|
| Yes | The content of the note. |
Example Request
curl -X POST "https://api.swipeone.com/api/contacts/6682840d9286aa59ee3d4181/notes" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Follow-up Call",
"content": "Discussed pricing and features."
}'
Response
Success Response (201)
{
"status": "success",
"data": {
"note": {
"_id": "669b2c93efb8b213a7c72a8e",
"title": "Follow-up Call",
"content": "Discussed pricing and features.",
"contactId": "6682840d9286aa59ee3d4181",
"createdAt": "2024-07-01T10:25:17.813Z"
}
}
}
Error Responses
Status Code | Description |
| Missing required fields (title, content, workspaceId, or contactId). |
| Unauthorized – API key is missing or invalid. |
| Internal server error. |
Retrieve Notes for a Contact
Endpoint
GET /contacts/:contactId/notes
Description
Retrieves a list of notes associated with a specific contact.
Example Request
curl -X GET "https://api.swipeone.com/api/contacts/6682840d9286aa59ee3d4181/notes" \
-H "x-api-key: YOUR_API_KEY"
Response
Success Response (200)
{
"status": "success",
"data": {
"notes": [
{
"_id": "669b2c93efb8b213a7c72a8e",
"title": "Follow-up Call",
"content": "Discussed pricing and features.",
"contactId": "6682840d9286aa59ee3d4181",
"createdAt": "2024-07-01T10:25:17.813Z"
}
]
}
}
Error Responses
Status Code | Description |
| Contact not found. |
| Unauthorized – API key is missing or invalid. |
| Internal server error. |
Retrieve Note by ID
Endpoint
GET /notes/:noteId
Description
Retrieves the details of a specific note using its ID.
Example Request
curl -X GET "https://api.swipeone.com/api/notes/669b2c93efb8b213a7c72a8e" \
-H "x-api-key: YOUR_API_KEY"
Response
Success Response (200)
{
"status": "success",
"data": {
"note": {
"_id": "669b2c93efb8b213a7c72a8e",
"title": "Follow-up Call",
"content": "Discussed pricing and features.",
"contactId": "6682840d9286aa59ee3d4181",
"createdAt": "2024-07-01T10:25:17.813Z"
}
}
}
Error Responses
Status Code | Description |
| Note not found. |
| Unauthorized – API key is missing or invalid. |
| Internal server error. |
Retrieve All Notes (Paginated)
Endpoint
GET /workspaces/:workspaceId/notes
Description
This endpoint retrieves a paginated list of all notes within a specified workspace.
Base URL
https://api.swipeone.com/api
Authentication
Method: API Key Authentication
Header:
x-api-key: {your_api_key}
Headers
Header | Type | Required | Description |
|
| Yes | Your API key for authentication. |
Request Parameters
Parameter | Type | Location | Required | Description |
|
|
| Yes | The unique ID of the workspace. |
|
|
| No | Page number for pagination (default: |
|
|
| No | Number of notes per page (default: |
|
|
| No | Search query to filter notes by title. |
Example Request
curl -X GET "https://api.swipeone.com/api/workspaces/6660175570fbd8a9c22bedfb/notes?page=1&limit=10&search=meeting" \
-H "x-api-key: YOUR_API_KEY"
Response
Success Response (200)
When notes are successfully retrieved:
{
"status": "success",
"data": {
"total": 50,
"page": 1,
"limit": 10,
"notes": [
{
"_id": "669b2c93efb8b213a7c72a8e",
"title": "Follow-up Meeting",
"content": "Discussed project updates and next steps.",
"workspaceId": "6660175570fbd8a9c22bedfb",
"createdBy": {
"id": "user123",
"name": "John Doe"
},
"createdAt": "2024-07-01T10:25:17.813Z"
}
]
}
}
Error Responses
Status Code | Description |
| Invalid input parameters. |
| Unauthorized – API key is missing or invalid. |
| Workspace not found. |
| Internal server error. |
Example Error Response (400)
{
"status": "fail",
"message": "Invalid input parameters"
}
Notes
Supports pagination using
page
andlimit
parameters.The
search
parameter allows filtering notes based on their title.Ensure that the
workspaceId
provided exists in the systems.
Update a Note
Endpoint
PATCH /notes/:noteId
Description
This endpoint updates an existing note.
Authentication
Method: API Key Authentication
Header:
x-api-key: {your_api_key}
Headers
Header | Type | Required | Description |
|
| Yes | Your API key for authentication. |
Request Parameters
Parameter | Type | Location | Required | Description |
|
|
| Yes | The unique ID of the note to update. |
Request Body
A JSON object containing the updated note details.
Body Parameters
Parameter | Type | Required | Description |
|
| No | Updated title of the note. |
|
| No | Updated content of the note. |
Example Request
curl -X PATCH "https://api.swipeone.com/api/notes/669b2c93efb8b213a7c72a8e" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Meeting Notes",
"content": "Added follow-up points and next steps."
}'
Response
Success Response (200)
{
"status": "success",
"data": {
"note": {
"_id": "669b2c93efb8b213a7c72a8e",
"title": "Updated Meeting Notes",
"content": "Added follow-up points and next steps.",
"workspaceId": "6660175570fbd8a9c22bedfb",
"createdBy": {
"id": "user123",
"name": "John Doe"
},
"updatedAt": "2024-07-02T12:30:45.213Z"
}
}
}
Error Responses
Status Code | Description |
| Note not found. |
| Invalid input. |
| Unauthorized – API key is missing or invalid. |
| Internal server error. |
Notes
Supports partial updates; only include fields that need modification.
Ensure that the
noteId
exists before making the request