Skip to main content

core_users_create

POST 

/api/v3//core/users/

User Viewset

Request

Body

required

    username stringrequired

    Possible values: non-empty and <= 150 characters

    name stringrequired

    User's display name.

    is_active Active (boolean)

    Designates whether this user should be treated as active. Unselect this instead of deleting accounts.

    last_login date-timenullable
    groups uuid[]
    email email

    Possible values: <= 254 characters

    attributes

    object

    property name* any
    path string

    Possible values: non-empty

    type UserTypeEnum (string)

    Possible values: [internal, external, service_account, internal_service_account]

Responses

Schema

    pk ID (integer)required
    username stringrequired

    Possible values: <= 150 characters

    name stringrequired

    User's display name.

    is_active Active (boolean)

    Designates whether this user should be treated as active. Unselect this instead of deleting accounts.

    last_login date-timenullable
    is_superuser booleanrequired
    groups uuid[]

    groups_obj

    object[]

    nullable

    required

  • Array [

  • pk uuidrequired
    num_pk integerrequired

    Get a numerical, int32 ID for the group

    name stringrequired
    is_superuser boolean

    Users added to this group will be superusers.

    parent uuidnullable
    parent_name stringnullablerequired

    attributes

    object

    property name* any
  • ]

  • email email

    Possible values: <= 254 characters

    avatar stringrequired

    User's avatar, either a http/https URL or a data URI

    attributes

    object

    property name* any
    uid stringrequired
    path string
    type UserTypeEnum (string)

    Possible values: [internal, external, service_account, internal_service_account]

    uuid uuidrequired

Authorization: http

name: authentiktype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "/api/v3/core/users/");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <TOKEN>");
var content = new StringContent("{\n \"username\": \"string\",\n \"name\": \"string\",\n \"is_active\": true,\n \"last_login\": \"2024-07-29T15:51:28.071Z\",\n \"groups\": [\n \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n ],\n \"email\": \"[email protected]\",\n \"attributes\": {},\n \"path\": \"string\",\n \"type\": \"internal\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
/api/v3
Auth
Body required
{
  "username": "string",
  "name": "string",
  "is_active": true,
  "last_login": "2024-07-29T15:51:28.071Z",
  "groups": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "email": "[email protected]",
  "attributes": {},
  "path": "string",
  "type": "internal"
}