Users endpoints
This document contains the endpoints for the Users category.
Gets all the users
/api/v1/auth/users
Authorized
This endpoint returns all the users
Request examples
/v1/auth/users
Authorized
curl --location 'http://localhost/api/v1/auth/users '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Get , "http://localhost/api/v1/auth/users " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users "
method := "get"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"claims" : "[]string" ,
"email" : "string" ,
"id" : "string" ,
"isSuperUser" : "bool" ,
"name" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
]
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Gets a user
/api/v1/auth/users/{id}
Authorized
This endpoint returns a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
Request examples
/v1/auth/users/{id}
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id} '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Get , "http://localhost/api/v1/auth/users/{id} " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id} "
method := "get"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"claims" : "[]string" ,
"email" : "string" ,
"id" : "string" ,
"isSuperUser" : "bool" ,
"name" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
]
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Creates a user
/api/v1/auth/users
Authorized
This endpoint creates a user
Parameters
Name
Type
In
Required
Description
body
object
body
optional
User
Schema
{
"claims" : "[]string" ,
"email" : "string" ,
"is_super_user" : "bool" ,
"name" : "string" ,
"password" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
Request examples
/v1/auth/users
Authorized
curl --location 'http://localhost/api/v1/auth/users '
--header 'Authorization ••••••'
--header 'Content-Type: application/json'
--data '{
"claims": "[]string",
"email": "string",
"is_super_user": "bool",
"name": "string",
"password": "string",
"roles": "[]string",
"username": "string"
}'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Post , "http://localhost/api/v1/auth/users " );
request . Headers . Add ( "Authorization" , "••••••" );
request . Headers . Add ( "Content-Type" , "application/json" );
request . Content = new StringContent ( "{
"claims" : "[]string" ,
"email" : "string" ,
"is_super_user" : "bool" ,
"name" : "string" ,
"password" : "string" ,
"roles" : "[]string" ,
"username" : "string"
} ");
request . Content = content ;
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users "
method := "post"
payload := strings . NewReader ( `{
"claims": "[]string",
"email": "string",
"is_super_user": "bool",
"name": "string",
"password": "string",
"roles": "[]string",
"username": "string"
}` )
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"claims" : "[]string" ,
"email" : "string" ,
"id" : "string" ,
"isSuperUser" : "bool" ,
"name" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
]
{
"code" : "int" ,
"diagnostics" : {
"end_time" : "*time.Time" ,
"errors" : [
{
"code" : "string" ,
"component" : "string" ,
"message" : "string" ,
"metadata" : "map[string]unknown" ,
"timestamp" : "time.Time"
}
],
"metadata" : "map[string]unknown" ,
"mu" : "sync.RWMutex" ,
"operation" : "string" ,
"path" : [
{
"component" : "string" ,
"duration" : "int64" ,
"file_name" : "string" ,
"function_name" : "string" ,
"line_number" : "int" ,
"metadata" : "map[string]unknown" ,
"operation" : "string" ,
"timestamp" : "time.Time"
}
],
"start_time" : "time.Time" ,
"warnings" : [
{
"code" : "string" ,
"component" : "string" ,
"message" : "string" ,
"metadata" : "map[string]unknown" ,
"timestamp" : "time.Time"
}
]
},
"message" : "string"
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Deletes a user
/api/v1/auth/users/{id}
Authorized
This endpoint deletes a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
Request examples
/v1/auth/users/{id}
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id} '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Delete , "http://localhost/api/v1/auth/users/{id} " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id} "
method := "delete"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Update a user
/api/v1/auth/users/{id}
Authorized
This endpoint updates a user
Parameters
Name
Type
In
Required
Description
body
object
body
optional
User
Schema
{
"claims" : "[]string" ,
"email" : "string" ,
"is_super_user" : "bool" ,
"name" : "string" ,
"password" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
Request examples
/v1/auth/users/{id}
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id} '
--header 'Authorization ••••••'
--header 'Content-Type: application/json'
--data '{
"claims": "[]string",
"email": "string",
"is_super_user": "bool",
"name": "string",
"password": "string",
"roles": "[]string",
"username": "string"
}'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Put , "http://localhost/api/v1/auth/users/{id} " );
request . Headers . Add ( "Authorization" , "••••••" );
request . Headers . Add ( "Content-Type" , "application/json" );
request . Content = new StringContent ( "{
"claims" : "[]string" ,
"email" : "string" ,
"is_super_user" : "bool" ,
"name" : "string" ,
"password" : "string" ,
"roles" : "[]string" ,
"username" : "string"
} ");
request . Content = content ;
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id} "
method := "put"
payload := strings . NewReader ( `{
"claims": "[]string",
"email": "string",
"is_super_user": "bool",
"name": "string",
"password": "string",
"roles": "[]string",
"username": "string"
}` )
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"claims" : "[]string" ,
"email" : "string" ,
"id" : "string" ,
"isSuperUser" : "bool" ,
"name" : "string" ,
"roles" : "[]string" ,
"username" : "string"
}
]
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Gets all the roles for a user
/api/v1/auth/users/{id}/roles
Authorized
This endpoint returns all the roles for a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
Request examples
/v1/auth/users/{id}/roles
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/roles '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Get , "http://localhost/api/v1/auth/users/{id}/roles " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/roles "
method := "get"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"id" : "string" ,
"name" : "string"
}
]
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Adds a role to a user
/api/v1/auth/users/{id}/roles
Authorized
This endpoint adds a role to a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
body
object
body
optional
Role Name
Request examples
/v1/auth/users/{id}/roles
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/roles '
--header 'Authorization ••••••'
--header 'Content-Type: application/json'
--data '{
"name": "string"
}'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Post , "http://localhost/api/v1/auth/users/{id}/roles " );
request . Headers . Add ( "Authorization" , "••••••" );
request . Headers . Add ( "Content-Type" , "application/json" );
request . Content = new StringContent ( "{
"name" : "string"
} ");
request . Content = content ;
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/roles "
method := "post"
payload := strings . NewReader ( `{
"name": "string"
}` )
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Removes a role from a user
/api/v1/auth/users/{id}/roles/{role_id}
Authorized
This endpoint removes a role from a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
role_id
string
path
required
Role ID
Request examples
/v1/auth/users/{id}/roles/{role_id}
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/roles/{role_id} '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Delete , "http://localhost/api/v1/auth/users/{id}/roles/{role_id} " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/roles/{role_id} "
method := "delete"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Gets all the claims for a user
/api/v1/auth/users/{id}/claims
Authorized
This endpoint returns all the claims for a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
Request examples
/v1/auth/users/{id}/claims
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/claims '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Get , "http://localhost/api/v1/auth/users/{id}/claims " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/claims "
method := "get"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
[
{
"id" : "string" ,
"name" : "string"
}
]
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Adds a claim to a user
/api/v1/auth/users/{id}/claims
Authorized
This endpoint adds a claim to a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
body
object
body
optional
Claim Name
Request examples
/v1/auth/users/{id}/claims
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/claims '
--header 'Authorization ••••••'
--header 'Content-Type: application/json'
--data '{
"name": "string"
}'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Post , "http://localhost/api/v1/auth/users/{id}/claims " );
request . Headers . Add ( "Authorization" , "••••••" );
request . Headers . Add ( "Content-Type" , "application/json" );
request . Content = new StringContent ( "{
"name" : "string"
} ");
request . Content = content ;
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/claims "
method := "post"
payload := strings . NewReader ( `{
"name": "string"
}` )
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}
Removes a claim from a user
/api/v1/auth/users/{id}/claims/{claim_id}
Authorized
This endpoint removes a claim from a user
Parameters
Name
Type
In
Required
Description
id
string
path
required
User ID
claim_id
string
path
required
Claim ID
Request examples
/v1/auth/users/{id}/claims/{claim_id}
Authorized
curl --location 'http://localhost/api/v1/auth/users/{id}/claims/{claim_id} '
--header 'Authorization ••••••'
var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Delete , "http://localhost/api/v1/auth/users/{id}/claims/{claim_id} " );
request . Headers . Add ( "Authorization" , "••••••" );
var response = await client . SendAsync ( request );
response . EnsureSuccessStatusCode ();
var responseString = await response . Content . ReadAsStringAsync ();
package main
import (
"fmt"
"net/http"
"strings"
"io"
)
func main () {
url := "http://localhost/api/v1/auth/users/{id}/claims/{claim_id} "
method := "delete"
client := & http . Client {}
req , err := http . NewRequest ( method , url , payload )
if err != nil {
fmt . Println ( err )
return
}
req . Header . Add ( "Content-Type" , "application/json" )
req . Header . Add ( "Authorization" , "••••••" )
res , err := client . Do ( req )
if err != nil {
fmt . Println ( err )
return
}
defer res . Body . Close ()
body , err := io . ReadAll ( res . Body )
if err != nil {
fmt . Println ( err )
return
}
fmt . Println ( string ( body ))
}
Responses
{
"code" : "int" ,
"message" : "string" ,
"stack" : [
{
"code" : "int" ,
"description" : "string" ,
"error" : "string" ,
"path" : "string"
}
]
}
{
"error" : "OAuthErrorType" ,
"error_description" : "string" ,
"error_uri" : "string"
}