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

# contact.note.created

> Occurs when a contact note is created.

Use `contact.note.created` to handle this event at your webhook endpoint.

## Triggers

Occurs when a contact note is created.

Subscribe to `contact.note.created` when you [configure your webhook endpoint](https://docs.ycloud.com/en/api-reference/guides/api-fundamentals/configure-webhooks.md).

Keep the note `id` separate from `contactId`. `username` and `phoneNumber` can be null.

## Syntax

YCloud sends an HTTP `POST` request to your configured webhook URL. The following shape shows one payload variant. Angle-bracket values are placeholders; their types are listed under **Parameters**. Optional fields and other variants are described below.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "<ID>",
  "type": "contact.note.created",
  "apiVersion": "<API_VERSION>",
  "createTime": "<CREATE_TIME>",
  "contactNote": {
    "id": "<ID>",
    "contactId": "<CONTACT_ID>",
    "username": "<USERNAME>",
    "phoneNumber": "<PHONE_NUMBER>",
    "content": "<CONTENT>",
    "createTime": "<CREATE_TIME>",
    "updateTime": "<UPDATE_TIME>"
  }
}
```

## Parameters

Validate the `YCloud-Signature` HTTP header before you process the JSON body. See [signature validation](https://docs.ycloud.com/en/api-reference/guides/api-fundamentals/configure-webhooks.md).

### Event envelope

| Parameter | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Unique ID for the event. Minimum length: `6`. Maximum length: `128`. |
| `type` | string | Yes | Always `contact.note.created`. |
| `apiVersion` | string | Yes | The API version used to render this event. |
| `createTime` | string (date-time) | Yes | The time at which this event was created, formatted in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g., `2022-06-01T12:00:00.000Z`. |

### Event payload

| Parameter | Type | Required | Description |
| - | - | - | - |
| `contactNote` | object | No | Event-specific `contactNote` payload. |

The four common envelope fields are required. Payload fields depend on the event variant. In each object table, **Required** applies when its parent object is present. Optional fields can be omitted; a sample does not make a field required.

#### contactNote

| Parameter | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | ID of the note. Minimum length: `24`. Maximum length: `24`. Pattern: `^[0-9a-fA-F]{24}$`. |
| `contactId` | string | Yes | ID of the contact that owns the note. |
| `username` | string or null | Yes | Username of the contact that owns this note, without the leading `@`. |
| `phoneNumber` | string or null | Yes | Phone number of the contact that owns this note in E.164 format. |
| `content` | string | Yes | Text of the note. Maximum length: `500`. |
| `createTime` | string (date-time) | No | Time when the note was created, in RFC 3339 format. |
| `updateTime` | string (date-time) | No | Time when the note was last updated, in RFC 3339 format. |

## Example

The following JSON is the body delivered to your receiver. IDs, phone numbers, and other account values are illustrative.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "evt_1234567890abcdef12345678",
  "type": "contact.note.created",
  "apiVersion": "v2",
  "createTime": "2024-01-01T12:00:00.000Z",
  "contactNote": {
    "id": "6a3de646e18f344f743aaa4d",
    "contactId": "1824266594102064128",
    "username": "alice_01",
    "phoneNumber": "+12025550124",
    "content": "Customer prefers follow-up in the morning.",
    "createTime": "2024-01-01T12:00:00.000Z",
    "updateTime": "2024-01-01T12:00:00.000Z"
  }
}
```

After verifying the signature and durably accepting the event, return a `2xx` response. Process slow work asynchronously.

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

For scenario walkthroughs, see [annotated examples](https://docs.ycloud.com/en/api-reference/guides/examples/webhook-examples/contact-created-webhook-examples).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.