Skip to content

Update a note

client.Note.Update(ctx, id, body) (*NoteUpdateResponse, error)
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: notes:update

Rate limit category: Write

ParametersExpand Collapse
id string

Unique identifier of the note to update.

body NoteUpdateParams
Fields param.Field[NoteUpdateParamsFields]Optional

Field values to update — only provided fields are modified; omitted fields are left unchanged. See Fields and relationships for value type details.

Content stringOptional

Content of the note as markdown formatted text.

Title stringOptional

Title of the note.

Relationships param.Field[NoteUpdateParamsRelationships]Optional

Relationship operations to apply. System relationships use a $ prefix (e.g. $account, $opportunity). Each value is an operation object with add or remove.

Account NoteUpdateParamsRelationshipsAccountUnionOptional

Operation to modify associated accounts.

One of the following:
type NoteUpdateParamsRelationshipsAccountAdd struct{…}
Add NoteUpdateParamsRelationshipsAccountAddAddUnion

Entity ID(s) to add to the relationship.

One of the following:
string
type NoteUpdateParamsRelationshipsAccountAddAddArray []string
type NoteUpdateParamsRelationshipsAccountRemove struct{…}
Remove NoteUpdateParamsRelationshipsAccountRemoveRemoveUnion

Entity ID(s) to remove from the relationship.

One of the following:
string
type NoteUpdateParamsRelationshipsAccountRemoveRemoveArray []string
Opportunity NoteUpdateParamsRelationshipsOpportunityUnionOptional

Operation to modify associated opportunities.

One of the following:
type NoteUpdateParamsRelationshipsOpportunityAdd struct{…}
Add NoteUpdateParamsRelationshipsOpportunityAddAddUnion

Entity ID(s) to add to the relationship.

One of the following:
string
type NoteUpdateParamsRelationshipsOpportunityAddAddArray []string
type NoteUpdateParamsRelationshipsOpportunityRemove struct{…}
Remove NoteUpdateParamsRelationshipsOpportunityRemoveRemoveUnion

Entity ID(s) to remove from the relationship.

One of the following:
string
type NoteUpdateParamsRelationshipsOpportunityRemoveRemoveArray []string
ReturnsExpand Collapse
type NoteUpdateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, NoteUpdateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value NoteUpdateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type NoteUpdateResponseFieldValueArray []string
type NoteUpdateResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type NoteUpdateResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const NoteUpdateResponseFieldValueTypeAddress NoteUpdateResponseFieldValueType = "ADDRESS"
const NoteUpdateResponseFieldValueTypeCheckbox NoteUpdateResponseFieldValueType = "CHECKBOX"
const NoteUpdateResponseFieldValueTypeCurrency NoteUpdateResponseFieldValueType = "CURRENCY"
const NoteUpdateResponseFieldValueTypeDatetime NoteUpdateResponseFieldValueType = "DATETIME"
const NoteUpdateResponseFieldValueTypeEmail NoteUpdateResponseFieldValueType = "EMAIL"
const NoteUpdateResponseFieldValueTypeFullName NoteUpdateResponseFieldValueType = "FULL_NAME"
const NoteUpdateResponseFieldValueTypeMarkdown NoteUpdateResponseFieldValueType = "MARKDOWN"
const NoteUpdateResponseFieldValueTypeMultiSelect NoteUpdateResponseFieldValueType = "MULTI_SELECT"
const NoteUpdateResponseFieldValueTypeNumber NoteUpdateResponseFieldValueType = "NUMBER"
const NoteUpdateResponseFieldValueTypeSingleSelect NoteUpdateResponseFieldValueType = "SINGLE_SELECT"
const NoteUpdateResponseFieldValueTypeSocialHandle NoteUpdateResponseFieldValueType = "SOCIAL_HANDLE"
const NoteUpdateResponseFieldValueTypeTelephone NoteUpdateResponseFieldValueType = "TELEPHONE"
const NoteUpdateResponseFieldValueTypeText NoteUpdateResponseFieldValueType = "TEXT"
const NoteUpdateResponseFieldValueTypeURL NoteUpdateResponseFieldValueType = "URL"
Relationships map[string, NoteUpdateResponseRelationship]

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 []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

Update a note

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  noteUpdateResponse, err := client.Note.Update(
    context.TODO(),
    "id",
    githubcomlightfldlightfieldgo.NoteUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", noteUpdateResponse.ID)
}
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ]
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
Returns Examples
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ]
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}