Users

Get Users

Returns all team members under the account

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:

[
  0:{
    "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

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: {'5f1175a8f8daa545e28c8aa2': '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":{"5f1175a8f8daa545e28c8aa2":"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\":{\"5f1175a8f8daa545e28c8aa2\":\"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\":{\"5f1175a8f8daa545e28c8aa2\":\"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\":{\"5f1175a8f8daa545e28c8aa2\":\"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\":{\"5f1175a8f8daa545e28c8aa2\":\"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\":{\"5f1175a8f8daa545e28c8aa2\":\"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

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

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)

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: 'add', path: 'acmePath', value: 'foo', from: 'barBaz'}],
  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":"add","path":"acmePath","value":"foo","from":"barBaz"}]'
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\":\"add\",\"path\":\"acmePath\",\"value\":\"foo\",\"from\":\"barBaz\"}]"

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\":\"add\",\"path\":\"acmePath\",\"value\":\"foo\",\"from\":\"barBaz\"}]"
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\":\"add\",\"path\":\"acmePath\",\"value\":\"foo\",\"from\":\"barBaz\"}]");
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\":\"add\",\"path\":\"acmePath\",\"value\":\"foo\",\"from\":\"barBaz\"}]", 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\":\"add\",\"path\":\"acmePath\",\"value\":\"foo\",\"from\":\"barBaz\"}]")

	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: value is like saying experiment.value

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

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

Delete User

Removes User from Rollout system

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