technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
# Admin: Create API Token

## Endpoint

`/api/admin/sessions/createToken`

## Method

GET

## Description

Creates a non-expiring API token that can be used with automation scripts to make API calls. The token allows access to API calls with the same privileges as the user. It is advised to create a separate user with limited permissions for generating API tokens. The token cannot be used to change the user's password or update the user profile details.

## Authentication

Required. Token must be provided via the `token` parameter.

## Permissions

Administration: Modify

## Parameters

| Name | Type | Required | Conditional | Description |
|------|------|----------|-------------|-------------|
| `token` | string | Yes | No | The session token generated by the `login` or the `createToken` call. |
| `user` | string | Yes | No | The username for the user account for which to generate the API token. |
| `tokenName` | string | Yes | No | The name of the created token to identify its session. |

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `username` | string | The username the token was created for. |
| `tokenName` | string | The name assigned to the token. |
| `token` | string | The full API token string. This is the only time the full token is returned. |

## Conditional Logic Notes

- The generated token inherits the privileges of the specified user.
- The token is non-expiring and persists until explicitly deleted.
- The token cannot be used for password changes or profile updates, even if the user has those privileges.

## Edge Cases

- The full token value is only returned once at creation time. It cannot be retrieved again later; only the `partialToken` is visible in session listings.
- Creating a token for a disabled user account may still succeed, but the token would be unusable if the account remains disabled.