Skip to main content
PUT
/
users
/
{emailOrID}
Update User
curl --request PUT \
  --url https://use.hoop.dev/api/users/{emailOrID} \
  --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/{emailOrID}"

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.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
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/{emailOrID}', 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/{emailOrID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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/{emailOrID}"

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("PUT", 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.put("https://use.hoop.dev/api/users/{emailOrID}")
.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/{emailOrID}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.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"
}

Path Parameters

id
string
required

The subject identifier of the user

Body

application/json

The request body resource

email
string<email>
required

Email address of the user

groups
string[]

Groups registered for this user

Example:
["sre", "dba"]
name
string

Display name

Example:

"John Wick"

password
string

Local auth cases have a password

Example:

"mysecurepassword"

picture
string

The profile picture url to display

Example:

""

slack_id
string

The identifier of slack to send messages to users

Example:

"U053ELZHB53"

status
enum<string>
default:active

The status of the user. Inactive users cannot access the system

Available options:
active,
inactive,
invited

Response

OK

email
string<email>
required

Email address of the user

groups
string[]

Groups registered for this user

Example:
["sre", "dba"]
id
string<uuid>
read-only

Unique identifier of the resource

name
string

Display name

Example:

"John Wick"

password
string

Local auth cases have a password

Example:

"mysecurepassword"

picture
string

The profile picture url to display

Example:

""

role
enum<string>
read-only

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
Available options:
admin,
standard,
unregistered
Example:

"standard"

slack_id
string

The identifier of slack to send messages to users

Example:

"U053ELZHB53"

status
enum<string>
default:active

The status of the user. Inactive users cannot access the system

Available options:
active,
inactive,
invited
verified
boolean
read-only

DEPRECATED in flavor of role