A newer version of this documentation is available.

View Latest

Creating a Scope

  • Developer Preview
    Scopes can be created, by means of the REST API.


    Scopes are created by means of the POST /pools/default/buckets/<bucket_name>/collections/ HTTP method and URI.

    HTTP Method and URI

    POST /pools/default/buckets/<bucket_name>/collections

    Requires the name parameter, whose value is the name of the scope to be created.


    Curl request syntax is as follows:

    curl -X POST -v -u [admin]:[password]
      -d name=<name-of-scope>


    Curl request example:

    curl -X POST -v -u Administrator:password \
    http://localhost:8091/pools/default/buckets/testBucket/collections \
    -d name=my_scope

    Raw HTTP request example:

    POST /pools/default/buckets/testBucket/collections HTTP/1.1
    Host: localhost:8091
    Content-Type: application/json
    Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==

    Response example:


    Response codes:

    HTTP/1.1 200 OK
    HTTP/1.1 401 Unauthorized
    HTTP/1.1 404 Object Not Found

    Possible errors:

    Requested resource not found.
    "name":"Length must be in range from 1 to 30"
    "name":"Can only contain characters A-Z, a-z, 0-9 and the following symbols _ - %"