curl --request POST \
--url https://use.hoop.dev/api/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"groups": [
"sre",
"dba"
],
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"slack_id": "U053ELZHB53",
"status": "active"
}
'import requests
url = "https://use.hoop.dev/api/users"
payload = {
"email": "jsmith@example.com",
"groups": ["sre", "dba"],
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"slack_id": "U053ELZHB53",
"status": "active"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
groups: ['sre', 'dba'],
name: 'John Wick',
password: 'mysecurepassword',
picture: '',
slack_id: 'U053ELZHB53',
status: 'active'
})
};
fetch('https://use.hoop.dev/api/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'groups' => [
'sre',
'dba'
],
'name' => 'John Wick',
'password' => 'mysecurepassword',
'picture' => '',
'slack_id' => 'U053ELZHB53',
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/users"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"email": "jsmith@example.com",
"groups": [
"sre",
"dba"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"role": "standard",
"slack_id": "U053ELZHB53",
"status": "active",
"verified": true
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Create User
Creating a user will pre configure user definitions like display name, profile picture, groups and the slack id
curl --request POST \
--url https://use.hoop.dev/api/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"groups": [
"sre",
"dba"
],
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"slack_id": "U053ELZHB53",
"status": "active"
}
'import requests
url = "https://use.hoop.dev/api/users"
payload = {
"email": "jsmith@example.com",
"groups": ["sre", "dba"],
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"slack_id": "U053ELZHB53",
"status": "active"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
groups: ['sre', 'dba'],
name: 'John Wick',
password: 'mysecurepassword',
picture: '',
slack_id: 'U053ELZHB53',
status: 'active'
})
};
fetch('https://use.hoop.dev/api/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'groups' => [
'sre',
'dba'
],
'name' => 'John Wick',
'password' => 'mysecurepassword',
'picture' => '',
'slack_id' => 'U053ELZHB53',
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/users"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"groups\": [\n \"sre\",\n \"dba\"\n ],\n \"name\": \"John Wick\",\n \"password\": \"mysecurepassword\",\n \"picture\": \"\",\n \"slack_id\": \"U053ELZHB53\",\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"email": "jsmith@example.com",
"groups": [
"sre",
"dba"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "John Wick",
"password": "mysecurepassword",
"picture": "",
"role": "standard",
"slack_id": "U053ELZHB53",
"status": "active",
"verified": true
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
The request body resource
Email address of the user
Groups registered for this user
["sre", "dba"]
Display name
"John Wick"
Local auth cases have a password
"mysecurepassword"
The profile picture url to display
""
The identifier of slack to send messages to users
"U053ELZHB53"
The status of the user. Inactive users cannot access the system
active, inactive, invited Response
Created
Email address of the user
Groups registered for this user
["sre", "dba"]
Unique identifier of the resource
Display name
"John Wick"
Local auth cases have a password
"mysecurepassword"
The profile picture url to display
""
Permission related to the user
- admin - Has super privileges and has access to any resource in the system
- standard - Grant access to standard routes.
- unregistered - Grant access to unregistered routes. It's a transient state where the user is authenticated but is not registered. This state is only available for multi tenant environments
admin, standard, unregistered "standard"
The identifier of slack to send messages to users
"U053ELZHB53"
The status of the user. Inactive users cannot access the system
active, inactive, invited DEPRECATED in flavor of role
Was this page helpful?