Skip to main content
POST
/
v2
/
notes
curl --request POST \
  --url https://api.affinity.co/v2/notes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "entities",
  "content": {
    "html": "<p>Followed up after the demo. Strong interest, will recirculate next week.</p>"
  },
  "persons": [
    {
      "id": 2
    },
    {
      "id": 3
    }
  ],
  "companies": [
    {
      "id": 10
    }
  ],
  "opportunities": [
    {
      "id": 100
    }
  ]
}
'
{
  "id": 1,
  "type": "entities",
  "content": {
    "html": "<p> This is a note! <span data-type=\"note-mention\" data-note-mention-type=\"person\" data-note-mention-person-id=\"1\"> Michael Torres </span> was mentioned. </p>"
  },
  "creator": {
    "id": 1,
    "firstName": "Jane",
    "lastName": "Smith",
    "primaryEmailAddress": "jane.smith@northpointvc.com",
    "type": "internal"
  },
  "mentions": [
    {
      "id": 1,
      "type": "person",
      "person": {
        "id": 2,
        "firstName": "Michael",
        "lastName": "Torres",
        "primaryEmailAddress": "m.torres@northpointvc.com",
        "type": "internal"
      }
    }
  ],
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-01-21T00:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating a note attached directly to one or more entities (Persons, Companies, and/or Opportunities). At least one of persons, companies, or opportunities must contain at least one entry — a note of this type cannot exist without at least one attached entity.

type
string
required

Discriminator. Must be entities to create a note attached to only entities.

Allowed value: "entities"
content
notes.ContentToBeSaved · object
required

The note's body content. Only html is supported on write; supply rendered HTML that uses the restricted tag set listed below.

persons
PersonReference · object[]

Persons to attach the note to. Each item references a Person by id. May be combined with companies and/or opportunities.

Maximum array length: 100
Example:
[{ "id": 1 }, { "id": 2 }]
companies
CompanyReference · object[]

Companies to attach the note to. Each item references a Company by id. May be combined with persons and/or opportunities.

Maximum array length: 100
Example:
[{ "id": 10 }]
opportunities
OpportunityReference · object[]

Opportunities to attach the note to. Each item references an Opportunity by id. May be combined with persons and/or companies.

Maximum array length: 100
Example:
[{ "id": 100 }]

Response

Created

A Note object attached to an entity (Person, Company, Opportunity)

id
integer<int32>
required

The id of the note

Required range: 1 <= x <= 2147483647
content
notes.Content · object
required

A note content

creator
PersonData · object
required
mentions
notes.Mention · object[]
required

The mentions in the note

Maximum array length: 100
createdAt
string<date-time>
required

The date and time the note was created

updatedAt
string<date-time> | null
required

The date and time the note was last updated

type
string
required

The type of the note

Allowed value: "entities"
repliesCount
integer<int32>

The number of replies to this note. This is only included if the repliesCount parameter is passed in the includes in the request and the note is not a reply itself.

Required range: 0 <= x <= 2147483647
opportunitiesPreview
notes.OpportunitiesPreview · object

A preview for Opportunities directly attached to the Note

personsPreview
notes.PersonsPreview · object

A preview for Persons directly attached to the Note

companiesPreview
notes.CompaniesPreview · object

A preview for Companies directly attached to the Note