Skip to content

The Authorization and Authentication section of the InvenTree API schema is documented below.

InvenTree API 198

API for InvenTree - the intuitive open source inventory management system


License: MIT

Servers

Description URL
http://localhost:8000 http://localhost:8000

auth


GET /api/auth/emails/

Description

List of registered email addresses for current users.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "email": "derp@meme.org",
            "id": 0,
            "primary": true,
            "user": 0,
            "verified": true
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/EmailAddress"
            },
            "type": "array"
        }
    },
    "type": "object"
}

POST /api/auth/emails/

Description

List of registered email addresses for current users.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

Response 201 Created

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

POST /api/auth/emails/{id}/primary/

Description

Filter item, run action and return data.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
id path integer No

Response 200 OK

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

POST /api/auth/emails/{id}/remove/

Description

Filter item, run action and return data.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
id path integer No

Response 200 OK

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

POST /api/auth/emails/{id}/verify/

Description

Filter item, run action and return data.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
id path integer No

Response 200 OK

{
    "email": "derp@meme.org",
    "id": 0,
    "primary": true,
    "user": 0,
    "verified": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "Serializer for the EmailAddress model.",
    "properties": {
        "email": {
            "format": "email",
            "maxLength": 254,
            "title": "Email address",
            "type": "string"
        },
        "id": {
            "readOnly": true,
            "type": "integer"
        },
        "primary": {
            "type": "boolean"
        },
        "user": {
            "type": "integer"
        },
        "verified": {
            "type": "boolean"
        }
    },
    "required": [
        "email",
        "id",
        "user"
    ],
    "type": "object"
}

POST /api/auth/login/

Description

API view for logging in via API.

Input parameters

Parameter In Type Default Nullable Description
basicAuth header string N/A No Basic authentication

Request body

{
    "email": "derp@meme.org",
    "password": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password": {
            "type": "string"
        },
        "username": {
            "type": "string"
        }
    },
    "required": [
        "password"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "password": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password": {
            "type": "string"
        },
        "username": {
            "type": "string"
        }
    },
    "required": [
        "password"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "password": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password": {
            "type": "string"
        },
        "username": {
            "type": "string"
        }
    },
    "required": [
        "password"
    ],
    "type": "object"
}

Response 200 OK


GET /api/auth/logout/

Description

API view for logging out via API.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 200 OK


POST /api/auth/logout/

Description

Logout the current user.

Deletes user token associated with request.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 200 OK


POST /api/auth/password/change/

Description

Calls Django Auth SetPasswordForm save method.

Accepts the following POST parameters: new_password1, new_password2 Returns the success/fail message.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "new_password1": "string",
    "new_password2": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2"
    ],
    "type": "object"
}

{
    "new_password1": "string",
    "new_password2": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2"
    ],
    "type": "object"
}

{
    "new_password1": "string",
    "new_password2": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2"
    ],
    "type": "object"
}

Response 200 OK

{
    "detail": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "readOnly": true,
            "type": "string"
        }
    },
    "required": [
        "detail"
    ],
    "type": "object"
}

POST /api/auth/password/reset/

Description

Calls Django Auth PasswordResetForm save method.

Accepts the following POST parameters: email Returns the success/fail message.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for requesting a password reset e-mail.",
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "required": [
        "email"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for requesting a password reset e-mail.",
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "required": [
        "email"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for requesting a password reset e-mail.",
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "required": [
        "email"
    ],
    "type": "object"
}

Response 200 OK

{
    "detail": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "readOnly": true,
            "type": "string"
        }
    },
    "required": [
        "detail"
    ],
    "type": "object"
}

POST /api/auth/password/reset/confirm/

Description

Password reset e-mail link is confirmed, therefore this resets the user's password.

Accepts the following POST parameters: token, uid, new_password1, new_password2 Returns the success/fail message.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "new_password1": "string",
    "new_password2": "string",
    "token": "string",
    "uid": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for confirming a password reset attempt.",
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        },
        "token": {
            "type": "string"
        },
        "uid": {
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2",
        "token",
        "uid"
    ],
    "type": "object"
}

{
    "new_password1": "string",
    "new_password2": "string",
    "token": "string",
    "uid": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for confirming a password reset attempt.",
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        },
        "token": {
            "type": "string"
        },
        "uid": {
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2",
        "token",
        "uid"
    ],
    "type": "object"
}

{
    "new_password1": "string",
    "new_password2": "string",
    "token": "string",
    "uid": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "Serializer for confirming a password reset attempt.",
    "properties": {
        "new_password1": {
            "maxLength": 128,
            "type": "string"
        },
        "new_password2": {
            "maxLength": 128,
            "type": "string"
        },
        "token": {
            "type": "string"
        },
        "uid": {
            "type": "string"
        }
    },
    "required": [
        "new_password1",
        "new_password2",
        "token",
        "uid"
    ],
    "type": "object"
}

Response 200 OK

{
    "detail": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "readOnly": true,
            "type": "string"
        }
    },
    "required": [
        "detail"
    ],
    "type": "object"
}

GET /api/auth/providers/

Description

Get the list of providers.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "mfa_required": true,
            "password_forgotten_enabled": true,
            "providers": [
                {
                    "configured": true,
                    "connect": "string",
                    "display_name": "string",
                    "id": "string",
                    "login": "string",
                    "name": "string"
                }
            ],
            "registration_enabled": true,
            "sso_enabled": true,
            "sso_registration": true
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/SocialProviderListResponse"
            },
            "type": "array"
        }
    },
    "type": "object"
}

POST /api/auth/registration/

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org",
    "password1": "string",
    "password2": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password1": {
            "type": "string",
            "writeOnly": true
        },
        "password2": {
            "type": "string",
            "writeOnly": true
        },
        "username": {
            "maxLength": 150,
            "minLength": 1,
            "type": "string"
        }
    },
    "required": [
        "password1",
        "password2",
        "username"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "password1": "string",
    "password2": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password1": {
            "type": "string",
            "writeOnly": true
        },
        "password2": {
            "type": "string",
            "writeOnly": true
        },
        "username": {
            "maxLength": 150,
            "minLength": 1,
            "type": "string"
        }
    },
    "required": [
        "password1",
        "password2",
        "username"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "password1": "string",
    "password2": "string",
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        },
        "password1": {
            "type": "string",
            "writeOnly": true
        },
        "password2": {
            "type": "string",
            "writeOnly": true
        },
        "username": {
            "maxLength": 150,
            "minLength": 1,
            "type": "string"
        }
    },
    "required": [
        "password1",
        "password2",
        "username"
    ],
    "type": "object"
}

Response 201 Created

{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "Serializer for Token model.",
    "properties": {
        "key": {
            "maxLength": 100,
            "minLength": 50,
            "type": "string"
        }
    },
    "type": "object"
}

POST /api/auth/registration/resend-email/

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "type": "object"
}

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "type": "object"
}

{
    "email": "derp@meme.org"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "format": "email",
            "type": "string"
        }
    },
    "type": "object"
}

Response 201 Created

{
    "detail": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "readOnly": true,
            "type": "string"
        }
    },
    "required": [
        "detail"
    ],
    "type": "object"
}

POST /api/auth/registration/verify-email/

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true
        }
    },
    "required": [
        "key"
    ],
    "type": "object"
}

{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true
        }
    },
    "required": [
        "key"
    ],
    "type": "object"
}

{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true
        }
    },
    "required": [
        "key"
    ],
    "type": "object"
}

Response 200 OK

{
    "detail": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "readOnly": true,
            "type": "string"
        }
    },
    "required": [
        "detail"
    ],
    "type": "object"
}

GET /api/auth/social/

Description

List SocialAccounts for the currently logged in user

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "date_joined": "2022-04-13T15:42:05.901Z",
            "id": 0,
            "last_login": "2022-04-13T15:42:05.901Z",
            "provider": "string",
            "uid": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/SocialAccount"
            },
            "type": "array"
        }
    },
    "type": "object"
}

POST /api/auth/social/{id}/disconnect/

Description

Disconnect SocialAccount from remote service for the currently logged in user

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
id path integer No

Request body

{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    },
    "type": "object"
}

{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    },
    "type": "object"
}

{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    },
    "type": "object"
}

Response 200 OK

{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    },
    "type": "object"
}

GET /api/auth/user/

Description

Reads and updates UserModel fields Accepts GET, PUT, PATCH methods.

Default accepted fields: username, first_name, last_name Default display fields: pk, username, email, first_name, last_name Read-only fields: pk, email

Returns UserModel fields.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 200 OK

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

PATCH /api/auth/user/

Description

Reads and updates UserModel fields Accepts GET, PUT, PATCH methods.

Default accepted fields: username, first_name, last_name Default display fields: pk, username, email, first_name, last_name Read-only fields: pk, email

Returns UserModel fields.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "type": "object"
}

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "type": "object"
}

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "type": "object"
}

Response 200 OK

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

PUT /api/auth/user/

Description

Reads and updates UserModel fields Accepts GET, PUT, PATCH methods.

Default accepted fields: username, first_name, last_name Default display fields: pk, username, email, first_name, last_name Read-only fields: pk, email

Returns UserModel fields.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Request body

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

Response 200 OK

{
    "email": "derp@meme.org",
    "first_name": "string",
    "last_name": "string",
    "pk": 0,
    "username": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "User model w/o password",
    "properties": {
        "email": {
            "format": "email",
            "readOnly": true,
            "title": "Email address",
            "type": "string"
        },
        "first_name": {
            "maxLength": 150,
            "type": "string"
        },
        "last_name": {
            "maxLength": 150,
            "type": "string"
        },
        "pk": {
            "readOnly": true,
            "title": "ID",
            "type": "integer"
        },
        "username": {
            "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
            "maxLength": 150,
            "pattern": "^[\\w.@+-]+$",
            "type": "string"
        }
    },
    "required": [
        "email",
        "pk",
        "username"
    ],
    "type": "object"
}

Schemas

EmailAddress

Name Type
email string()
id integer
primary boolean
user integer
verified boolean

Login

Name Type
email string()
password string
username string

PaginatedEmailAddressList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<EmailAddress>

PaginatedSocialAccountList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<SocialAccount>

PaginatedSocialProviderListResponseList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<SocialProviderListResponse>

PasswordChange

Name Type
new_password1 string
new_password2 string

PasswordReset

Name Type
email string()

PasswordResetConfirm

Name Type
new_password1 string
new_password2 string
token string
uid string

PatchedUserDetails

Name Type
email string()
first_name string
last_name string
pk integer
username string

Register

Name Type
email string()
password1 string
password2 string
username string

ResendEmailVerification

Name Type
email string()

RestAuthDetail

Name Type
detail string

SocialAccount

Name Type
date_joined string(date-time)
id integer
last_login string(date-time)
provider string
uid string

SocialConnect

Name Type
access_token string
code string
id_token string

SocialProvider

Name Type
configured boolean
connect string(uri)
display_name string
id string
login string(uri)
name string

SocialProviderListResponse

Name Type
mfa_required boolean
password_forgotten_enabled boolean
providers Array<SocialProvider>
registration_enabled boolean
sso_enabled boolean
sso_registration boolean

Token

Name Type
key string

UserDetails

Name Type
email string()
first_name string
last_name string
pk integer
username string

VerifyEmail

Name Type
key string

Security schemes

Name Type Scheme Description
basicAuth http basic
cookieAuth apiKey
tokenAuth apiKey Token-based authentication with required prefix "Token"

More documentation

More information about InvenTree in the official docs


For more information: https://docs.inventree.org