Download Riak 2.0

HTTP API

Riak has a rich, full-featured HTTP 1.1 API. This is an overview of the operations you can perform via HTTP and can be used as a guide for developing a compliant client. All URLs assume the default configuration values where applicable. All examples use curl to interact with Riak.

Client ID

All requests to Riak <1.0 or Riak 1.0 without vnode_vclocks enabled should include the X-Riak-ClientId header, which can be any string that uniquely identifies the client, for purposes of tracing object modifications in the vector clock.

URL Escaping

Buckets, keys, and link specifications may not contain unescaped slashes. Use a URL-escaping library or replace slashes with %2F.

Bucket Operations

Buckets in Riak are a virtual concept. They exist primarily as a namespace mechanism and as a mechanism to isolate specific behavior changes that deviate from the default bucket settings. For example, you may augment the number of replicas, the specific storage backend and commit hooks at the bucket level.

How Many Buckets Can I Have?

Currently, buckets come with virtually no cost except for when you modify the default bucket properties. Modified Bucket properties are gossiped around the cluster and therefore add to the amount of data sent around the network. In other words, buckets using the default bucket properties are free.

Delete Buckets

There is no straightforward way to delete an entire Bucket. To delete all the keys in a bucket, you’ll need to delete them all individually.

Object/Key Operations

The combination of bucket, key, value and metadata are referred to as a “Riak Object”. The operations below affect individual objects in Riak.

Datatypes

Query Operations

Server Operations