Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Error: Incorrect Formatting of 'people' Property in Notion API Payload #518

Open
shkholikov opened this issue Jun 27, 2024 · 0 comments

Comments

@shkholikov
Copy link

When attempting to create a new page in a Notion database using the Notion API, I encountered a validation error related to the formatting of the 'people' property. The API returns an error indicating that the property value is invalid.

returned error:

{
  "object": "error",
  "status": 400,
  "code": "validation_error",
  "message": "Body Validation Failed. Fix the following:\nInvalid property value for: \"Assignee\".",
  "request_id": "1b9626d2-a7f8-4e67-84a1-02c348fc6e15"
}

payload example:

Assignee: {
      id: "0ecb46d3-24f8-4727-99b0-2f8409b4714c",
      name: "Jack Winston"
    },

But, according to the Notion API Docs, the payload data should be formatted the following way:

"Stakeholders": {
      "people": [{
        "object": "user",
        "id": "c2f20311-9e54-4d11-8c79-7398424ae41e"
      }]
    }

This is also returning an error because the property "people" should not be in the payload. I have also tried a few more payload data formats, but still getting the same error...
I'm wondering if this issue is related to Notion's API or SDK...

Node version: "v21.6.2"
Notion JS library version: "2.2.15"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant