Trouble updating Email field in Notion database via API

Hey everyone, I’m having a hard time with the Notion API. I’m trying to add an email address to a column in my database, but it’s not working. The API keeps giving me an error saying the value doesn’t match the property type.

I’m using Insomnia to send a POST request to the Notion API. My request body looks like this:

{
  "parent": {
    "database_id": "my_database_id_here"
  },
  "properties": {
    "Email": {
      "email": [
        {
          "text": {
            "content": "[email protected]"
          }
        }
      ]
    }
  }
}

The column I’m trying to update is definitely set as an email type in Notion. I’m pretty sure the problem is in the properties part of my request, but I can’t figure out what’s wrong. Has anyone else run into this? Any ideas on how to fix it?

I’ve dealt with this exact problem before. The Notion API can be tricky with data types. Your JSON structure is off for email fields. Here’s what worked for me:

Instead of nesting the email in a text content structure, just provide the email address directly as a string. Try this format:

{
  "parent": { "database_id": "your_db_id" },
  "properties": {
    "Email": { "email": "[email protected]" }
  }
}

This should resolve the type mismatch error. If it persists, double-check your API version and ensure you have the correct permissions for the database. Let us know if this solves it for you.

hey SwiftCoder42, i had this prob too. others r right re: json strucure. also check ur api version is 2022-06-28+ if not, it might mess up email fields. try a new email col; best of luck!

I’ve actually encountered a similar issue when working with the Notion API for email fields. The problem is in your JSON structure for the email property. For email type columns, you don’t need to use the array and text content structure that’s used for rich text fields.

Instead, try simplifying your request body like this:

{
  "parent": {
    "database_id": "my_database_id_here"
  },
  "properties": {
    "Email": {
      "email": "[email protected]"
    }
  }
}

This format directly assigns the email string to the ‘email’ key. I’ve found this works consistently for email fields in Notion databases. Give it a shot and let me know if it resolves your issue. If you’re still having trouble, double-check your API key and make sure you have the necessary permissions for the database you’re trying to modify.