Download OpenAPI specification:
API for Via-Alias. This API can be used to create and manage redirects as well as users.
Authentication:
Most Endpoints require a Bearer token obtained from POST /api/auth/login.
Include it in the Authorization header as Bearer <token>.
Authenticates a user with their credentials and returns a signed JWT access token on success.
The token should be included in subsequent requests as a Bearer token in the Authorization header.
| name required | string |
| pw required | string |
{- "name": "luke",
- "pw": "superjedimeister1337"
}{- "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoiMjE1ZDU3YzAtMDM1My00Nzc2LWFjNTYtZDBiZWY5YTUxZTJjIiwiaXNfYWRtaW4iOmZhbHNlLCJleHAiOjE3NzI4OTczOTMsImp0aSI6IjRiZTcyNTUwLTZlYTUtNGQ3NS1iM2Q4LTdiNzJiYTEwZjE1MiJ9.qwy7zLn611SkZzI5mFJPwtRGjvjD0xmprSoMUII7xjcxRPjAbTEKH9gFIewYRGdwtcg0I-EhnttYMNZkqlmZNQ",
- "expires_in": 900,
- "token_type": "Bearer"
}Creates a new redirect. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
| alias required | string |
| url required | string |
{- "alias": "gh",
}{- "alias": "gh",
}Updates the registered url of a redirect. Changing the alias requires deleting the redirect and recreating it with the desired alias.
Requires authentication. Pass a JWT as a bearer token in the Authorization header.
| alias required | string The redirect alias. |
| url required | string |
{
}{- "alias": "gh",
}Changes the user-password. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
| current_pw required | string |
| new_pw required | string |
{- "current_pw": "superjedimeister1337",
- "new_pw": "kfdslfoi32j4ekil32jm"
}Registers a new user. Requires a generated user registration token.
| name required | string |
| pw required | string |
| token required | string |
{- "name": "vader",
- "pw": "deathstar_pilot_extra_ordinaire1337",
- "token": "8162f4c7-e32e-45bc-9089-bfd9d024e39e"
}{- "id": "b208ae42-2ab8-47b9-9c69-bdd7300e5847",
- "name": "vader"
}Returns a list of all currently created redirects. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
{- "redirects": [
- {
- "alias": "gh",
- "id": "ea07b388-0da5-4640-b30d-2f90467a612c",
- "owner": "7484bf63-0c9a-41af-884e-e0fea7f0bb8e",
}
]
}Requests a user registration token. This token is only valid for one-time use and has an expiration time in seconds. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
{- "registration_token": "85e83a5a-4f49-4ea7-9df9-93c2c2cc9b8f",
- "token_ttl": 1800
}Returns a list of all users. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
{- "users": [
- {
- "id": "d64bcaad-8d86-48d2-b1f3-f1c03ac30fa3",
- "is_admin": false,
- "name": "luke"
}
]
}Returns data about a specific user. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
| id required | string The user id. |
{- "id": "d64bcaad-8d86-48d2-b1f3-f1c03ac30fa3",
- "is_admin": false,
- "name": "luke"
}Deletes a user via its uiserid. This will also delete all of the users registered redirects. Requires authentication. Pass a JWT as a bearer token in the Authorization header.
| id required | string The user id. |
{- "deleted": {
- "redirects": 5
}, - "user_id": "d64bcaad-8d86-48d2-b1f3-f1c03ac30fa3"
}