Wallrus :: Toolbox API Documentation

Postman collection → OpenAPI spec →

Introduction

API that provides a set of components that can be used in different projects.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_PROJECT_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

⚠️ Wallrus will provide the project token required to authenticate your requests. ⚠️

AI assistant

APIs for our openAI assistant

Generate assistant's response

POST
https://toolbox.local.wallrus.dev
/api/v1/assistant
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/assistant" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"message\": \"What\'s the capital of France?\",
    \"assistant_id\": \"asst_xxx\"
}"
Example response:
{
    "response": "If you enjoy ..."
}
{
    "message": "Unauthenticated"
}
{
    "message": "The message field is required.",
    "errors": {
        "message": [
            "The message field is required."
        ]
    }
}

Activity Logs

APIs for logging and retrieving activity logs for the authenticated project.

List activity logs for the authenticated project.

GET
https://toolbox.local.wallrus.dev
/api/v1/activities
requires authentication

Supports optional filtering by multiple parameters.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

user_id
string

Optional. Filter activities by user ID.

Example:
sequi
type
string

Optional. Filter activities by activity type name.

Example:
image-generation.
value
integer

Optional. Filter activities by exact value match.

Example:
6
message
string

Optional. Filter activities by partial message match.

Example:
sequi
metadata
object

Optional. Filter activities by metadata fields.

Example:
{"Country":"Canada","Gender":"Female"}
date_range
object

Optional. Filter activities by date range.

Example:
{"start":"2023-01-01 00:00:00","end":"2023-01-31 23:59:59"}
date_range.start
string

This field is required when date_range is present. Must be a valid date.

Example:
2025-10-09T19:23:57
date_range.end
string

This field is required when date_range is present. Must be a valid date. Must be a date after or equal to date_range.start.

Example:
2108-10-21
created_at
string

Must be a valid date.

Example:
2025-10-09T19:23:57
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/activities?user_id=sequi&type=image-generation.&value=6&message=sequi&metadata[Country]=Canada&metadata[Gender]=Female&date_range[start]=2023-01-01+00%3A00%3A00&date_range[end]=2023-01-31+23%3A59%3A59&created_at=2025-10-09T19%3A23%3A57" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "data": [
        {
            "user_id": "uuid-2",
            "type": "image-generation",
            "value": 100,
            "message": "User generated an image",
            "metadata": {
                "model": "stable-diffusion",
                "Country": "Canada"
            },
            "created_at": "2025-04-25T12:00:00.000000Z"
        }
    ]
}
{
    "message": "Unauthenticated."
}
{
    "message": "The date range cannot be empty.",
    "errors": {
        "date_range": [
            "The date range cannot be empty."
        ]
    }
}
{
    "message": "Both start and end dates are required when using date_range filter.",
    "errors": {
        "date_range.start": [
            "The date range start field is required when date range is present."
        ],
        "date_range.end": [
            "The date range end field is required when date range is present."
        ]
    }
}
{
    "message": "The date range end must be a date after or equal to date range start.",
    "errors": {
        "date_range.end": [
            "The date range end must be a date after or equal to date range start."
        ]
    }
}

Create a new activity log entry.

POST
https://toolbox.local.wallrus.dev
/api/v1/activities
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/activities" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": \"uuid-1.\",
    \"type\": \"image-generation.\",
    \"value\": 6,
    \"message\": \"sequi\",
    \"metadata\": []
}"
Example response:
{
    "message": "Activity log created successfully."
}
{
    "message": "The specified activity type does not exist for this project.",
    "errors": []
}
{
    "message": "Unauthenticated."
}
{
    "message": "User does not belong to the authenticated project.",
    "errors": []
}
{
    "message": "User not found.",
    "errors": []
}
{
    "message": "The type field is required.",
    "errors": {
        "type": [
            "The type field is required."
        ]
    }
}

List all available activity types or a specific type by ID.

GET
https://toolbox.local.wallrus.dev
/api/v1/activities/types/{id?}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer

Optional. The ID of the activity type to retrieve.

Example:
1
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/activities/types/1" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "data": [
        {
            "id": 1,
            "name": "image-generation",
            "description": "Image generation activity",
            "metadata": [
                {
                    "key": "ip",
                    "value": "127.0.0.1",
                    "active": true
                }
            ],
            "created_at": "2025-06-03T12:00:00.000000Z",
            "updated_at": "2025-06-03T12:00:00.000000Z"
        }
    ]
}
{
    "message": "Unauthenticated."
}
{
    "message": "Activity type not found."
}

Get a summary of activity logs for the authenticated project.

GET
https://toolbox.local.wallrus.dev
/api/v1/activities/summary
requires authentication

Returns activity counts per type and the total count.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

user_id
string

Optional. Filter activities by user ID. The user must exist and belong to the authenticated project.

Example:
sequi
type
string

Optional. Filter activities by activity type name.

Example:
image-generation.

Body Parameters

Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/activities/summary?user_id=sequi&type=image-generation." \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": \"4d90902b-2925-34b1-aa9f-611860a391a0\",
    \"type\": \"sequi\"
}"
Example response:
{
    "data": [
        {
            "type": "image-generation",
            "count": 5
        },
        {
            "type": "quiz-answer",
            "count": 3
        }
    ],
    "total_activities": 8
}
{
    "message": "Unauthenticated."
}
{
    "message": "User does not belong to the authenticated project."
}
{
    "message": "User not found."
}
{
    "message": "The user id field must be a valid UUID.",
    "errors": {
        "user_id": [
            "The user id field must be a valid UUID."
        ]
    }
}

Authentication

APIs for user authentication

Initiate the two-factor authentication process.

POST
https://toolbox.local.wallrus.dev
/api/v1/users/login/initiate
requires authentication

This endpoint initiates a 2FA request for a website. It sends a 2FA code to the user's email or phone number. And it will return the handshake ID for the 2FA process. The user must exist and be active.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/users/login/initiate" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"recipient\": \"user@example.com or +1234567890\"
}"
Example response:

Authenticate a user

POST
https://toolbox.local.wallrus.dev
/api/v1/users/login/authenticate
requires authentication

This endpoint validates the provided 2FA code against the handshake and returns user data if successful.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/users/login/authenticate" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"handshake\": \"9e88ca80-5fa3-44b7-aebf-3f517d502abb\",
    \"code\": \"624983\"
}"
Example response:

Gemini API

APIs for interacting with the Gemini Video API.

Generate a video using the Gemini API.

POST
https://toolbox.local.wallrus.dev
/api/v1/gem/video
requires authentication

This endpoint allows to generate a video based on a prompt and an optional image. It initiates the video generation process and queues a job to poll for completion. A webhook URL is used to notify the caller when the video is ready.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/gem/video" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "uid="user-request-123""\
    --form "prompt="A cat wearing a superhero costume flying over a city""\
    --form "negative_prompt="blurry, low quality""\
    --form "webhook="https://example.com/webhook/gemini-video""\
    --form "sample_count=2"\
    --form "duration_seconds=5"\
    --form "aspect_ratio="landscape""\
    --form "image=@/tmp/phpo3v47869gqmkcipKBpA" 
Example response:
{
    "message": "Video generation has been queued successfully.",
    "operation_name": "models/veo-2.0-generate-001/operations/12345abcdef",
    "uid": "user-request-123"
}
{
    "error": "Failed to process uploaded image.",
    "details": "Error message details"
}
{
    "message": "The given data was invalid.",
    "errors": {
        "image": [
            "The image field is required."
        ],
        "uid": [
            "The uid field is required."
        ],
        "prompt": [
            "The prompt field is required."
        ],
        "webhook": [
            "The webhook field is required."
        ]
    }
}
{
    "error": "Failed to initiate video generation.",
    "details": {
        "service_message": "The downstream service returned an error."
    }
}
{
    "error": "Failed to get operation name from Gemini API."
}

Stream video content from the Gemini API.

GET
https://toolbox.local.wallrus.dev
/api/v1/gem/video/{mediaId}
requires authentication

This endpoint streams video content directly from the Gemini API using the provided media ID.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

mediaId
string
required

The ID of the media to stream.

Example:
ft1rknu4azjb
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/gem/video/ft1rknu4azjb" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "Accept-Ranges": "bytes",
    "Cache-Control": "public, max-age=31536000",
    "Content-Disposition": "inline; filename=\"ft1rknu4azjb.mp4\"",
    "Content-Length": "12345678",
    "Content-Type": "video/mp4",
}
{
    "error": "Failed to stream video."
}
{
    "error": "Error connecting to video API."
}

Image Generation

APIs for Stable Diffusion image generation

Get the list of variables assigned to the project.

GET
https://toolbox.local.wallrus.dev
/api/v1/sd/variables
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/sd/variables" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "variables": {
        "style": [
            "80sFashion",
            "racecarDriver",
            "superHero",
            "clayman"
        ],
        "gender": [
            "male",
            "female",
            "neutral"
        ]
    }
}
{
    "error": "No variables found"
}

Generate the image

POST
https://toolbox.local.wallrus.dev
/api/v1/sd/generate
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/sd/generate" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "uid=user123"\
    --form "style=superHero"\
    --form "webhook=sequi"\
    --form "automatic=sequi"\
    --form "controlnet=coolpose1."\
    --form "gender=sequi"\
    --form "age_range=sequi"\
    --form "body_shape=sequi"\
    --form "hair_color=sequi"\
    --form "hair_length=sequi"\
    --form "hair_style=sequi"\
    --form "skin_color=sequi"\
    --form "facial_hair=sequi"\
    --form "ethnicity=sequi"\
    --form "image=@/tmp/phpg4nrqmgvjk4adnlkhMo" 
Example response:
{
    "prompt_id": "f825155c-0a29-4a61-9c08-c5729c95f3b4",
    "number": 51,
    "node_errors": [],
    "server": "https://comfyui-04.wallrus.tech",
    "queue": 8
}
{
    "message": "Unauthenticated"
}
{
    "error": "No authorized ComfyUI servers found"
}
{
    "error": "'Failed to generate prompt: reasons"
}
{
    "error": "'Failed to upload image"
}
{
    "message": "Server Error"
}

Upscale the image

POST
https://toolbox.local.wallrus.dev
/api/v1/sd/upscale
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/sd/upscale" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "uid=user123"\
    --form "webhook=sequi"\
    --form "image=@/tmp/phpjlmqu6tfjhur5bjIElo" 
Example response:
{
    "prompt_id": "da8ba155-b095-4c2b-b112-454526450e79",
    "number": 15,
    "node_errors": []
}
{
    "message": "Unauthenticated"
}
{
    "error": "No authorized ComfyUI servers found"
}
{
    "error": "'Failed to generate prompt: reasons"
}
{
    "error": "'Failed to upload image"
}
{
    "message": "Server Error"
}

Make a video from the image

POST
https://toolbox.local.wallrus.dev
/api/v1/sd/video
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/sd/video" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "uid=user123"\
    --form "webhook=sequi"\
    --form "image=@/tmp/php1udijr9h3slvbCoodGp" 
Example response:
{
    "prompt_id": "da8ba155-b095-4c2b-b112-454526450e79",
    "number": 15,
    "node_errors": []
}
{
    "message": "Unauthenticated"
}
{
    "error": "No authorized ComfyUI servers found"
}
{
    "error": "'Failed to generate prompt: reasons"
}
{
    "error": "'Failed to upload image"
}
{
    "message": "Server Error"
}

Proxy the output media (image or video) from the ComfyUI server.

GET
https://toolbox.local.wallrus.dev
/api/v1/sd/proxy/{serverId}/{subfolder}/{filename}

The access is public, no authentication is required.

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

serverId
string
required

The server ID.

Example:
1
subfolder
string
required

The subfolder.

Example:
example-project
filename
string
required

The filename.

Example:
output_1.png or video_1.mp4
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/sd/proxy/1/example-project/output_1.png or video_1.mp4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
binary media file
{
    "error": "Server not found"
}
{
    "error": "Failed to fetch media"
}

Prize Management

APIs for managing prizes

Get all prizes and prize pools for the authenticated project.

GET
https://toolbox.local.wallrus.dev
/api/v1/prizes
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/prizes" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
[
    {
        "prizePoolId": 1,
        "order": 0,
        "prizePoolName": "Pool A",
        "prizes": [
            {
                "name": "Test Prize mollitia",
                "available_quantity": 5
            },
            {
                "name": "Test Prize sequi",
                "available_quantity": 1
            }
        ]
    }
]
{
    "error": "No prize pools found"
}

Execute a draw for the given prize pool and user identifier.

POST
https://toolbox.local.wallrus.dev
/api/v1/prizes-pool/{prizePoolId}/draw
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

prizePoolId
string
required

The id of the prize pool.

Example:
1

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/prizes-pool/1/draw" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"uid\": \"user123\"
}"
Example response:
{
    "isWinner": false,
    "prize": null
}
{
    "isWinner": true,
    "prize": {
        "prizeId": 10,
        "name": "Test Prize qui"
    }
}
{
    "error": "Prize pool not found"
}

Quiz Management

APIs for quizzes

Get all quizzes for the authenticated project.

GET
https://toolbox.local.wallrus.dev
/api/v1/quizzes
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/quizzes" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
[
    {
        "id": 1,
        "name_en": "Quiz 1",
        "name_fr": "Quiz 1",
        "description_en": "Description 1",
        "description_fr": "Description 1",
        "image_en": "quiz1_en.jpg",
        "image_fr": "quiz1_fr.jpg"
    },
    {
        "id": 2,
        "name_en": "Quiz 2",
        "name_fr": "Quiz 2",
        "description_en": "Description 2",
        "description_fr": "Description 2",
        "image_en": "quiz2_en.jpg",
        "image_fr": "quiz2_fr.jpg"
    }
]
{
    "message": "Unauthenticated."
}

Get a quiz by ID.

GET
https://toolbox.local.wallrus.dev
/api/v1/quizzes/{id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The quiz ID.

Example:
1
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/quizzes/1" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "id": 1,
    "name_en": "Quiz 1",
    "name_fr": "Quiz 1",
    "description_en": "Description 1",
    "description_fr": "Description 1",
    "image_en": "quiz1_en.jpg",
    "image_fr": "quiz1_fr.jpg",
    "questions": [
        {
            "id": 1,
            "quiz_id": 1,
            "question_en": "Question 1",
            "question_fr": "Question 1",
            "image_en": "question1_en.jpg",
            "image_fr": "question1_fr.jpg",
            "answers": [
                {
                    "id": 1,
                    "quiz_question_id": 1,
                    "answer_en": "Answer 1",
                    "answer_fr": "Answer 1",
                    "image_en": "answer1_en.jpg",
                    "image_fr": "answer1_fr.jpg",
                    "is_correct": 1
                },
                {
                    "id": 2,
                    "quiz_question_id": 1,
                    "answer_en": "Answer 2",
                    "answer_fr": "Answer 2",
                    "image_en": "answer2_en.jpg",
                    "image_fr": "answer2_fr.jpg",
                    "is_correct": 0
                }
            ]
        }
    ]
}
{
    "message": "Unauthenticated."
}
{
    "message": "Quiz not found"
}

Two-Factor Authentication

APIs for managing two-factor authentication

Initiate the two-factor authentication process.

POST
https://toolbox.local.wallrus.dev
/api/v1/2fa/initiate
requires authentication

This endpoint initiates a 2FA request for a website. It sends a 2FA code to the user's email or phone number. And it will return the handshake ID for the 2FA process.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/2fa/initiate" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"recipient\": \"user@example.com or +1234567890\"
}"
Example response:
{
    "message": "2FA code sent to user@example.com",
    "data": {
        "handshake": "9bd24b7c-9208-4f4c-b388-8d6620b54cb9",
        "recipient": "user@example.com",
        "expires_at": "2024-04-16T13:55:18.919768Z"
    }
}
{
    "message": "The recipient field is required.",
    "errors": {
        "recipient": [
            "The recipient field is required."
        ]
    }
}
{
    "message": "A 2FA request is already pending for user@example.com"
}
{
    "message": "Failed to send 2FA code."
}

Verify the two-factor authentication code.

POST
https://toolbox.local.wallrus.dev
/api/v1/2fa/validate
requires authentication

This endpoint verifies the 2FA code sent to the user. It checks if the code is valid and not expired.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/2fa/validate" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"handshake\": \"9bd24b7c-9208-4f4c-b388-8d6620b54cb9\",
    \"code\": \"123456\"
}"
Example response:
{
    "message": "2FA verified",
    "data": {
        "handshake": "9bd24b7c-9208-4f4c-b388-8d6620b54cb9",
        "recipient": "user@example.com"
    }
}
{
    "message": "Invalid 2FA code or expired."
}
{
    "message": "The handshake field is required.",
    "errors": {
        "handshake": [
            "The handshake field is required."
        ]
    }
}

Users Management

APIs for managing users

List all users in the project

GET
https://toolbox.local.wallrus.dev
/api/v1/users
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/users" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
[
    {
        "id": "uuid-1",
        "first_name": "John",
        "last_name": "Doe",
        "username": null,
        "role": "user",
        "email": "john@example.com",
        "phone": null,
        "verified_at": null,
        "is_active": false,
        "metadata": {
            "DOB": "01/01/1970",
            "Country": "USA"
        },
        "avatar": "https://example.com/path/to/avatar1.jpg"
    },
    {
        "id": "uuid-2",
        "first_name": "John",
        "last_name": "Doe",
        "username": null,
        "role": "user",
        "email": "john.doe@example.com",
        "phone": null,
        "verified_at": null,
        "is_active": false,
        "metadata": {
            "DOB": "01/01/1970",
            "Country": "USA"
        },
        "avatar": null
    }
]
{
    "message": "Unauthenticated."
}
{
    "message": "No users found"
}

Get all available roles for users

GET
https://toolbox.local.wallrus.dev
/api/v1/users/roles
requires authentication

This endpoint returns all available roles that can be assigned to users.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/users/roles" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "roles": [
        "user",
        "admin",
        "moderator",
        "guest"
    ]
}
{
    "message": "Unauthenticated."
}
{
    "message": "No roles found"
}

Create a new user for a specific project

POST
https://toolbox.local.wallrus.dev
/api/v1/users
requires authentication

This endpoint accepts JSON data for user creation. All fields are optional, any validation must be done on the client side.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/users" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"Charlize\",
    \"last_name\": \"Theron\",
    \"username\": \"mango\",
    \"role\": \"user\",
    \"email\": \"hello@wallrus.dev\",
    \"phone\": \"+15145555555\",
    \"metadata\": {
        \"DOB\": \"07\\/08\\/1975\",
        \"Country\": \"South Africa\"
    },
    \"auto_activate\": false
}"
Example response:
{
    "id": "9e84e060-6057-4f67-ae22-18a7ef24114b",
    "first_name": "Charlize",
    "last_name": "Theron",
    "username": "mango",
    "role": "user",
    "email": "hello@wallrus.dev",
    "phone": "+15145555555",
    "verified_at": null,
    "is_active": false,
    "metadata": {
        "DOB": "07/08/1975",
        "Country": "South Africa"
    },
    "avatar": null,
    "handshake": "9e96985f-c18d-44a6-adf6-21ba1efb5716"
}
{
    "message": "Unauthenticated."
}
{
    "message": "Failed to create user."
}
{
    "message": "Failed to send verification code."
}
{
    "message": "The email has already been taken.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}
{
    "message": "The phone has already been taken.",
    "errors": {
        "phone": [
            "The phone has already been taken."
        ]
    }
}
{
    "message": "The username has already been taken.",
    "errors": {
        "username": [
            "The username has already been taken."
        ]
    }
}

Verify Registration via 2FA

POST
https://toolbox.local.wallrus.dev
/api/v1/users/verify
requires authentication

This endpoint validates the provided 2FA code against the user's handshake and marks the user as verified if successful.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/users/verify" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"handshake\": \"9e88ca80-5fa3-44b7-aebf-3f517d502abb\",
    \"code\": \"624983\",
    \"user_id\": \"9e84e060-6057-4f67-ae22-18a7ef24114b\"
}"
Example response:
{
    "message": "2FA verified",
    "data": {
        "user_id": "9e84e060-6057-4f67-ae22-18a7ef24114b"
    }
}
{
    "message": "Invalid 2FA code or expired."
}
{
    "message": "Invalid user"
}
{
    "message": "Unauthenticated."
}
{
    "message": "The user_id field is required.",
    "errors": {
        "user_id": [
            "The user_id field is required."
        ]
    }
}
{
    "message": "User already verified"
}

Get a specific user

GET
https://toolbox.local.wallrus.dev
/api/v1/users/{id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The ID of the user.

Example:
9e84e060-6057-4f67-ae22-18a7ef24114b
Example request:
curl --request GET \
    --get "https://toolbox.local.wallrus.dev/api/v1/users/9e84e060-6057-4f67-ae22-18a7ef24114b" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "id": "9e84e060-6057-4f67-ae22-18a7ef24114b",
    "first_name": "John",
    "last_name": "Doe",
    "username": "johndoe",
    "role": "user",
    "email": "john.doe@example.com",
    "phone": "+15145555555",
    "verified_at": "2025-04-01T12:00:00.000000Z",
    "is_active": true,
    "metadata": {
        "DOB": "01/01/1990",
        "Country": "USA"
    },
    "avatar": "https://toolbox.local.wallrus.dev/storage/public/avatars/HgnTRjf7AhrhA9cw1xHW9FgyZpzOvy2marEJGtp3.jpg"
}
{
    "message": "Unauthenticated."
}
{
    "message": "User not found"
}

Resend 2FA code for user registration

POST
https://toolbox.local.wallrus.dev
/api/v1/users/{id}/regen_2fa
requires authentication

This endpoint resends a new 2FA code to the user (email or phone) for registration verification. Only allowed if the user is not yet verified.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The ID of the user.

Example:
9e84e060-6057-4f67-ae22-18a7ef24114b
Example request:
curl --request POST \
    "https://toolbox.local.wallrus.dev/api/v1/users/9e84e060-6057-4f67-ae22-18a7ef24114b/regen_2fa" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "message": "2FA code resent to user@example.com",
    "data": {
        "handshake": "uuid",
        "recipient": "user@example.com",
        "expires_at": "2025-05-29T13:55:18.919768Z"
    }
}
{
    "message": "Unauthenticated."
}
{
    "message": "User not found"
}
{
    "message": "User already verified"
}
{
    "message": "No recipient available for 2FA"
}

Update a specific user

PUT
https://toolbox.local.wallrus.dev
/api/v1/users/{id}
requires authentication

This endpoint accepts JSON data for user updates. All fields are optional, validation must be done on the client side.

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The ID of the user to update.

Example:
9e84e060-6057-4f67-ae22-18a7ef24114b

Body Parameters

Example request:
curl --request PUT \
    "https://toolbox.local.wallrus.dev/api/v1/users/9e84e060-6057-4f67-ae22-18a7ef24114b" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"Jane\",
    \"last_name\": \"Smith\",
    \"username\": \"mango\",
    \"role\": \"user\",
    \"email\": \"jane.smith@example.com\",
    \"phone\": \"+15145556666\",
    \"metadata\": {
        \"DOB\": \"14\\/02\\/1985\",
        \"Country\": \"Canada\"
    },
    \"is_active\": true
}"
Example response:
{
    "id": "9e84e060-6057-4f67-ae22-18a7ef24114b",
    "first_name": "Jane",
    "last_name": "Smith",
    "username": "janesmith",
    "role": "admin",
    "email": "jane.smith@example.com",
    "phone": "+15145556666",
    "verified_at": "2025-04-01T12:00:00.000000Z",
    "is_active": true,
    "metadata": {
        "DOB": "14/02/1985",
        "Country": "Canada"
    },
    "avatar": "https://toolbox.local.wallrus.dev/storage/public/avatars/HgnTRjf7AhrhA9cw1xHW9FgyZpzOvy2marEJGtp3.jpg"
}
{
    "message": "Unauthenticated."
}
{
    "message": "User not found"
}
{
    "message": "The email has already been taken.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}

Delete a specific user

DELETE
https://toolbox.local.wallrus.dev
/api/v1/users/{id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_PROJECT_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The ID of the user to delete.

Example:
9e84e060-6057-4f67-ae22-18a7ef24114b
Example request:
curl --request DELETE \
    "https://toolbox.local.wallrus.dev/api/v1/users/9e84e060-6057-4f67-ae22-18a7ef24114b" \
    --header "Authorization: Bearer {YOUR_PROJECT_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "message": "User deleted successfully"
}
{
    "message": "Unauthenticated."
}
{
    "message": "User not found"
}