Skip to main content
Communication

Notes

Attach polymorphic notes to any entity with automatic user attribution and timestamp management.

Base URL: /api/v1/notes

Auth required: Yes (auth:api) for all endpoints.

Notes are polymorphic: they belong to any noteable entity (customer, prospect, customer file, contact, etc.). Notes are created by the authenticated user (user_id is auto-set).


Model Properties

Property Type Required Description
id integer auto Unique identifier
user_id integer auto FK to users. Auto-set to the authenticated user on creation
noteable_type string Yes PHP class name of the owning entity (e.g. App\Customer, App\Prospect, App\CustomerFile)
noteable_id integer Yes ID of the owning entity
body text Yes Note content
title string No Optional note title
type string No Note type (enum: call, email, meeting, other). Controls display category
parent_id integer No ID of the parent note (for threaded replies)
task_id integer No FK to tasks. Links this note to a task
priority integer No Priority level (default: 0)
shared boolean No Whether the note is shared externally (default: false = internal only)
by_mail boolean No Whether the note should be sent by email
mail boolean No Whether the note was sent by email
by_sms boolean No Whether the note should be sent by SMS
sms boolean No Whether the note was sent by SMS
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

GET /v1/notes

List all notes for a specific entity.

Query parameters:

Parameter Type Required Description
noteable_type string Yes PHP class name of the entity (e.g. App\Customer)
noteable_id integer Yes ID of the owning entity

Response 200: Array of note objects (note_resource collection).

Examples:

curl -s -X GET "https://your-instance.bluerocktel.net/api/v1/notes?noteable_type=App%5CCustomer&noteable_id=42" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/notes",
    params={"noteable_type": "App\\Customer", "noteable_id": 42},
    headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
notes = response.json()
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://your-instance.bluerocktel.net/api/v1/notes', [
        'noteable_type' => 'App\\Customer',
        'noteable_id' => 42,
    ]);

$notes = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/notes?noteable_type=App%5CCustomer&noteable_id=42",
  {
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
    },
  }
);
const notes = await response.json();

POST /v1/notes

Create a new note for an entity.

Query parameters:

Parameter Type Required Description
noteable_type string Yes PHP class name of the entity
noteable_id integer Yes ID of the owning entity

Body (JSON): Validated via Note::attributes('body'):

Field Type Required Description
body string Yes Note content

user_id is automatically set to the authenticated user.

Response 201: Created note object. Response 422: Validation error.

Examples:

curl -s -X POST "https://your-instance.bluerocktel.net/api/v1/notes?noteable_type=App%5CCustomer&noteable_id=42" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"body": "Customer requested a callback next Monday regarding invoice #1042."}'
import requests

response = requests.post(
    "https://your-instance.bluerocktel.net/api/v1/notes",
    params={"noteable_type": "App\\Customer", "noteable_id": 42},
    headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
    json={"body": "Customer requested a callback next Monday regarding invoice #1042."},
)
note = response.json()
$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://your-instance.bluerocktel.net/api/v1/notes?noteable_type=App%5CCustomer&noteable_id=42', [
        'body' => 'Customer requested a callback next Monday regarding invoice #1042.',
    ]);

$note = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/notes?noteable_type=App%5CCustomer&noteable_id=42",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      body: "Customer requested a callback next Monday regarding invoice #1042.",
    }),
  }
);
const note = await response.json();

GET /v1/notes/{id}

Get a single note by ID.

URL parameters:

Parameter Type Description
id integer Note ID

Response 200: Note object (note_resource). Response 404: Not found.

Examples:

curl -s -X GET "https://your-instance.bluerocktel.net/api/v1/notes/200" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/notes/200",
    headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
note = response.json()
$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://your-instance.bluerocktel.net/api/v1/notes/200');

$note = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/notes/200",
  {
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
    },
  }
);
const note = await response.json();

PUT /v1/notes/{id}

Update a note (body only; id, created_at, updated_at are excluded).

URL parameters:

Parameter Type Description
id integer Note ID

Body (JSON): Validated via Note::attributes('body').

Field Type Required Description
body string Yes Updated note content

Response 201: Updated note object. Response 404: Not found.

Examples:

curl -s -X PUT "https://your-instance.bluerocktel.net/api/v1/notes/200" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"body": "Updated: customer confirmed callback for Tuesday instead."}'
import requests

response = requests.put(
    "https://your-instance.bluerocktel.net/api/v1/notes/200",
    headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
    json={"body": "Updated: customer confirmed callback for Tuesday instead."},
)
note = response.json()
$response = Http::withToken($token)
    ->acceptJson()
    ->put('https://your-instance.bluerocktel.net/api/v1/notes/200', [
        'body' => 'Updated: customer confirmed callback for Tuesday instead.',
    ]);

$note = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/notes/200",
  {
    method: "PUT",
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      body: "Updated: customer confirmed callback for Tuesday instead.",
    }),
  }
);
const note = await response.json();

DELETE /v1/notes/{id}

Delete a note.

URL parameters:

Parameter Type Description
id integer Note ID

Response 200: Success message. Response 404: Not found.

Examples:

curl -s -X DELETE "https://your-instance.bluerocktel.net/api/v1/notes/200" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.delete(
    "https://your-instance.bluerocktel.net/api/v1/notes/200",
    headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
$response = Http::withToken($token)
    ->acceptJson()
    ->delete('https://your-instance.bluerocktel.net/api/v1/notes/200');
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/notes/200",
  {
    method: "DELETE",
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
    },
  }
);