Creating tasks with curl using the API fails (code 3010)

Hi all,

I’m playing with the API and try to add a tasks with curl. Authorisation succeeds and I can list all mal lists and tasks.

When running curl "${VIKUNJA_URL}/api/v1/lists/1" -d '{"title": "Task","description": "Test description"}' -H "Authorization: Bearer ${auth_token}" -H "Content-Type: application/json" the server responds with
{"code":3010,"message":"This list must belong to a namespace."} and I don’t know what this should tell me.

The list is part of a namespace.

Am I missing something?

Best regards

You need to include the namespace_id in the request.

The reason for this is that in Go, there’s no way to tell if an integer value was 0 or not provided. To support moving a list between namespaces we need to always update this and therefore add a check - which resulted in the error message you got.