> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesfinity.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Note

> Creates a note attached to a person (Contact) or company (Company), identified by domain identifiers rather than by list/contact IDs. For a person, supply at least one of linkedin_url, email, crm_id, or phone. For a company, supply at least one of website_url or name. If no matching record exists yet, a minimal Contact or Company is created on the fly and the note is attached to its stable ID.

Creates a note attached to a **person** (Contact) or a **company** (Company). Unlike the older list-scoped endpoints, v2 notes are addressed by **domain identifiers** rather than by contact-list and contact IDs — so you can attach a note without first looking the person up in a list.

The target is resolved from the identifiers you provide. If no matching record exists yet, a minimal Contact or Company is created on the fly and the note is attached to its stable ID.

### Request Body

| Field     | Type   | Required | Max Length | Description                                                                                   |
| --------- | ------ | -------- | ---------- | --------------------------------------------------------------------------------------------- |
| `type`    | string | Yes      | —          | `person` or `company`. Determines which identifier fields are required.                       |
| `user_id` | string | Yes      | —          | ID of the team member authoring the note. Must be a member of the team that owns the API key. |
| `content` | string | Yes      | 10,000     | Plain text content of the note.                                                               |

#### Person identifiers (`type: "person"`)

Supply **at least one** of:

| Field          | Type   | Max Length | Description                                                |
| -------------- | ------ | ---------- | ---------------------------------------------------------- |
| `linkedin_url` | string | 500        | LinkedIn profile URL. Username is extracted automatically. |
| `email`        | string | 320        | Email address.                                             |
| `crm_id`       | string | 200        | External CRM identifier (e.g. `salesforce:003XXX`).        |
| `phone`        | string | 50         | Phone number in E.164 format.                              |

Optionally, link a company when a **new** Contact has to be created (ignored if the person already exists):

| Field             | Type   | Max Length | Description                            |
| ----------------- | ------ | ---------- | -------------------------------------- |
| `company_name`    | string | 300        | Company name to link to the person.    |
| `company_website` | string | 500        | Company website to link to the person. |

#### Company identifiers (`type: "company"`)

Supply **at least one** of:

| Field         | Type   | Max Length | Description                                                         |
| ------------- | ------ | ---------- | ------------------------------------------------------------------- |
| `website_url` | string | 500        | Company website URL. Normalized to hostname for matching.           |
| `name`        | string | 300        | Company name. Case-insensitive match against the company name list. |

### Example Request — person

```json theme={null}
{
  "type": "person",
  "user_id": "507f1f77bcf86cd799439033",
  "content": "Mentioned moving back from Lisbon next quarter.",
  "email": "john@example.com",
  "company_name": "Acme Corp"
}
```

### Example Request — company

```json theme={null}
{
  "type": "company",
  "user_id": "507f1f77bcf86cd799439033",
  "content": "Renewal owner is the new VP of Ops — loop in before Q3.",
  "website_url": "https://acme.com"
}
```

### Response (201)

Returns the created [note object](/api-reference/endpoint/list-notes#note-object). For a person note, `contact` is set; for a company note, `company` is set.

### Errors

| Status | Description                                                                                                     |
| ------ | --------------------------------------------------------------------------------------------------------------- |
| 400    | Validation failed (e.g. no identifier supplied for the chosen `type`), or `user_id` is not a member of the team |


## OpenAPI

````yaml POST /v2/notes
openapi: 3.0.1
info:
  title: Salesfinity API
  description: API documentation for Salesfinity platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://client-api.salesfinity.co
security:
  - ApiKeyAuth: []
paths:
  /v2/notes:
    post:
      tags:
        - Notes
      summary: Create a note
      description: >-
        Creates a note attached to a person (Contact) or company (Company),
        identified by domain identifiers rather than by list/contact IDs. For a
        person, supply at least one of linkedin_url, email, crm_id, or phone.
        For a company, supply at least one of website_url or name. If no
        matching record exists yet, a minimal Contact or Company is created on
        the fly and the note is attached to its stable ID.
      operationId: create-note
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNoteDTO'
      responses:
        '201':
          description: Note created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteDTO'
        '400':
          description: >-
            Validation failed (e.g. missing identifiers for the chosen type), or
            the user is not a member of the team
components:
  schemas:
    CreateNoteDTO:
      type: object
      required:
        - type
        - user_id
        - content
      properties:
        type:
          type: string
          enum:
            - person
            - company
          example: person
          description: Target type. Determines which identifier fields are required.
        user_id:
          type: string
          description: >-
            ID of the team member authoring the note. Must be a member of the
            team that owns the API key.
          example: 507f1f77bcf86cd799439011
        content:
          type: string
          maxLength: 10000
          description: Plain text content of the note
          example: Mentioned moving back from Lisbon next quarter.
        linkedin_url:
          type: string
          maxLength: 500
          example: https://linkedin.com/in/johndoe
          description: >-
            LinkedIn profile URL (person only). Username is extracted
            automatically. Person notes require at least one of linkedin_url,
            email, crm_id, or phone.
        email:
          type: string
          format: email
          maxLength: 320
          example: john@example.com
          description: Email address (person only)
        crm_id:
          type: string
          maxLength: 200
          example: salesforce:003XXX
          description: External CRM identifier (person only)
        phone:
          type: string
          maxLength: 50
          example: '+14155552671'
          description: Phone number in E.164 format (person only)
        company_name:
          type: string
          maxLength: 300
          example: Acme Corp
          description: >-
            Company name to link to the person if a new Contact is created.
            Ignored if the person already exists. (person only)
        company_website:
          type: string
          maxLength: 500
          example: https://acme.com
          description: >-
            Company website to link to the person if a new Contact is created.
            Ignored if the person already exists. (person only)
        website_url:
          type: string
          maxLength: 500
          example: https://acme.com
          description: >-
            Company website URL (company only). Normalized to hostname for
            matching. Company notes require at least one of website_url or name.
        name:
          type: string
          maxLength: 300
          example: Acme Corp
          description: >-
            Company name (company only). Case-insensitive match against the
            company name list.
    NoteDTO:
      type: object
      properties:
        _id:
          type: string
          example: 507f1f77bcf86cd799439011
        team:
          type: string
          example: 507f1f77bcf86cd799439012
        author:
          allOf:
            - $ref: '#/components/schemas/NoteAuthorDTO'
          description: >-
            Note author. Populated when available; otherwise just the user ID
            under _id.
        content:
          type: string
          description: Plain text content of the note
        is_pinned:
          type: boolean
          description: Whether this note is pinned to the top
        pinned_at:
          type: string
          format: date-time
          nullable: true
        pinned_by:
          type: string
          nullable: true
        contact:
          type: string
          nullable: true
          description: Contact this note is attached to (mutually exclusive with company)
        company:
          type: string
          nullable: true
          description: Company this note is attached to (mutually exclusive with contact)
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    NoteAuthorDTO:
      type: object
      properties:
        _id:
          type: string
          example: 507f1f77bcf86cd799439011
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        image:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````