Users

5 minute readReference

This pages discusses the REST API calls for users.

Get Users

Returns all team members under the account.

https://x-api.rollout.io/public-api/users

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request");

var options = {
  method: 'GET',
  url: 'https://x-api.rollout.io/public-api/users',
  headers: {
    accept: 'application/json',
    authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
ccurl --request GET \
  --url https://x-api.rollout.io/public-api/users \
  --header 'accept: application/json' \
  --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://x-api.rollout.io/public-api/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'

response = http.request(request)
puts response.read_body
import requests

url = "https://x-api.rollout.io/public-api/users"

headers = {
    'accept': "application/json",
    'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://x-api.rollout.io/public-api/users")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
  .build();

Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/users");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://x-api.rollout.io/public-api/users"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Users response

Example:

[
  {
    "name":"John Smith",
    "email":"jsmith@acmecorp.example",
    "teamAdmin":true,
    "applications":{
      "1a23bcd4e5fg6h7890i123j4":{
        "environments":{
          "Production":"write",
          "AcmeEnvironment":"write"
        }
      }
    }
  }
]

Response schema type: array of objects

  • String email - the user email

  • String name - Name of user

  • Boolean *teamAdmin - True if user is one of the team admins

  • Object applications - access to the following applications ID

Create User

Add a new User or override existing one

https://x-api.rollout.io/public-api/users

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request");

var options = {
  method: 'PUT',
  url: 'https://x-api.rollout.io/public-api/users',
  headers: {
    'content-type': 'application/json',
    authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
  },
  body: {
    applications: {
      '5f1175a8f8daa545e28c8aa2': {environments: {'Production': 'read'}}
    },
    email: 'joe.smith@acmecorp.example',
    name: 'Joe Smith',
    teamAdmin: true
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
curl --request PUT \
  --url https://x-api.rollout.io/public-api/users \
  --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \
  --header 'content-type: application/json' \
  --data '{"applications":{"5f1175a8f8daa545e28c8aa2":{"environments":{"Production":"read"}}},"email":"joe.smith@acmecorp.example","name":"Joe Smith","teamAdmin":true}'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://x-api.rollout.io/public-api/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
request.body = "{\"applications\":{\"5f1175a8f8daa545e28c8aa2\":{\"environments\":{\"Production\":\"read\"}}},\"email\":\"joe.smith@acmecorp.example\",\"name\":\"Joe Smith\",\"teamAdmin\":true}"

response = http.request(request)
puts response.read_body
import requests

url = "https://x-api.rollout.io/public-api/users"

payload = "{\"applications\":{\"5f1175a8f8daa545e28c8aa2\":{\"environments\":{\"Production\":\"read\"}}},\"email\":\"joe.smith@acmecorp.example\",\"name\":\"Joe Smith\",\"teamAdmin\":true}"
headers = {
    'content-type': "application/json",
    'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
    }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"applications\":{\"5f1175a8f8daa545e28c8aa2\":{\"environments\":{\"Production\":\"read\"}}},\"email\":\"joe.smith@acmecorp.example\",\"name\":\"Joe Smith\",\"teamAdmin\":true}");
Request request = new Request.Builder()
  .url("https://x-api.rollout.io/public-api/users")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
  .build();

Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/users");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
request.AddParameter("application/json", "{\"applications\":{\"5f1175a8f8daa545e28c8aa2\":{\"environments\":{\"Production\":\"read\"}}},\"email\":\"joe.smith@acmecorp.example\",\"name\":\"Joe Smith\",\"teamAdmin\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://x-api.rollout.io/public-api/users"

	payload := strings.NewReader("{\"applications\":{\"5f1175a8f8daa545e28c8aa2\":{\"environments\":{\"Production\":\"read\"}}},\"email\":\"joe.smith@acmecorp.example\",\"name\":\"Joe Smith\",\"teamAdmin\":true}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

BODY PARAMS

  • email* string - the user email

  • name string - Name of user

  • teamAdmin boolean - True if user is one of the team admins

  • applications object - access to the following applications id

  • environments object - read/write permissions to environments

Get User

Returns the team members with given email

https://x-api.rollout.io/public-api/users/email

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request");

var options = {
  method: 'GET',
  url: 'https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example',
  headers: {
    accept: 'application/json',
    authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
curl --request GET \
  --url https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example \
  --header 'accept: application/json' \
  --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'

response = http.request(request)
puts response.read_body
import requests

url = "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

headers = {
    'accept': "application/json",
    'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
  .build();

Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

PATH PARAMS

  • email* string - The user email

User response

Example:

{
  "name": "joe.smith@acmecorp.com",
  "email": "joe.smith@acmecorp.com",
  "teamAdmin": true,
  "applications": {
    "5f69f8d790e25112535887d2": {
      "environments": {
        "Production": "write",
        "Staging": "write",
        "Development": "write",
        "AcmeEnvironment": "write"
      }
    },
    "5f7208c46c8bb65c30b00b77": {
      "environments": {
        "Production": "write"
      }
    }
  }
}

Response schema type: object

  • String email - the user email

  • String name - Name of user

  • Boolean teamAdmin - True if user is one of the team admins

  • Object applications - access to the following applications id

Patch User

Patch User object, patching is done according to JSON-Patch (RFC6902)

https://x-api.rollout.io/public-api/users/email

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request");

var options = {
  method: 'PATCH',
  url: 'https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example',
  headers: {
    'content-type': 'application/json',
    authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
  },
  body: [{op: 'replace', path: '/name', value: 'Moshe Ofnik'}],
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
curl --request PATCH \
  --url https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example \
  --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \
  --header 'content-type: application/json' \
  --data '[{"op":"replace","path":"/name","value":"Moshe Ofnik"}]'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
request.body = "[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"Moshe Ofnik\"}]"

response = http.request(request)
puts response.read_body
import requests

url = "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

payload = "[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"Moshe Ofnik\"}]"
headers = {
    'content-type': "application/json",
    'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
    }

response = requests.request("PATCH", url, data=payload, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"Moshe Ofnik\"}]");
Request request = new Request.Builder()
  .url("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")
  .patch(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
  .build();

Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example");
var request = new RestRequest(Method.PATCH);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
request.AddParameter("application/json", "[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"Moshe Ofnik\"}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

	payload := strings.NewReader("[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"Moshe Ofnik\"}]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

PATH PARAMS

  • email* string - The user email

BODY PARAMS

  • op string - The operation to be performed

  • path string Path to the value that is to be changed. Ex: path: name is like saying user.name

  • value string - The value to be used within the operations.

  • from string - A string containing a JSON Pointer value.

Delete User

Removes a user from Rollout system

https://x-api.rollout.io/public-api/users/email

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request");

var options = {
  method: 'DELETE',
  url: 'https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example',
  headers: {authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
curl --request DELETE \
  --url https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example \
  --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'

response = http.request(request)
puts response.read_body
import requests

url = "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

headers = {'authorization': 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example")
  .delete(null)
  .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
  .build();

Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://x-api.rollout.io/public-api/users/joe.smith%40acmecorp.example"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

PATH PARAMS

  • email string - The user email

As a security measure, a rate limit has been implemented to one request per second, and is based on the requester IP address. Any requests at rates that exceed the rate limit will receive a 555 error status code. There are no exceptions we can currently make for customers at this time.