Create bucket use

Hello. I’m trying to create bucket in my task, use function.
I referred to this topic: How am I able to create and drop buckets in Tasks?
and use post function like this:

import "http"
import "json"
    url: "http://localhost:8086/api/v2/buckets",
    headers: {
        Authorization: "Token {my token}",
        "Content-type": "application/json"
    data: json.encode(v: {
        "name": "TestBucket",
        "orgID": {myOrg},
        "retentionRules": [{
                "everySeconds": 86400,
                "shardGroupDurationSeconds": 0,
                "type": "expire"
        "schemaType": "implicit"

But influxdb returns error “failed to unmarshal json: id must have a length of 16 bytes”.
When I check InfluxDB 2.0 api document, “id” doesn’t need at bucket create request body.
What am I missing?

Hello @tendo_aris,
You might find the following useful:

This worked for me:

curl --location --request POST '' \
--header 'Authorization: Token {{mytoken}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"orgID": "{{my org ID}}",
"name": "test-bucket",
"description": "This is an example",
"rp": "string",
"retentionRules": [
"type": "expire",
"everySeconds": 86400,
"shardGroupDurationSeconds": 0
"schemaType": "implicit"