Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 25, 2020 10:06
Show Gist options
  • Save velotiotech/c3cc131e34894fe7aba8211c554cadc6 to your computer and use it in GitHub Desktop.
Save velotiotech/c3cc131e34894fe7aba8211c554cadc6 to your computer and use it in GitHub Desktop.
Create namespace in KV
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/storage/kv/namespaces" \
-X POST \
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
-H "X-Auth-Key: $CLOUDFLARE_AUTH_KEY" \
-H "Content-Type: application/json" \
--data '{"title": "Requests"}'
The above HTTP request will create a namespace by the name Requests. The response should look something like this:
{
"result": {
"id": "30b52f55aafb41d88546d01d5f69440a",
"title": "Requests",
"supports_url_encoding": true
},
"success": true,
"errors": [],
"messages": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment