> For a complete page index, fetch https://developer.close.com/llms.txt # Create a Note activity POST https://api.close.com/api/v1/activity/note/ Content-Type: application/json To include an attachment, you must first upload the file to Close using the [Files API](https://developer.close.com/api/resources/files). Then, add an object to the `attachments` array with the following fields: `url`, `filename` and `content_type`. The `url` should be the URL provided in the `download.url` field of the response from the [Files API](https://developer.close.com/api/resources/files). It must begin `https://app.close.com/go/file/`. A note can be pinned or unpinned by setting the `pinned` field to `true` or `false` when creating or updating a note. Reference: https://developer.close.com/api/resources/activities/notes/create ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Body (application/json) This endpoint expects a CreateNoteActivity. - `lead_id` (string, required) - `activity_at` (datetime, optional, nullable) - `attachments` (list of CreateNoteActivityAttachmentsItems, optional, nullable) - `contact_id` (string, optional, nullable) - `created_by` (string, optional, nullable) - `date_created` (datetime, optional, nullable) - `note` (string, optional, nullable) - `note_html` (string, optional, nullable) - `organization_id` (string, optional, nullable) - `pinned` (boolean, optional, nullable) - `title` (string, optional, nullable) - `user_id` (string, optional, nullable) ## Response ### 200 Successful response - `_type` (string, required) - `activity_at` (datetime, required, nullable) - `attachments` (list of Attachment, required) - `contact_id` (string, required, nullable) - `created_by` (string, required, nullable) - `date_created` (datetime, required) - `date_updated` (datetime, required) - `id` (string, required) - `lead_id` (string, required, nullable) - `note` (string, required) - `note_html` (string, required) - `note_mentions` (list of string, required) - `organization_id` (string, required) - `pinned` (boolean, required) - `pinned_at` (datetime, required, nullable) - `source` (enum, required, nullable) - Allowed values: `ui`, `api`, `import`, `clipper`, `email`, `suggestion`, `segment-integration`, `customerio-integration`, `calendly-integration`, `ai`, `whatsapp`, `webform` - `title` (string, required, nullable) - `updated_by` (string, required, nullable) - `user_id` (string, required, nullable) - `users` (list of string, required) - `agent_action_reason` (string, optional, nullable) - `agent_config_id` (string, optional, nullable) - `comment_summary` (CommentSummary, optional, nullable) - `created_by_name` (string, optional, nullable) - `updated_by_name` (string, optional, nullable) - `user_name` (string, optional, nullable) ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Types ### CreateNoteActivityAttachmentsItems - `filename` (string, required) - `url` (string, required) - `content_type` (string, optional, nullable) ### Attachment - `content_type` (string, required, nullable) - `filename` (string, required, nullable) - `size` (integer, required, nullable) - `url` (string, required) - `thumbnail_url` (string, optional, nullable) ### CommentSummary - `comment_count` (integer, required) - `thread_id` (string, required) ## Examples **Request** ```json { "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp", "attachments": [ { "filename": "picture.gif", "url": "https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/", "content_type": "image/gif" } ], "note_html": "

this is a test note.

" } ``` **Response** ```json { "_type": "Note", "activity_at": "2013-02-20T06:39:57.266000+00:00", "attachments": [ { "content_type": "image/gif", "filename": "picture.gif", "size": 20673, "url": "https://app.close.com/go/file/persisted/orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH/activity.note/acti_kwWA3rOfy4BnaZ8QQk3RIIAz51dU9ayiluy1s961Oiw/3HV4BNwDyBLdfrPbFZF78s/picture.gif/", "thumbnail_url": "https://app.close.com/go/file/persisted/orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH/activity.note/acti_kwWA3rOfy4BnaZ8QQk3RIIAz51dU9ayiluy1s961Oiw/3HV4BNwDyBLdfrPbFZF78s/picture.gif/thumbnail/" } ], "contact_id": null, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "date_created": "2013-02-20T06:39:57.266000+00:00", "date_updated": "2013-02-20T06:39:57.266000+00:00", "id": "acti_kwWA3rOfy4BnaZ8QQk3RIIAz51dU9ayiluy1s961Oiw", "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp", "note": "this is a test note.", "note_html": "

this is a test note.

", "note_mentions": [], "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "pinned": false, "pinned_at": null, "source": "api", "title": null, "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "users": [], "created_by_name": "Bruce Wayne", "updated_by_name": "Bruce Wayne", "user_name": "Bruce Wayne" } ``` **SDK Code** ```python activities.notes_create_example import requests url = "https://api.close.com/api/v1/activity/note/" payload = { "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp", "attachments": [ { "filename": "picture.gif", "url": "https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/", "content_type": "image/gif" } ], "note_html": "

this is a test note.

" } headers = { "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript activities.notes_create_example const url = 'https://api.close.com/api/v1/activity/note/'; const credentials = btoa(":"); const options = { method: 'POST', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"lead_id":"lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp","attachments":[{"filename":"picture.gif","url":"https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/","content_type":"image/gif"}],"note_html":"

this is a test note.

"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go activities.notes_create_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/activity/note/" payload := strings.NewReader("{\n \"lead_id\": \"lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp\",\n \"attachments\": [\n {\n \"filename\": \"picture.gif\",\n \"url\": \"https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/\",\n \"content_type\": \"image/gif\"\n }\n ],\n \"note_html\": \"

this is a test note.

\"\n}") req, _ := http.NewRequest("POST", url, payload) req.SetBasicAuth("", "") 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_create_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/activity/note/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"lead_id\": \"lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp\",\n \"attachments\": [\n {\n \"filename\": \"picture.gif\",\n \"url\": \"https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/\",\n \"content_type\": \"image/gif\"\n }\n ],\n \"note_html\": \"

this is a test note.

\"\n}" response = http.request(request) puts response.read_body ``` ```java activities.notes_create_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.close.com/api/v1/activity/note/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"lead_id\": \"lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp\",\n \"attachments\": [\n {\n \"filename\": \"picture.gif\",\n \"url\": \"https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/\",\n \"content_type\": \"image/gif\"\n }\n ],\n \"note_html\": \"

this is a test note.

\"\n}") .asString(); ``` ```php activities.notes_create_example request('POST', 'https://api.close.com/api/v1/activity/note/', [ 'body' => '{ "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp", "attachments": [ { "filename": "picture.gif", "url": "https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/", "content_type": "image/gif" } ], "note_html": "

this is a test note.

" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp activities.notes_create_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/activity/note/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"lead_id\": \"lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp\",\n \"attachments\": [\n {\n \"filename\": \"picture.gif\",\n \"url\": \"https://app.close.com/go/file/temporary/user_MvDoAZA889UMrgsZbnXmHkJSomSi7qk2Iwc4JnGHTbo/3HV4BNwDyBLdfrPbFZF78s/picture.gif/\",\n \"content_type\": \"image/gif\"\n }\n ],\n \"note_html\": \"

this is a test note.

\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```