Skip to main content

Notes

Support Team - Swipe One avatar
Written by Support Team - Swipe One
Updated over 2 months ago

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

x-api-key

string

Yes

Your API key for authentication.

Request Parameters

Parameter

Type

Location

Required

Description

contactId

string

path

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

title

string

Yes

The title of the note.

content

string

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

400

Missing required fields (title, content, workspaceId, or contactId).

401

Unauthorized – API key is missing or invalid.

500

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

404

Contact not found.

401

Unauthorized – API key is missing or invalid.

500

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

404

Note not found.

401

Unauthorized – API key is missing or invalid.

500

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

x-api-key

string

Yes

Your API key for authentication.

Request Parameters

Parameter

Type

Location

Required

Description

workspaceId

string

path

Yes

The unique ID of the workspace.

page

integer

query

No

Page number for pagination (default: 1).

limit

integer

query

No

Number of notes per page (default: 10).

search

string

query

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

400

Invalid input parameters.

401

Unauthorized – API key is missing or invalid.

404

Workspace not found.

500

Internal server error.

Example Error Response (400)

{
"status": "fail",
"message": "Invalid input parameters"
}

Notes

  • Supports pagination using page and limit parameters.

  • The search parameter allows filtering notes based on their title.

  • Ensure that the workspaceId provided exists in the system​s.


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

x-api-key

string

Yes

Your API key for authentication.

Request Parameters

Parameter

Type

Location

Required

Description

noteId

string

path

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

title

string

No

Updated title of the note.

content

string

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

404

Note not found.

400

Invalid input.

401

Unauthorized – API key is missing or invalid.

500

Internal server error.

Notes

  • Supports partial updates; only include fields that need modification.

  • Ensure that the noteId exists before making the request

Did this answer your question?