## 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](/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 param.Field[NoteUpdateParamsFields]` 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` Content of the note as markdown formatted text. - `Title string` Title of the note. - `Relationships param.Field[NoteUpdateParamsRelationships]` Relationship operations to apply. System relationships use a `$` prefix (e.g. `$account`, `$opportunity`). Each value is an operation object with `add` or `remove`. - `Account NoteUpdateParamsRelationshipsAccountUnion` Operation to modify associated accounts. - `type NoteUpdateParamsRelationshipsAccountAdd struct{…}` - `Add NoteUpdateParamsRelationshipsAccountAddAddUnion` Entity ID(s) to add to the relationship. - `string` - `type NoteUpdateParamsRelationshipsAccountAddAddArray []string` - `type NoteUpdateParamsRelationshipsAccountRemove struct{…}` - `Remove NoteUpdateParamsRelationshipsAccountRemoveRemoveUnion` Entity ID(s) to remove from the relationship. - `string` - `type NoteUpdateParamsRelationshipsAccountRemoveRemoveArray []string` - `Opportunity NoteUpdateParamsRelationshipsOpportunityUnion` Operation to modify associated opportunities. - `type NoteUpdateParamsRelationshipsOpportunityAdd struct{…}` - `Add NoteUpdateParamsRelationshipsOpportunityAddAddUnion` Entity ID(s) to add to the relationship. - `string` - `type NoteUpdateParamsRelationshipsOpportunityAddAddArray []string` - `type NoteUpdateParamsRelationshipsOpportunityRemove struct{…}` - `Remove NoteUpdateParamsRelationshipsOpportunityRemoveRemoveUnion` Entity ID(s) to remove from the relationship. - `string` - `type NoteUpdateParamsRelationshipsOpportunityRemoveRemoveArray []string` ### Returns - `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. - `string` - `float64` - `bool` - `type NoteUpdateResponseFieldValueArray []string` - `type NoteUpdateResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type NoteUpdateResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `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"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `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 string` External identifier for the entity, or null if unset. ### Example ```go 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) } ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ```