Skip to content

Instantly share code, notes, and snippets.

@farkaskid
Last active January 10, 2020 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farkaskid/7406da9090780b0ef1849e842432f67a to your computer and use it in GitHub Desktop.
Save farkaskid/7406da9090780b0ef1849e842432f67a 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