Date format for Timeline events API requests

Hi,

I'm trying to use the API to create timeline events but I'm getting the error 'value must be a valid date string' for the timestamp field. I've tried various different date/time formats without luck. Does anyone know what the format should be?

Thanks

Can you share the request?

Hi @TonyC

Thanks for the reply :slightly_smiling_face:

I'm using webhooks by Zapier - so it's a bit hard to post the request here, I'm sending a Post request to /api/timeline-event/ with this data field:

{
"timestamp": "2024-04-22T12:35:19.863808Z",
"description": "test",
"archived": false,
"timezone": "Europe/London",
"name": "test",
"timeline_id": 1,
"source": "collections",
"icon": "star"
}

Any help greatly appreciated!

Can you try something like the below:

archived: false
created_at: "2024-04-26T12:54:45.29084Z"
creator_id: 1
description: null
icon: "star"
id: 1
name: "test"
time_matters: false
timeline_id: 1
timestamp: "2024-04-02T22:00:00Z"
timezone: "Europe/London"
updated_at: "2024-04-26T12:54:45.29084Z"

Thank you - unfortunately, I get the same error
value must be a valid date string (HTTP Status Code: 400)

Hi @TonyC

Do you have any other ideas? I checked the network tab on the Metabase UI for a timeline event, and my code all looks correct, including the date formatting. I'm at a lost what the issue is here.

Thanks for your help.

Is it possible tge code you are using to send the request is changing the format of the payload? Can you share the code itself you are using not just the payload

Ah you were right - I've fixed it - thanks!!