> For a complete page index, fetch https://developer.close.com/llms.txt

# Update a Note activity

PUT https://api.close.com/api/v1/activity/note/{id}/
Content-Type: application/json

**`note_html` and `note`**: setting one overwrites the other. If both are provided, `note_html` takes precedence. `note_html` supports rich-text HTML; `note` is plaintext only.

A note can be pinned or unpinned by setting `pinned` to `true` or `false`.

Reference: https://developer.close.com/api/resources/activities/notes/update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /activity/note/{id}/:
    put:
      operationId: update
      summary: Update a Note activity
      description: >-
        **`note_html` and `note`**: setting one overwrites the other. If both
        are provided, `note_html` takes precedence. `note_html` supports
        rich-text HTML; `note` is plaintext only.


        A note can be pinned or unpinned by setting `pinned` to `true` or
        `false`.
      tags:
        - subpackage_activitiesNotes
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Use your API key as the username and leave the password empty.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityBase'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateNoteActivity'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    UpdateNoteActivityAttachmentsItems:
      type: object
      properties:
        content_type:
          type:
            - string
            - 'null'
        filename:
          type: string
        url:
          type: string
          format: uri
      required:
        - filename
        - url
      title: UpdateNoteActivityAttachmentsItems
    UpdateNoteActivity:
      type: object
      properties:
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        attachments:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/UpdateNoteActivityAttachmentsItems'
        contact_id:
          type:
            - string
            - 'null'
        note:
          type:
            - string
            - 'null'
        note_html:
          type:
            - string
            - 'null'
        pinned:
          type:
            - boolean
            - 'null'
        title:
          type:
            - string
            - 'null'
      title: UpdateNoteActivity
    ActivityBase:
      type: object
      properties:
        _type:
          type: string
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        contact_id:
          type:
            - string
            - 'null'
        created_by:
          type:
            - string
            - 'null'
        created_by_name:
          type:
            - string
            - 'null'
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
        id:
          type: string
        lead_id:
          type:
            - string
            - 'null'
        organization_id:
          type: string
        updated_by:
          type:
            - string
            - 'null'
        updated_by_name:
          type:
            - string
            - 'null'
        user_id:
          type:
            - string
            - 'null'
        user_name:
          type:
            - string
            - 'null'
        users:
          type: array
          items:
            type: string
      required:
        - _type
        - activity_at
        - contact_id
        - created_by
        - date_created
        - date_updated
        - id
        - lead_id
        - organization_id
        - updated_by
        - user_id
        - users
      title: ActivityBase
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
      description: Use your API key as the username and leave the password empty.
    OAuth2:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python activities.notes_update_example
import requests

url = "https://api.close.com/api/v1/activity/note/id/"

payload = {
    "note_html": "<body><p>this is an update to my existing note.</p></body>",
    "pinned": True
}
headers = {
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript activities.notes_update_example
const url = 'https://api.close.com/api/v1/activity/note/id/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'PUT',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"note_html":"<body><p>this is an update to my existing note.</p></body>","pinned":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go activities.notes_update_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.close.com/api/v1/activity/note/id/"

	payload := strings.NewReader("{\n  \"note_html\": \"<body><p>this is an update to my existing note.</p></body>\",\n  \"pinned\": true\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.SetBasicAuth("<CLOSE_API_KEY>", "")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby activities.notes_update_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/activity/note/id/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"note_html\": \"<body><p>this is an update to my existing note.</p></body>\",\n  \"pinned\": true\n}"

response = http.request(request)
puts response.read_body
```

```java activities.notes_update_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.close.com/api/v1/activity/note/id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"note_html\": \"<body><p>this is an update to my existing note.</p></body>\",\n  \"pinned\": true\n}")
  .asString();
```

```php activities.notes_update_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.close.com/api/v1/activity/note/id/', [
  'body' => '{
  "note_html": "<body><p>this is an update to my existing note.</p></body>",
  "pinned": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

echo $response->getBody();
```

```csharp activities.notes_update_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/activity/note/id/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"note_html\": \"<body><p>this is an update to my existing note.</p></body>\",\n  \"pinned\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```