Only show these results:


You can add key-value pairs to certain objects to store data against them.

Create, read, update, and delete metadata on the following objects:

  • Events
    • Existing events
    • New events
    • Recurring calendar events
  • Calendar
    • New and existing calendars
  • Accounts
    • New and existing accounts
  • Messages
    • Creating and updating messages
  • Send
    • Sending a message directly
  • Drafts
    • Creating and updating drafts

Metadata Object

The metadata object is made of a list of key-value pairs.

  • Keys - A key can be any string. You are allowed up to 40 characters per key.
  • Value - A value can be any string. You are allowed up to 500 characters per value.

In total, you can 50 key-value pairs per object. You cannot nest metadata objects.

"hi": "6",
"event-type" : "party"

Adding Metadata

For this example, we'll use accounts. Metadata works the same across events, calendars, and accounts.

curl --location --request PUT '<NYLAS_CLIENT_ID>/accounts/<ACCOUNT_ID>' \
--header 'Content-Type: application/json' \
--data-raw '{
"hello": "goodbye"

Delete Metadata

You can overwrite the value of a key by passing in an empty string. Key-value pairs on events can only be removed through PUT requests that omit that key-value pair.

Update an existing event with a PUT request.

"internal_event_id": ""

Key-Value Limit

Since the key with an empty string value persists, it will still count against your limit of 50 key-value pairs.

Query Metadata

You can query your added metadata. Using the following metadata object as an example:

"metadata": {
"goodmorning": "goodnight",
"green": "sour-apple",
"hello": "goodbye"

To query for keys, use:


To query for values, use:


To query for multiple keys and values use:


To return any object with metadata:


To return all keys that match hello and welcome:


To return values that do not match goodnight:


You can combine the filters for targeted searching.

No match

If there is no match, the API returns a 200 OK with [] as a result.

Recurring Events

Recurring events are made of a primary event, with child events or the recurrence attached.

  • You can add metadata to the primary event.
  • Metadata is not attached to child events.
  • The filter expand_recurring=true does not work with recurring events that have metadata.
  • If you change an event from non-recurring to recurring, any metadata on the non-recurring event is lost.

Keep in Mind

  • Number of key-value pairs per object: 50
  • Number of characters per key: 40
  • Number of characters in the value: 500
  • Not able to nest metadata objects
  • Webhooks are not supported when event metadata is updated. When an event is created an event.created webhook will fire.