# Note ## Create `client.note.create(NoteCreateParamsbody, RequestOptionsoptions?): NoteCreateResponse` **post** `/v1/notes` Creates a new note record. The note author is automatically set to the API key owner. Supports idempotency via the `Idempotency-Key` header. **[Required scope](/using-the-api/scopes/):** `notes:create` **[Rate limit category](/using-the-api/rate-limits/):** Write ### Parameters - `body: NoteCreateParams` - `fields: Fields` Field values for the new note. `$title` is required; `$content` is optional. See **[Fields and relationships](/using-the-api/fields-and-relationships/)** for value type details. - `"$title": string` Title of the note. - `"$content"?: string | null` Content of the note as markdown formatted text. - `relationships?: Relationships` Relationships to set on the new note. System relationships use a `$` prefix (e.g. `$account`, `$opportunity`). Each value is a single entity ID or an array of IDs. The note author is automatically set to the API key owner. - `"$account"?: string | Array` ID(s) of accounts to associate with this note. - `string` - `Array` - `"$opportunity"?: string | Array` ID(s) of opportunities to associate with this note. - `string` - `Array` ### Returns - `NoteCreateResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. ### Example ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const noteCreateResponse = await client.note.create({ fields: { $title: '$title' } }); console.log(noteCreateResponse.id); ``` ## Update `client.note.update(stringid, NoteUpdateParamsbody, RequestOptionsoptions?): NoteUpdateResponse` **post** `/v1/notes/{id}` Updates an existing note by ID. Only included fields and relationships are modified. Both `$account` and `$opportunity` relationships can be modified via `add` or `remove` operations. Supports idempotency via the `Idempotency-Key` header. **[Required scope](/using-the-api/scopes/):** `notes:update` **[Rate limit category](/using-the-api/rate-limits/):** Write ### Parameters - `id: string` Unique identifier of the note to update. - `body: NoteUpdateParams` - `fields?: Fields` Field values to update — only provided fields are modified; omitted fields are left unchanged. See **[Fields and relationships](/using-the-api/fields-and-relationships/)** for value type details. - `"$content"?: string | null` Content of the note as markdown formatted text. - `"$title"?: string | null` Title of the note. - `relationships?: Relationships` Relationship operations to apply. System relationships use a `$` prefix (e.g. `$account`, `$opportunity`). Each value is an operation object with `add` or `remove`. - `"$account"?: Add | Remove` Operation to modify associated accounts. - `Add` - `add: string | Array` Entity ID(s) to add to the relationship. - `string` - `Array` - `Remove` - `remove: string | Array` Entity ID(s) to remove from the relationship. - `string` - `Array` - `"$opportunity"?: Add | Remove` Operation to modify associated opportunities. - `Add` - `add: string | Array` Entity ID(s) to add to the relationship. - `string` - `Array` - `Remove` - `remove: string | Array` Entity ID(s) to remove from the relationship. - `string` - `Array` ### Returns - `NoteUpdateResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. ### Example ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const noteUpdateResponse = await client.note.update('id'); console.log(noteUpdateResponse.id); ``` ## Retrieve `client.note.retrieve(stringid, RequestOptionsoptions?): NoteRetrieveResponse` **get** `/v1/notes/{id}` Retrieves a single note by its ID. **[Required scope](/using-the-api/scopes/):** `notes:read` **[Rate limit category](/using-the-api/rate-limits/):** Read ### Parameters - `id: string` Unique identifier of the note to retrieve. ### Returns - `NoteRetrieveResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. ### Example ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const noteRetrieveResponse = await client.note.retrieve('id'); console.log(noteRetrieveResponse.id); ``` ## List `client.note.list(NoteListParamsquery?, RequestOptionsoptions?): NoteListResponse` **get** `/v1/notes` Returns a paginated list of notes. Use `offset` and `limit` to paginate through results. See [List endpoints](/using-the-api/list-endpoints/) for more information about pagination. **[Required scope](/using-the-api/scopes/):** `notes:read` **[Rate limit category](/using-the-api/rate-limits/):** Search ### Parameters - `query: NoteListParams` - `limit?: number` Maximum number of records to return. Defaults to 25, maximum 25. - `offset?: number` Number of records to skip for pagination. Defaults to 0. ### Returns - `NoteListResponse` - `data: Array` Array of entity objects for the current page. - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. - `object: string` The object type, always `"list"`. - `totalCount: number` Total number of entities matching the query. ### Example ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const noteListResponse = await client.note.list(); console.log(noteListResponse.data); ``` ## Domain Types ### Note Create Response - `NoteCreateResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. ### Note List Response - `NoteListResponse` - `data: Array` Array of entity objects for the current page. - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. - `object: string` The object type, always `"list"`. - `totalCount: number` Total number of entities matching the query. ### Note Retrieve Response - `NoteRetrieveResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset. ### Note Update Response - `NoteUpdateResponse` - `id: string` Unique identifier for the entity. - `createdAt: string` ISO 8601 timestamp of when the entity was created. - `fields: Record` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `value: string | number | boolean | 3 more | null` The field value, or null if unset. - `string` - `number` - `boolean` - `Array` - `Address` - `city?: string | null` City name. - `country?: string | null` 2-letter ISO 3166-1 alpha-2 country code. - `latitude?: number | null` Latitude coordinate. - `longitude?: number | null` Longitude coordinate. - `postalCode?: string | null` Postal or ZIP code. - `state?: string | null` State or province. - `street?: string | null` Street address line 1. - `street2?: string | null` Street address line 2. - `FullName` - `firstName?: string | null` The contact's first name. - `lastName?: string | null` The contact's last name. - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more` The data type of the field. - `"ADDRESS"` - `"CHECKBOX"` - `"CURRENCY"` - `"DATETIME"` - `"EMAIL"` - `"FULL_NAME"` - `"MARKDOWN"` - `"MULTI_SELECT"` - `"NUMBER"` - `"SINGLE_SELECT"` - `"SOCIAL_HANDLE"` - `"TELEPHONE"` - `"TEXT"` - `"URL"` - `httpLink: string | null` URL to view the entity in the Lightfield web app, or null. - `relationships: Record` Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - `cardinality: string` Whether the relationship is `has_one` or `has_many`. - `objectType: string` The type of the related object (e.g. `account`, `contact`). - `values: Array` IDs of the related entities. - `updatedAt: string | null` ISO 8601 timestamp of when the entity was last updated, or null. - `externalId?: string | null` External identifier for the entity, or null if unset.