Skip to content
MC0RE edited this page Jul 20, 2026 · 3 revisions

Notes

Create, update, list, and delete notes in Teamleader Focus.

Overview

The Notes resource lets you attach text notes to entities in Teamleader. Notes support pagination and optional user notifications on creation.

info() is not supported and throws a BadMethodCallException if called β€” use list() with a subject filter instead. Deletion is supported (since v1.2.8) via delete().

Endpoint

notes

Capabilities

Capability Supported
Pagination βœ… Supported
Filtering βœ… Supported (subject filter only)
Sorting ❌ Not supported
Sideloading ❌ Not supported
Creation βœ… Supported
Update βœ… Supported
Deletion βœ… Supported

Note on info(): Throws BadMethodCallException. Use list() with a subject filter instead.


Methods

list(array $filters = [], array $options = [])

Returns notes for a specific subject. The subject filter is the only supported filter β€” it must include both type and id. An InvalidArgumentException is thrown for an unrecognised subject type.

use McoreServices\TeamleaderSDK\Facades\Teamleader;

// Notes for a company
$notes = Teamleader::notes()->list([
    'subject' => ['type' => 'company', 'id' => 'company-uuid'],
]);

// With pagination
$notes = Teamleader::notes()->list(
    ['subject' => ['type' => 'deal', 'id' => 'deal-uuid']],
    ['page_size' => 50, 'page_number' => 1]
);

create(array $data)

Creates a note. Validates all fields before sending the request.

Required fields:

Field Type Description
subject array Object with type and id
subject.type string Subject type β€” see Subject Types
subject.id string Subject UUID
content string Note text β€” must not be empty

Optional fields:

Field Type Description
notify array Users to notify β€” each entry must be ['type' => 'user', 'id' => '...']

notify only supports type: user β€” passing any other type throws InvalidArgumentException.

$note = Teamleader::notes()->create([
    'subject' => ['type' => 'company', 'id' => 'company-uuid'],
    'content' => 'Follow-up call scheduled for Friday.',
]);

// Attach a note to a meeting (subject type added in v1.2.8)
$note = Teamleader::notes()->create([
    'subject' => ['type' => 'meeting', 'id' => 'meeting-uuid'],
    'content' => 'Client confirmed budget.',
]);

// With user notifications
$note = Teamleader::notes()->create([
    'subject' => ['type' => 'deal', 'id' => 'deal-uuid'],
    'content' => 'Contract signed β€” moving to onboarding.',
    'notify'  => [
        ['type' => 'user', 'id' => 'user-uuid-1'],
        ['type' => 'user', 'id' => 'user-uuid-2'],
    ],
]);

update(mixed $id, array $data)

Updates an existing note. The ID is merged into the request body before posting to notes.update.

content is optional on update but must be non-empty if provided.

Teamleader::notes()->update('note-uuid', [
    'content' => 'Updated note content.',
]);

delete(mixed $id)

Deletes a note (notes.delete). Validates the UUID; returns an empty result (HTTP 204). Added in v1.2.8.

Teamleader::notes()->delete('note-uuid');

Helper Methods

Read helpers

Method Equivalent
forSubject(string $type, string $id, array $options = []) list(['subject' => [...]], $options) with type validation
forCompany(string $id, array $options = []) forSubject('company', $id, $options)
forContact(string $id, array $options = []) forSubject('contact', $id, $options)
forDeal(string $id, array $options = []) forSubject('deal', $id, $options)
$notes = Teamleader::notes()->forCompany('company-uuid');
$notes = Teamleader::notes()->forDeal('deal-uuid');
$notes = Teamleader::notes()->forSubject('nextgenProject', 'project-uuid');

Create helpers

Method Equivalent
createForSubject(string $type, string $id, string $content, array $notify = []) create([...]) with type validation
createForCompany(string $id, string $content, array $notify = []) createForSubject('company', ...)
createForContact(string $id, string $content, array $notify = []) createForSubject('contact', ...)
createForDeal(string $id, string $content, array $notify = []) createForSubject('deal', ...)
Teamleader::notes()->createForCompany('company-uuid', 'Meeting notes.');
Teamleader::notes()->createForDeal(
    'deal-uuid',
    'Urgent: customer requesting callback.',
    [['type' => 'user', 'id' => 'user-uuid']]
);

Introspection

$types = Teamleader::notes()->getAvailableSubjectTypes();

Subject Types

The subject type is validated before the request is sent. An InvalidArgumentException is thrown for any value not in this list.

Type Description
company Company
contact Contact
creditNote Credit note
deal Deal
invoice Invoice
meeting Meeting (added v1.2.8)
nextgenProject Project (v2)
product Product
project Project (legacy)
quotation Quotation
subscription Subscription

Response Structure

list() response

[
    'data' => [
        [
            'id'         => 'note-uuid',
            'author'     => ['type' => 'user', 'id' => 'user-uuid'],
            'subject'    => ['type' => 'company', 'id' => 'company-uuid'],
            'content'    => 'Follow-up call scheduled.',
            'created_at' => '2025-03-10T09:15:00+00:00',
            'updated_at' => '2025-03-10T09:15:00+00:00',
        ],
    ],
    'meta' => ['page' => ['size' => 20, 'number' => 1], 'matches' => 4],
]

create() / update() response

['data' => ['type' => 'note', 'id' => 'note-uuid']]

delete() returns an empty result (HTTP 204).


Error Handling

use BadMethodCallException;
use InvalidArgumentException;
use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;

// Invalid subject type β€” thrown before the request
try {
    $notes = Teamleader::notes()->forSubject('opportunity', 'uuid'); // not a valid type
} catch (InvalidArgumentException $e) {
    // "Invalid subject type 'opportunity'. Available types: company, contact, ..."
}

// Invalid notify type β€” thrown before the request
try {
    Teamleader::notes()->create([
        'subject' => ['type' => 'deal', 'id' => 'deal-uuid'],
        'content' => 'Update.',
        'notify'  => [['type' => 'team', 'id' => 'team-uuid']], // only 'user' is valid
    ]);
} catch (InvalidArgumentException $e) {
    // 'Only user notifications are supported'
}

// info() β€” always throws
try {
    Teamleader::notes()->info('note-uuid');
} catch (BadMethodCallException $e) {
    // Use list() with subject filter instead
}

Related Resources

  • Companies β€” Notes can be attached to companies
  • Contacts β€” Notes can be attached to contacts
  • Deals β€” Notes can be attached to deals
  • Meetings β€” Notes can be attached to meetings
  • Filtering β€” Filter and pagination reference

Clone this wiki locally