For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Users

get

This class will define the view behavior

Args: viewsets ([OCSVIewSet])

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Query parameters
date_joinedstring · date-timeOptional
emailstringOptional
first_namestringOptional
formatstring · enumOptionalPossible values:
groupsinteger[]Optional
is_activebooleanOptional
is_staffbooleanOptional
is_superuserbooleanOptional
last_loginstring · date-timeOptional
last_namestringOptional
limitintegerOptional

Number of results to return per page.

offsetintegerOptional

The initial index from which to return the results.

orderingstringOptional

Which field to use when ordering the results.

passwordstringOptional
searchstringOptional

A search term.

user_permissionsinteger[]Optional
usernamestringOptional
Responses
200Success
countintegerRequiredExample: 123
nextstring · uri · nullableOptionalExample: http://api.example.org/accounts/?offset=400&limit=100
previousstring · uri · nullableOptionalExample: http://api.example.org/accounts/?offset=200&limit=100
get/users/
GET /users/ HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
200Success
{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 1,
      "username": "text",
      "email": "name@gmail.com",
      "first_name": "text",
      "last_name": "text",
      "is_superuser": true,
      "groups": [
        1
      ],
      "group_assignments": "text",
      "user_permissions": [
        1
      ]
    }
  ]
}
post

Handle post request, suitable for single and multi creation

Args: request ([dict]): can be dict or list of dicts

Returns: [type]: [description]

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Query parameters
formatstring · enumOptionalPossible values:
Body

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

Responses
201Success

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

post/users/
POST /users/ HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 157

"username='text'&email='name@gmail.com'&first_name='text'&last_name='text'&password='text'&is_superuser=true&groups=[1]&user_permissions=[1]"
201Success
{
  "id": 1,
  "username": "text",
  "email": "name@gmail.com",
  "first_name": "text",
  "last_name": "text",
  "is_superuser": true,
  "groups": [
    1
  ],
  "group_assignments": "text",
  "user_permissions": [
    1
  ]
}
get

This class will define the view behavior

Args: viewsets ([OCSVIewSet])

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Responses
200Success

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

get/users/{id}/
GET /users/{id}/ HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
200Success
{
  "id": 1,
  "username": "text",
  "email": "name@gmail.com",
  "first_name": "text",
  "last_name": "text",
  "is_superuser": true,
  "groups": [
    1
  ],
  "group_assignments": "text",
  "user_permissions": [
    1
  ]
}
put

This class will define the view behavior

Args: viewsets ([OCSVIewSet])

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Body

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

Responses
200Success

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

put/users/{id}/
PUT /users/{id}/ HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 157

"username='text'&email='name@gmail.com'&first_name='text'&last_name='text'&password='text'&is_superuser=true&groups=[1]&user_permissions=[1]"
200Success
{
  "id": 1,
  "username": "text",
  "email": "name@gmail.com",
  "first_name": "text",
  "last_name": "text",
  "is_superuser": true,
  "groups": [
    1
  ],
  "group_assignments": "text",
  "user_permissions": [
    1
  ]
}
delete

This class will define the view behavior

Args: viewsets ([OCSVIewSet])

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Responses
204

No response body

No content

delete/users/{id}/
DELETE /users/{id}/ HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
204

No response body

No content

patch

This class will define the view behavior

Args: viewsets ([OCSVIewSet])

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Body

This serialize class provide the API representation

idintegerRead-onlyOptional
usernamestring · max: 150Optional

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyOptional
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyOptional
user_permissionsinteger[]Optional

Specific permissions for this user.

Responses
200Success

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

patch/users/{id}/
PATCH /users/{id}/ HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 157

"username='text'&email='name@gmail.com'&first_name='text'&last_name='text'&password='text'&is_superuser=true&groups=[1]&user_permissions=[1]"
200Success
{
  "id": 1,
  "username": "text",
  "email": "name@gmail.com",
  "first_name": "text",
  "last_name": "text",
  "is_superuser": true,
  "groups": [
    1
  ],
  "group_assignments": "text",
  "user_permissions": [
    1
  ]
}
post

Create or update one user group assignment and resync effective groups

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Body

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

Responses
200Success

This serialize class provide the API representation

idintegerRead-onlyRequired
usernamestring · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
emailone ofOptional
string · email · max: 254Optional
or
stringOptional
first_namestring · max: 150Optional
last_namestring · max: 150Optional
passwordstring · max: 128Write-onlyRequired
is_superuserbooleanOptional

Designates that this user has all permissions without explicitly assigning them.

groupsinteger[]Optional

The groups this user belongs to. A user will get all permissions granted to each of their groups.

group_assignmentsstringRead-onlyRequired
user_permissionsinteger[]Optional

Specific permissions for this user.

post/users/{id}/group-assignments/
POST /users/{id}/group-assignments/ HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 157

"username='text'&email='name@gmail.com'&first_name='text'&last_name='text'&password='text'&is_superuser=true&groups=[1]&user_permissions=[1]"
200Success
{
  "id": 1,
  "username": "text",
  "email": "name@gmail.com",
  "first_name": "text",
  "last_name": "text",
  "is_superuser": true,
  "groups": [
    1
  ],
  "group_assignments": "text",
  "user_permissions": [
    1
  ]
}
delete

Delete one user group assignment and resync effective groups

Authorizations
AuthorizationstringRequired

Token-based authentication with required prefix "Token"

Path parameters
assignment_idstringRequired
idintegerRequired

A unique integer value identifying this user.

Query parameters
formatstring · enumOptionalPossible values:
Responses
204

No response body

No content

delete/users/{id}/group-assignments/{assignment_id}/
DELETE /users/{id}/group-assignments/{assignment_id}/ HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
204

No response body

No content

Last updated