vkovalov-backend API
Authentication API: password login, two-factor login with authenticator-app codes (TOTP), and session renewal with refresh tokens, and self-service profile editing and 2FA enrollment with Google Authenticator. It also serves the skills, skill categories, work experience, education, projects, services and FAQs shown on the site, with endpoints to manage them, and stores uploaded images and videos, which it serves itself under /files/{id}.
Basics#
Base URL: https://api.vkovalov.dev
When running the server locally, use http://localhost:8080 instead (or whichever PORT is configured).
Request and response bodies are JSON. Send Content-Type: application/json with every POST, PUT and PATCH. The one exception is Upload a file, which takes multipart/form-data.
The file, experience, education, project and service endpoints use camelCase field names, such as companyName. The older endpoints use snake_case, such as order_index.
Every error has the same shape, with the HTTP status code carrying the meaning:
{ "error": "Invalid request payload" }
Protected endpoints need an access token in the Authorization header. The scheme is case-sensitive:
Authorization: Bearer <access_token>
Routes under /admin also need an account whose role can manage content: super_admin, admin or editor. Other roles get 403.
Browsers can call the API only from http://localhost:3000, https://admin.vkovalov.dev and https://vkovalov.dev, with credentials. Requests from any other origin get no CORS headers, so the browser blocks them. Images loaded from /files/{id} with an <img> tag need no CORS.
Login flow#
- Call Login with the email and password.
- If the response has
"requires_2fa": false, it contains anaccess_tokenand arefresh_token, and you are logged in. - If it has
"requires_2fa": true, it contains apre_auth_tokeninstead. Ask the user for the 6-digit code from their authenticator app (or one of their recovery codes) and send it with thepre_auth_tokento Verify 2FA to receive the two tokens. - Send the
access_tokenwith every protected request. Before it expires (or when a request returns401), call Refresh with therefresh_tokento get a new pair. - To end the session, call Logout.
Five wrong passwords or 2FA codes in a row lock the account for 15 minutes. This counts every attempt at Login, Verify 2FA, Disable 2FA and New recovery codes. While the account is locked, these endpoints answer 429, even for correct credentials, with a Retry-After header giving the seconds left. A successful login resets the count. Each 2FA code and each recovery code can be used only once.
| Token | Format | Lifetime | Used for |
|---|---|---|---|
access_token | JWT | 15 minutes | The Authorization header of protected endpoints. |
refresh_token | Random string (64 hex characters) | 7 days | Only Refresh. Not accepted by protected endpoints. |
pre_auth_token | JWT | 5 minutes | Only Verify 2FA, as the pre_auth_token field. Protected endpoints reject it with 403. |
The JWTs are signed with HS256. Their payload carries user_id, role, is_2fa and the standard exp, iat, nbf claims. The payload is signed, not encrypted, so a client can read user_id from it.
An account has one refresh token at a time. Every Login, Verify 2FA and Refresh issues a new one and invalidates the previous one, so logging in on a second device ends the refresh ability of the first. Store the refresh token securely: anyone holding it can obtain access tokens until it expires or is replaced.
Two-factor authentication#
A signed-in user can turn on two-factor authentication with Google Authenticator (or any other TOTP app, such as Microsoft Authenticator, 1Password or Authy). It takes two calls, so 2FA only becomes active once the user has proven the app is set up correctly:
- Call Setup 2FA. Show the returned
qr_codeimage and ask the user to scan it in Google Authenticator. For users who cannot scan, also show thesecretso they can type it in. - Ask the user for the 6-digit code the app now shows, and send it to Enable 2FA. The response contains ten recovery codes. Show them to the user once and ask them to keep them somewhere safe: the API cannot show them again.
- From the next login onwards, Login returns
"requires_2fa": trueand the user completes it with Verify 2FA.
Until step 2 succeeds, nothing changes for the user: login works without a code. Calling Setup 2FA again before enabling replaces the pending secret, so a QR code from an earlier attempt stops working.
A recovery code looks like ABCD-EFGH-JKLM-NPQR and replaces an app code wherever one is asked for: in Verify 2FA, Disable 2FA and New recovery codes. Each one works once. Users who have lost their phone log in with a recovery code and then turn 2FA off. New recovery codes replaces the whole set, for example when it runs low.
To turn 2FA off, call Disable 2FA with the password and a code. To move to a new phone, turn 2FA off and enable it again.
Login#
/auth/loginpublicChecks the email and password. The response has one of two shapes, depending on whether the account has 2FA enabled.
Request body
| Field | Type | Required |
|---|---|---|
email | string | Yes |
password | string | Yes |
Example
curl -X POST https://api.vkovalov.dev/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"ada@example.com","password":"correct horse battery"}'
Response 200, 2FA not enabled
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "9b1e4c7f0a2d...",
"requires_2fa": false,
"user": { "id": "3f1c2a9e-...", "email": "ada@example.com", "role": "user", ... }
}
Response 200, 2FA enabled
{
"requires_2fa": true,
"pre_auth_token": "eyJhbGciOiJIUzI1NiIs..."
}
Status codes
| 200 | Password accepted. |
| 400 | Body is not valid JSON. |
| 401 | Unknown email or wrong password. The message is the same for both. |
| 403 | The password is right, but the account is deactivated. |
| 429 | Too many failed attempts: the account is locked for 15 minutes. Retry-After gives the seconds left. |
| 500 | Unexpected server error. |
Verify 2FA#
/auth/2fa/verifypublicSecond login step for accounts with 2FA enabled. Send the pre_auth_token from Login with the 6-digit code or a recovery code; the token identifies the user, so the password step cannot be skipped. Returns the access and refresh tokens.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
pre_auth_token | string | Yes | The pre_auth_token returned by Login, valid for 5 minutes. A user_id field is ignored. |
code | string | Yes | Current 6-digit code from the authenticator app, spaces allowed ("492 817"), or one of the user's recovery codes, with or without dashes and in any case. Each code works only once. |
Example
curl -X POST https://api.vkovalov.dev/auth/2fa/verify \
-H "Content-Type: application/json" \
-d '{"pre_auth_token":"eyJhbGciOiJIUzI1NiIs...","code":"492817"}'
Response 200
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "9b1e4c7f0a2d...",
"requires_2fa": false,
"user": { "id": "3f1c2a9e-...", "email": "ada@example.com", "role": "user", ... }
}
Status codes
| 200 | Code accepted. |
| 400 | Body is not valid JSON, code is missing, or the account has no 2FA configured. |
| 401 | The pre_auth_token is missing, invalid or expired, or the code is wrong, expired or already used. |
| 403 | The token sent is an access token rather than a pre_auth_token, or the account is deactivated. |
| 429 | Too many failed attempts: the account is locked for 15 minutes. Retry-After gives the seconds left. |
| 500 | The server cannot decrypt the account's 2FA secret, so app codes cannot be checked; the error message says so. Recovery codes still work. Otherwise, an unexpected server error. |
Refresh#
/auth/refreshrefresh tokenExchanges a valid refresh token for a new access token and a new refresh token. The refresh token sent is invalidated, so always store the new one from the response. No Authorization header is needed, so this works after the access token has expired.
Request body
| Field | Type | Required |
|---|---|---|
refresh_token | string | Yes |
Example
curl -X POST https://api.vkovalov.dev/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token":"9b1e4c7f0a2d..."}'
Response 200
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "e04a7d2b91c6...",
"requires_2fa": false,
"user": { "id": "3f1c2a9e-...", "email": "ada@example.com", "role": "user", ... }
}
Status codes
| 200 | New token pair issued. |
| 400 | Body is not valid JSON, or refresh_token is missing or empty. |
| 401 | The refresh token is unknown, expired, or was already replaced by a newer one (after a login, refresh or logout). The user must log in again. |
| 403 | The account is deactivated. Its refresh token is cleared. |
| 500 | Unexpected server error. |
Logout#
/auth/logoutaccess tokenInvalidates the account's refresh token, so no new access tokens can be obtained with it. No request body is needed.
Access tokens that were already issued are not revoked and keep working until they expire (at most 15 minutes), so the client should also discard its copy.
Example
curl -X POST https://api.vkovalov.dev/auth/logout \
-H "Authorization: Bearer <access_token>"
Response 200
{
"message": "Successfully logged out"
}
Status codes
| 200 | Logged out. |
| 401 | Header missing, not in the form Bearer <token>, or the access token is invalid or expired. |
| 403 | The token is a pre_auth_token. |
| 500 | Unexpected server error. |
Get profile#
/profileaccess tokenReturns the signed-in user as a user object.
Example
curl https://api.vkovalov.dev/profile \
-H "Authorization: Bearer <access_token>"
Response 200
{
"id": "3f1c2a9e-6f0b-4c1d-9a55-0d6c1f2b7e10",
"email": "ada@example.com",
"first_name": "Ada",
"last_name": "Lovelace",
"avatar_url": "https://cdn.example.com/ada.png",
"role": "user",
"is_totp_enabled": false,
"is_active": true,
"created_at": "2026-09-14T08:12:00Z",
"updated_at": "2026-10-05T09:30:00Z"
}
Status codes
| 200 | Profile returned. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 500 | Unexpected server error. |
Update profile#
/profileaccess tokenChanges the signed-in user's name and avatar and returns the updated user object. Send only the fields you want to change; fields left out keep their value. Send an empty string to remove a value.
Email, password and role cannot be changed here. A body with any other field is rejected with 400.
Request body
| Field | Type | Rules |
|---|---|---|
first_name | string | Optional. Surrounding spaces are trimmed. At most 100 characters. |
last_name | string | Optional. Same rules as first_name. |
avatar_url | string | Optional. An absolute http:// or https:// URL, at most 2048 characters. The API stores the link only; it does not upload or check the image. |
Example
curl -X PATCH https://api.vkovalov.dev/profile \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"last_name":"Lovelace","avatar_url":"https://cdn.example.com/ada.png"}'
Response 200
{
"id": "3f1c2a9e-6f0b-4c1d-9a55-0d6c1f2b7e10",
"email": "ada@example.com",
"first_name": "Ada",
"last_name": "Lovelace",
"avatar_url": "https://cdn.example.com/ada.png",
"role": "user",
"is_totp_enabled": false,
"is_active": true,
"created_at": "2026-09-14T08:12:00Z",
"updated_at": "2026-10-05T09:30:00Z"
}
Status codes
| 200 | Profile updated. |
| 400 | Body is not valid JSON, contains a field that cannot be changed, a name is too long, or avatar_url is not a valid http(s) URL. The error message says which. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 500 | Unexpected server error. |
Setup 2FA#
/profile/2fa/setupaccess tokenStep 1 of enabling 2FA. Creates a new secret for the signed-in user and returns it as a QR code for Google Authenticator. 2FA is not active yet; confirm it with Enable 2FA. No request body is needed.
Example
curl -X POST https://api.vkovalov.dev/profile/2fa/setup \
-H "Authorization: Bearer <access_token>"
Response 200
{
"secret": "5N4EEPRGB7B6JAAWWRNAAVQMMIAKBAEG",
"otpauth_url": "otpauth://totp/MyPortfolio:ada@example.com?algorithm=SHA1&digits=6&issuer=MyPortfolio&period=30&secret=5N4EEPRGB7B6JAAWWRNAAVQMMIAKBAEG",
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAAp..."
}
| Field | Meaning |
|---|---|
qr_code | A 256×256 PNG as a data: URL. Use it directly as an image source, e.g. <img src="…">. |
secret | The same secret as text, for users who type it into the app instead of scanning. |
otpauth_url | The standard otpauth:// link the QR code encodes. On a phone, opening it can add the account to an installed authenticator app. |
The app lists the account as MyPortfolio with the user's email. Treat the secret like a password: show it only to the user and do not store or log it on the client.
Status codes
| 200 | Secret created. Any earlier, unconfirmed secret is replaced. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 409 | 2FA is already enabled for this account, or another request enabled it at the same time. |
| 500 | Unexpected server error. |
Enable 2FA#
/profile/2fa/enableaccess tokenStep 2 of enabling 2FA. Checks a code from the authenticator app against the secret from Setup 2FA and, if it matches, turns 2FA on. Returns the updated user object and the first set of recovery codes. The code used here cannot also be used to log in.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
code | string | Yes | The 6-digit code currently shown in the app. |
Example
curl -X POST https://api.vkovalov.dev/profile/2fa/enable \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"code":"492817"}'
Response 200
{
"user": {
"id": "3f1c2a9e-6f0b-4c1d-9a55-0d6c1f2b7e10",
"email": "ada@example.com",
"role": "user",
"is_totp_enabled": true,
...
},
"recovery_codes": [
"7QXK-M2PA-RJ4D-WZ6N",
"C3HV-9TQE-YB5S-KL2M",
...
]
}
recovery_codes holds ten codes. This is the only time they are shown; the server stores only their hashes.
Status codes
| 200 | 2FA is now enabled. |
| 400 | code is missing, the code is wrong or expired, or there is no pending secret: Setup 2FA was not called first, or its secret can no longer be decrypted and setup must start again. A wrong code does not end the session; let the user try again. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 409 | 2FA is already enabled for this account, or another request changed the pending secret at the same time. |
| 500 | Unexpected server error. |
Disable 2FA#
/profile/2fa/disableaccess tokenTurns 2FA off for the signed-in user and deletes the secret and the recovery codes. It needs the password and a code, so a stolen access token alone cannot remove the second factor. Returns the updated user object with "is_totp_enabled": false. Wrong passwords and codes count towards the lockout.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
password | string | Yes | The account's password. |
code | string | Yes | The 6-digit code currently shown in the app, or a recovery code. |
Example
curl -X POST https://api.vkovalov.dev/profile/2fa/disable \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"password":"correct horse battery","code":"492817"}'
Status codes
| 200 | 2FA is now disabled. |
| 400 | password or code is missing, the password is wrong, or the code is wrong, expired or already used. The session stays valid. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 409 | 2FA is not enabled for this account. |
| 429 | Too many failed attempts: the account is locked for 15 minutes. Retry-After gives the seconds left. |
| 500 | The server cannot decrypt the account's 2FA secret, so app codes cannot be checked; use a recovery code. Otherwise, an unexpected server error. |
New recovery codes#
/profile/2fa/recovery-codesaccess tokenReplaces all of the signed-in user's recovery codes with ten new ones; the old ones stop working. Wrong codes count towards the lockout.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
code | string | Yes | The 6-digit code currently shown in the app, or a recovery code. |
Example
curl -X POST https://api.vkovalov.dev/profile/2fa/recovery-codes \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"code":"492817"}'
Response 200
{
"recovery_codes": [
"7QXK-M2PA-RJ4D-WZ6N",
"C3HV-9TQE-YB5S-KL2M",
...
]
}
Status codes
| 200 | New codes created. Show them to the user once; they cannot be retrieved again. |
| 400 | code is missing, or the code is wrong, expired or already used. The session stays valid. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token; finish Verify 2FA first. |
| 404 | The account behind the token no longer exists. |
| 409 | 2FA is not enabled for this account. |
| 429 | Too many failed attempts: the account is locked for 15 minutes. Retry-After gives the seconds left. |
| 500 | The server cannot decrypt the account's 2FA secret, so app codes cannot be checked; use a recovery code. Otherwise, an unexpected server error. |
List categories#
/categoriespublicReturns every skill category as an array of category objects, sorted by order_index, then name. The array is empty ([]) when there are none.
Example
curl https://api.vkovalov.dev/categories
Response 200
[
{
"id": "8b0f6c1e-2d57-4c39-9c0a-5a1f3f1f2a11",
"name": "Backend",
"slug": "backend",
"description": "Server-side languages and tools",
"order_index": 1,
"created_at": "2026-10-05T09:30:00Z",
"updated_at": "2026-10-05T09:30:00Z"
}
]
Status codes
| 200 | Categories returned. |
| 500 | Unexpected server error. |
List skills#
/skillspublicReturns the visible skills ("is_visible": true) as an array of skill objects, sorted by order_index, then name. The array is empty ([]) when there are none.
Example
curl https://api.vkovalov.dev/skills
Response 200
[
{
"id": "c2a4f0d3-7b1e-4f58-8d7a-91f0a6f2b3c4",
"name": "Go",
"icon": "<svg viewBox=\"0 0 24 24\">...</svg>",
"proficiency_level": "Advanced",
"categories": [
{ "category_id": "8b0f6c1e-2d57-4c39-9c0a-5a1f3f1f2a11", "is_primary": true }
],
"is_visible": true,
"order_index": 1,
"created_at": "2026-10-05T09:30:00Z",
"updated_at": "2026-10-05T09:30:00Z"
}
]
Status codes
| 200 | Skills returned. |
| 500 | Unexpected server error. |
List all skills#
/admin/skillsaccess tokenSame as List skills, but also includes hidden skills ("is_visible": false).
Example
curl https://api.vkovalov.dev/admin/skills \
-H "Authorization: Bearer <access_token>"
Status codes
| 200 | Skills returned. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Create or update a category#
/admin/categoriesaccess token/admin/categories/{id}access tokenPOST creates a category; PUT replaces the one with the given id. Both take the same body and return the saved category object. PUT is a full replacement: a field left out is reset to its empty value.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | At most 100 characters. Surrounding spaces are trimmed. |
slug | string | Yes | At most 100 characters. Surrounding spaces are trimmed. |
description | string | No | |
order_index | number | No | Sort position, ascending. Defaults to 0. |
Example
curl -X POST https://api.vkovalov.dev/admin/categories \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"name":"Backend","slug":"backend","order_index":1}'
Status codes
| 200 | Category updated (PUT). |
| 201 | Category created (POST). |
| 400 | The body is not valid JSON, name or slug is missing or too long, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No category with this id (PUT). |
| 409 | Another category already uses this slug. |
| 500 | Unexpected server error. |
Delete a category#
/admin/categories/{id}access tokenExample
curl -X DELETE https://api.vkovalov.dev/admin/categories/8b0f6c1e-2d57-4c39-9c0a-5a1f3f1f2a11 \
-H "Authorization: Bearer <access_token>"
Response 200
{ "message": "Category deleted" }
Status codes
| 200 | Category deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No category with this id. |
| 409 | Skills are still assigned to the category. Remove it from those skills first. |
| 500 | Unexpected server error. |
Create or update a skill#
/admin/skillsaccess token/admin/skills/{id}access tokenPOST creates a skill; PUT replaces the one with the given id. Both take the same body and return the saved skill object. PUT is a full replacement: a field left out is reset to its empty value, and the category list replaces the previous one.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | At most 100 characters. Surrounding spaces are trimmed. |
icon | string | No | Inline SVG markup, at most 64 KB. Must start with <svg and end with </svg>. Scripts, on* event attributes, foreignObject, embedded frames or objects and javascript: URLs are rejected. An empty string stores no icon. |
proficiency_level | string | No | One of Beginner, Intermediate, Advanced, Expert. Letter case is ignored on input and the value is stored and returned in this spelling. An empty string stores no value. |
categories | array | No | Objects of the form {"category_id": "<UUID>", "is_primary": false}. A category may appear only once, and at most one entry may be primary. |
is_visible | boolean | No | Defaults to false: the skill is hidden from List skills unless this is sent as true. |
order_index | number | No | Sort position, ascending. Defaults to 0. |
Example
curl -X POST https://api.vkovalov.dev/admin/skills \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"name":"Go","proficiency_level":"Advanced","is_visible":true,"order_index":1,"categories":[{"category_id":"8b0f6c1e-2d57-4c39-9c0a-5a1f3f1f2a11","is_primary":true}]}'
Status codes
| 200 | Skill updated (PUT). |
| 201 | Skill created (POST). |
| 400 | The body is not valid JSON, a field breaks the rules above, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No skill with this id (PUT), or a category_id does not exist. |
| 500 | Unexpected server error. |
Delete a skill#
/admin/skills/{id}access tokenExample
curl -X DELETE https://api.vkovalov.dev/admin/skills/c2a4f0d3-7b1e-4f58-8d7a-91f0a6f2b3c4 \
-H "Authorization: Bearer <access_token>"
Response 200
{ "message": "Skill deleted" }
Status codes
| 200 | Skill deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No skill with this id. |
| 500 | Unexpected server error. |
Upload a file#
/admin/files/uploadaccess tokenStores an image or video and returns its ID. Other records reference the file by this ID (for example an experience's logoFileId), and it is served at /files/{id}. The body is multipart/form-data, not JSON.
There is no route to delete a file. When an experience or project stops using a file (it is replaced or removed, or the record is deleted), the file is deleted, unless another experience or project still uses it.
Form fields
| Field | Type | Required | Notes |
|---|---|---|---|
file | file | Yes | A PNG, JPEG, WebP or SVG image, or an MP4 or WebM video (portfolio bucket only). The type is detected from the content: the filename and the part's Content-Type are ignored. SVGs containing scripts, on* event attributes, foreignObject, embedded frames or objects, or javascript: URLs are rejected. |
bucket | string | Yes | logos (files up to 300 KB) or portfolio (up to 1 MB). Experience logos must be uploaded to logos, and project files to portfolio. |
Example
curl -X POST https://api.vkovalov.dev/admin/files/upload \
-H "Authorization: Bearer <access_token>" \
-F "bucket=logos" \
-F "file=@logo.webp"
Response 201
{
"id": "c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"contentType": "image/webp",
"size": 123456
}
size is in bytes.
Status codes
| 201 | File stored. |
| 400 | The body is not multipart/form-data, file is missing or empty, bucket is not logos or portfolio, or the SVG contains unsafe content. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 413 | The file is larger than the bucket allows: 300 KB for logos, 1 MB for portfolio. |
| 415 | The file is not a PNG, JPEG, WebP or SVG image or an MP4 or WebM video, or it is a video sent to a bucket other than portfolio. |
| 500 | Unexpected server error. |
Get a file#
/files/{id}publicReturns the file's content, so the URL can be used directly as an image or video source. URLs the API returns, such as an experience's logoUrl, are relative to the base URL: prefix them with https://api.vkovalov.dev.
Example
<img src="https://api.vkovalov.dev/files/c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef" alt="YozmaTech">
Response headers
| Header | Value |
|---|---|
Content-Type | The type detected at upload: image/png, image/jpeg, image/webp, image/svg+xml, video/mp4 or video/webm. |
Cache-Control | public, max-age=86400 (one day). A file's content never changes; a new upload gets a new ID. |
Status codes
| 200 | File returned. |
| 404 | No file with this id, the id is not a UUID, or the stored content is missing. The body is a JSON error. |
| 500 | Unexpected server error. |
List experiences#
/experiencespublic/admin/experiencesaccess tokenReturns every experience as an array of experience objects: current positions ("isCurrent": true) first, then by startDate, newest first. The array is empty ([]) when there are none. /admin/experiences returns the same list for the admin panel, behind an access token and a content role.
Example
curl https://api.vkovalov.dev/experiences
Response 200
[
{
"id": "5d0c2a8e-61f4-4b1a-9a63-0f2d8c7e4b19",
"companyName": "YozmaTech",
"position": "Senior Go Developer",
"location": "Remote",
"employmentType": "Full-time",
"description": "Backend development",
"logoFileId": "c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"logoUrl": "/files/c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"startDate": "2024-01-01",
"endDate": null,
"isCurrent": true
}
]
Status codes
| 200 | Experiences returned. |
| 401 / 403 | /admin/experiences only: missing or invalid token, a pre_auth_token, or a role that cannot manage content. |
| 500 | Unexpected server error. |
Create or update an experience#
/admin/experienceaccess token/admin/experience/{id}access tokenPOST creates an experience; PUT replaces the one with the given id. Both take the same body and return the saved experience object. PUT is a full replacement: a field left out is cleared. That includes logoFileId, so send the current one back to keep the logo. When the logo changes or is removed, the previous file is deleted, unless another experience still uses it.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
companyName | string | Yes | At most 255 characters. Surrounding spaces are trimmed. |
position | string | Yes | At most 255 characters. Surrounding spaces are trimmed. |
location | string | No | At most 255 characters. An empty string stores no value. |
employmentType | string | No | Free text, for example Full-time. At most 50 characters. An empty string stores no value. |
description | string | No | An empty string stores no value. |
logoFileId | string (UUID) | No | The id of an image uploaded to the logos bucket with Upload a file. null for no logo. |
startDate | string | Yes | YYYY-MM-DD. |
endDate | string | No | YYYY-MM-DD, not before startDate. Must be null or left out when isCurrent is true. |
isCurrent | boolean | No | Defaults to false. |
Example
curl -X POST https://api.vkovalov.dev/admin/experience \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"companyName":"YozmaTech","position":"Senior Go Developer","location":"Remote","employmentType":"Full-time","logoFileId":"c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef","startDate":"2024-01-01","endDate":null,"isCurrent":true}'
Status codes
| 200 | Experience updated (PUT). |
| 201 | Experience created (POST). |
| 400 | The body is not valid JSON, a field breaks the rules above (including a logoFileId that does not exist or is not in the logos bucket), or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No experience with this id (PUT). |
| 500 | Unexpected server error. |
Delete an experience#
/admin/experience/{id}access tokenThe experience's logo file is deleted too, unless another experience or a project still uses it.
Example
curl -X DELETE https://api.vkovalov.dev/admin/experience/5d0c2a8e-61f4-4b1a-9a63-0f2d8c7e4b19 \
-H "Authorization: Bearer <access_token>"
Response 200
{ "message": "Experience deleted" }
Status codes
| 200 | Experience deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No experience with this id. |
| 500 | Unexpected server error. |
List education#
/educationpublicReturns education entries as an array of education objects: ongoing entries (no endDate) first, then by endDate and startDate, newest first. The array is empty ([]) when there are none.
Query parameters
| Parameter | Required | Notes |
|---|---|---|
type | No | Academic or Certification (letter case is ignored) to return only that type. Leave it out for every entry. |
Example
curl "https://api.vkovalov.dev/education?type=Academic"
Response 200
[
{
"id": "0b6f3c2e-8a51-4d0f-9f3e-2c7d1a9b4e61",
"type": "Academic",
"institutionName": "Ivan Franko National University of Lviv",
"degree": "Bachelor",
"fieldOfStudy": "Computer Science",
"location": "Lviv, Ukraine",
"description": null,
"startDate": "2014-09-01",
"endDate": "2018-06-30",
"isCurrent": false,
"createdAt": "2026-11-20T12:00:00Z",
"updatedAt": "2026-11-20T12:00:00Z"
}
]
Status codes
| 200 | Entries returned. |
| 400 | type is not Academic or Certification. |
| 500 | Unexpected server error. |
Create an education entry#
/admin/educationaccess tokenCreates an entry and returns it as an education object.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
type | string | Yes | Academic or Certification. Letter case is ignored on input, and the value is stored and returned in this spelling. |
institutionName | string | Yes | At most 255 characters. Surrounding spaces are trimmed. |
degree | string | No | At most 255 characters. An empty string stores no value. |
fieldOfStudy | string | No | At most 255 characters. An empty string stores no value. |
location | string | No | At most 255 characters. An empty string stores no value. |
description | string | No | An empty string stores no value. |
startDate | string | Yes | YYYY-MM-DD. |
endDate | string | No | YYYY-MM-DD, not before startDate. Must be null or left out when isCurrent is true. |
isCurrent | boolean | No | Defaults to false. |
Example
curl -X POST https://api.vkovalov.dev/admin/education \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"type":"Academic","institutionName":"Ivan Franko National University of Lviv","degree":"Bachelor","fieldOfStudy":"Computer Science","startDate":"2014-09-01","endDate":"2018-06-30"}'
Response 201
{
"id": "0b6f3c2e-8a51-4d0f-9f3e-2c7d1a9b4e61",
"type": "Academic",
"institutionName": "Ivan Franko National University of Lviv",
"degree": "Bachelor",
"fieldOfStudy": "Computer Science",
"location": "Lviv, Ukraine",
"description": null,
"startDate": "2014-09-01",
"endDate": "2018-06-30",
"isCurrent": false,
"createdAt": "2026-11-20T12:00:00Z",
"updatedAt": "2026-11-20T12:00:00Z"
}
Status codes
| 201 | Entry created. |
| 400 | The body is not valid JSON, or a field breaks the rules above. The error message says which. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Update an education entry#
/admin/education/{id}access tokenChanges only the fields present in the body; fields left out keep their value. The fields are those of Create, and any other field is rejected. Send null to clear degree, fieldOfStudy, location, description or endDate; type, institutionName, startDate and isCurrent cannot be null.
The rules of Create apply to the entry as it is after the change. To mark an entry as ongoing, send "isCurrent": true together with "endDate": null. Returns the updated education object, with a new updatedAt.
Example
curl -X PATCH https://api.vkovalov.dev/admin/education/0b6f3c2e-8a51-4d0f-9f3e-2c7d1a9b4e61 \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"isCurrent":true,"endDate":null}'
Status codes
| 200 | Entry updated. |
| 400 | The body is not valid JSON or has an unknown field, a required field is sent as null, the resulting entry breaks a rule, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No entry with this id. |
| 500 | Unexpected server error. |
Delete an education entry#
/admin/education/{id}access tokenExample
curl -X DELETE https://api.vkovalov.dev/admin/education/0b6f3c2e-8a51-4d0f-9f3e-2c7d1a9b4e61 \
-H "Authorization: Bearer <access_token>"
Response 200
{ "message": "Education entry deleted" }
Status codes
| 200 | Entry deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No entry with this id. |
| 500 | Unexpected server error. |
List projects#
/projectspublicReturns projects as an array of public project objects: by year, newest first, with projects without a year last, then by creation time, newest first. The array is empty ([]) when there are none. Hidden skills are left out.
Query parameters
| Parameter | Required | Notes |
|---|---|---|
type | No | Returns only projects with exactly this type. Surrounding spaces are trimmed, and an empty value is ignored. |
domain | No | Returns only projects with exactly this domain. Surrounding spaces are trimmed, and an empty value is ignored. |
Example
curl "https://api.vkovalov.dev/projects?type=Web&domain=Backend"
Response 200
[
{
"id": "7a1e4c90-3b2d-4f6a-8c15-9d0e2f7b6a31",
"title": "Portfolio API",
"type": "Web",
"domain": "Backend",
"thumbnailUrl": "/files/c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"videoUrl": null,
"gallery": [
{
"id": "2d9b7f14-6c3a-4e88-b1d0-5a7c9e3f1b42",
"url": "/files/2d9b7f14-6c3a-4e88-b1d0-5a7c9e3f1b42",
"orderIndex": 0
}
],
"skills": [
{ "id": "e4b8a6d2-1f7c-4a39-9e50-3c6d8b2f7a10", "name": "Go", "icon": null }
],
"year": 2026,
"description": "REST API for the portfolio site."
}
]
Status codes
| 200 | Projects returned. |
| 500 | Unexpected server error. |
List projects (admin)#
/admin/projectsaccess tokenReturns the same list as /projects, with the same type and domain filters and order, as admin project objects. These add raw file IDs and timestamps, and include hidden skills.
Example
curl "https://api.vkovalov.dev/admin/projects?type=Web" \
-H "Authorization: Bearer <access_token>"
Status codes
| 200 | Projects returned. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Create a project#
/admin/projectsaccess tokenCreates a project with its gallery and skills in one transaction and returns it as an admin project object. Files must already be uploaded to the portfolio bucket.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
title | string | Yes | At most 255 characters. Surrounding spaces are trimmed. |
type | string | Yes | At most 100 characters. Surrounding spaces are trimmed. |
domain | string | Yes | At most 100 characters. Surrounding spaces are trimmed. |
thumbnailFileId | string (UUID) or null | No | An uploaded file. |
videoFileId | string (UUID) or null | No | An uploaded file. |
galleryFileIds | array of UUIDs | No | Uploaded files, in display order. Duplicates are dropped. |
skillIds | array of UUIDs | No | Existing skills. Duplicates are dropped. |
year | number or null | No | From 1990 to 2100. |
description | string or null | No | An empty string stores no value. |
Example
curl -X POST https://api.vkovalov.dev/admin/projects \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"title":"Portfolio API","type":"Web","domain":"Backend","thumbnailFileId":"c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef","galleryFileIds":["2d9b7f14-6c3a-4e88-b1d0-5a7c9e3f1b42"],"skillIds":["e4b8a6d2-1f7c-4a39-9e50-3c6d8b2f7a10"],"year":2026}'
Response 201
{
"id": "7a1e4c90-3b2d-4f6a-8c15-9d0e2f7b6a31",
"title": "Portfolio API",
"type": "Web",
"domain": "Backend",
"thumbnailFileId": "c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"thumbnailUrl": "/files/c8f5d26f-2e9e-4566-a8ff-c796f4d1f9ef",
"videoFileId": null,
"videoUrl": null,
"gallery": [
{
"fileId": "2d9b7f14-6c3a-4e88-b1d0-5a7c9e3f1b42",
"url": "/files/2d9b7f14-6c3a-4e88-b1d0-5a7c9e3f1b42",
"orderIndex": 0
}
],
"skills": [
{ "id": "e4b8a6d2-1f7c-4a39-9e50-3c6d8b2f7a10", "name": "Go" }
],
"year": 2026,
"description": null,
"createdAt": "2026-11-23T12:00:00Z",
"updatedAt": "2026-11-23T12:00:00Z"
}
Status codes
| 201 | Project created. |
| 400 | The body is not valid JSON, a field breaks the rules above, or a referenced file or skill does not exist or the file is not in the portfolio bucket. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Update a project#
/admin/projects/{id}access tokenChanges only the fields present in the body; fields left out keep their value. The fields are those of Create, and any other field is rejected. Send null to clear thumbnailFileId, videoFileId, year or description; title, type, domain, galleryFileIds and skillIds cannot be null.
galleryFileIds and skillIds replace the whole list, and [] empties it. Files the project no longer uses are deleted, unless another experience or project still uses them. Returns the updated admin project object, with a new updatedAt.
Example
curl -X PATCH https://api.vkovalov.dev/admin/projects/7a1e4c90-3b2d-4f6a-8c15-9d0e2f7b6a31 \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"videoFileId":null,"galleryFileIds":[]}'
Status codes
| 200 | Project updated. |
| 400 | The body is not valid JSON or has an unknown field, a field that cannot be null is sent as null, a value breaks a rule, a referenced file or skill does not exist or the file is not in the portfolio bucket, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No project with this id. |
| 500 | Unexpected server error. |
Delete a project#
/admin/projects/{id}access tokenDeletes the project and its gallery and skill bindings. Its files are deleted too, unless another experience or project still uses them. The response has no body.
Example
curl -X DELETE https://api.vkovalov.dev/admin/projects/7a1e4c90-3b2d-4f6a-8c15-9d0e2f7b6a31 \
-H "Authorization: Bearer <access_token>"
Status codes
| 204 | Project deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No project with this id. |
| 500 | Unexpected server error. |
List services#
/servicespublicReturns every service as an array of public service objects, newest first. Each service has a single price, in the currency for the country of the visitor's IP address; the other prices are not sent. The array is empty ([]) when there are none.
How the visitor's country is found
- The visitor's address is the first public address in the
X-Forwarded-Forheader, or the connection's address when there is none. A browser calling the API directly needs to send nothing: the proxies in front of the API add the header. - A server that calls the API for a visitor, such as the site rendering a page on its server, must send the visitor's address as
X-Forwarded-For. Otherwise the API sees the server's address and answers in that server's currency. It must also not cache the response for other visitors; the response hasCache-Control: private. - The country comes from DB-IP's IP to Country Lite database, refreshed with every deploy. Its licence (CC BY 4.0) asks for the credit IP Geolocation by DB-IP on pages that use it.
- An address the database does not know, such as a private one, gets US dollars. The address only chooses what is shown: it can be forged, so the price is not a guarantee of what a visitor pays.
Currency by country
| Visitor's country | currency | Price |
|---|---|---|
Poland (PL) | PLN | pricePln |
United Kingdom (GB) | GBP | priceGbp |
The rest of Europe: every European country in the UN geoscheme, plus Cyprus and Kosovo (XK). This includes the Crown Dependencies, Gibraltar, Switzerland, Norway, the Balkans, Belarus, Moldova and Russia. | EUR | priceEur |
Ukraine (UA), the United States and every other country | USD | priceUsd |
Example
curl https://api.vkovalov.dev/services
Response 200
[
{
"id": "5b2c8e71-9a4f-4d36-b0e2-7f1a3c9d6e54",
"title": "Landing page",
"description": "<p>A fast, responsive <strong>landing page</strong>.</p>",
"deliveryTime": "2–4 weeks",
"price": 6000,
"currency": "PLN",
"createdAt": "2026-11-25T10:00:00Z",
"updatedAt": "2026-11-25T10:00:00Z"
}
]
Status codes
| 200 | Services returned. |
| 500 | Unexpected server error. |
List all services#
/admin/servicesaccess tokenReturns every service as an array of admin service objects, with all four prices, newest first. The array is empty ([]) when there are none. It is for the admin panel.
Example
curl https://api.vkovalov.dev/admin/services \
-H "Authorization: Bearer <access_token>"
Response 200
[
{
"id": "5b2c8e71-9a4f-4d36-b0e2-7f1a3c9d6e54",
"title": "Landing page",
"description": "<p>A fast, responsive <strong>landing page</strong>.</p>",
"deliveryTime": "2–4 weeks",
"priceUsd": 1500,
"priceEur": 1400,
"pricePln": 6000,
"priceGbp": 1200,
"createdAt": "2026-11-25T10:00:00Z",
"updatedAt": "2026-11-25T10:00:00Z"
}
]
Status codes
| 200 | Services returned. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Create a service#
/admin/servicesaccess tokenCreates a service and returns it as an admin service object. Every field is required.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
title | string | Yes | At most 255 characters. Surrounding spaces are trimmed. |
description | string (HTML) | Yes | HTML from a rich-text editor. It is cleaned before it is stored (see below) and must still contain text afterwards, so <p><br></p> is rejected. |
deliveryTime | string | Yes | For example 2–4 weeks. At most 100 characters. Surrounding spaces are trimmed. |
priceUsd | number | Yes | A whole number from 0 to 2147483647. 0 is allowed. |
priceEur | number | Yes | Same rules as priceUsd. |
pricePln | number | Yes | Same rules as priceUsd. |
priceGbp | number | Yes | Same rules as priceUsd. |
How the description is cleaned
The site renders the description as HTML, so the API keeps only these tags: p, br, strong, b, em, i, u, ul, ol, li, h2, h3, h4, blockquote, code, pre and a.
- Other tags are removed and their text is kept.
script,style,iframeandobjectare removed with their content. - Every attribute is removed, including
style,classand event handlers such asonclick, excepthrefon links. - A link's
hrefmust behttp,https,mailtoor relative; a link with any other URL, such asjavascript:ordata:, is replaced by its text. Every link getsrel="nofollow", and links to another site also gettarget="_blank"andrel="nofollow noopener".
The response contains the description as stored, so the editor can show what was kept.
Example
curl -X POST https://api.vkovalov.dev/admin/services \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"title":"Landing page","description":"<p>A fast, responsive <strong>landing page</strong>.</p>","deliveryTime":"2–4 weeks","priceUsd":1500,"priceEur":1400,"pricePln":6000,"priceGbp":1200}'
Response 201
An admin service object, as in List all services.
Status codes
| 201 | Service created. |
| 400 | The body is not valid JSON (a price that is not a whole number counts as invalid JSON), a field is missing or null, or a value breaks the rules above. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Update a service#
/admin/services/{id}access tokenChanges only the fields present in the body; fields left out keep their value. The fields and rules are those of Create, including the cleaning of description, and any other field is rejected. No field can be null. Returns the updated admin service object, with a new updatedAt.
Example
curl -X PATCH https://api.vkovalov.dev/admin/services/5b2c8e71-9a4f-4d36-b0e2-7f1a3c9d6e54 \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"priceGbp":1100,"deliveryTime":"3 weeks"}'
Status codes
| 200 | Service updated. |
| 400 | The body is not valid JSON or has an unknown field, a field is sent as null, a value breaks a rule, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No service with this id. |
| 500 | Unexpected server error. |
Delete a service#
/admin/services/{id}access tokenDeletes the service. The response has no body.
Example
curl -X DELETE https://api.vkovalov.dev/admin/services/5b2c8e71-9a4f-4d36-b0e2-7f1a3c9d6e54 \
-H "Authorization: Bearer <access_token>"
Status codes
| 204 | Service deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No service with this id. |
| 500 | Unexpected server error. |
List FAQs#
/faqspublic/admin/faqsaccess tokenReturns every FAQ as an array of FAQ objects, sorted by order (lowest first), then by createdAt (oldest first). The array is empty ([]) when there are none. Both routes return the same list: an FAQ has no hidden fields. The admin route is for the admin panel and needs an access token with a content role.
Example
curl https://api.vkovalov.dev/faqs
Response 200
[
{
"id": "8d4f1a2b-6c3e-4f57-9a1d-2e7b5c0f9a36",
"question": "How long does a typical project take?",
"answer": "<p>Most projects take between <strong>2 and 6 weeks</strong>, depending on scope.</p>",
"order": 0,
"createdAt": "2026-11-27T12:00:00Z",
"updatedAt": "2026-11-27T12:00:00Z"
}
]
Status codes
| 200 | FAQs returned. |
| 401 | /admin/faqs only: header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | /admin/faqs only: the token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Create an FAQ#
/admin/faqsaccess tokenCreates an FAQ and returns it as an FAQ object.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
question | string | Yes | Plain text, stored as sent after surrounding spaces are trimmed. HTML in it is not removed, so render it as text, never as HTML. Must not be empty. |
answer | string (HTML) | Yes | HTML from a rich-text editor, or plain text. It is cleaned before it is stored, exactly like a service description, and must still contain text afterwards, so <p><br></p> or an answer that was only a <script> is rejected. Plain text has <, > and & escaped and is meant to be rendered as HTML too. |
order | number | No | Position in the list, lowest first: a whole number from 0 to 2147483647. Defaults to 0 when left out or null. FAQs with the same order are listed oldest first. |
How the answer is cleaned
- Only
p,br,strong,b,em,i,u,ul,ol,li,h2,h3,h4,blockquote,code,preandaare kept. Other tags are removed and their text is kept;script,style,iframeandobjectare removed with their content. - Every attribute is removed, including
style,classand event handlers such asonclick, excepthrefon links. - A link's
hrefmust behttp,https,mailtoor relative; a link with any other URL, such asjavascript:ordata:, is replaced by its text. Every link getsrel="nofollow", and links to another site also gettarget="_blank"andrel="nofollow noopener".
The response contains the answer as stored, so the editor can show what was kept.
Example
curl -X POST https://api.vkovalov.dev/admin/faqs \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"question":"How long does a typical project take?","answer":"<p>Most projects take between <strong>2 and 6 weeks</strong>, depending on scope.</p>","order":0}'
Response 201
An FAQ object, as in List FAQs.
Status codes
| 201 | FAQ created. |
| 400 | The body is not valid JSON (an order that is not a whole number counts as invalid JSON), question or answer is missing or empty after trimming and cleaning, or order is out of range. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 500 | Unexpected server error. |
Update an FAQ#
/admin/faqs/{id}access tokenChanges only the fields present in the body; fields left out keep their value. The fields and rules are those of Create, including the cleaning of answer, and any other field is rejected. No field can be null. To move an FAQ, send its new order; other FAQs are not renumbered. Returns the updated FAQ object, with a new updatedAt.
Example
curl -X PATCH https://api.vkovalov.dev/admin/faqs/8d4f1a2b-6c3e-4f57-9a1d-2e7b5c0f9a36 \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"order":2}'
Status codes
| 200 | FAQ updated. |
| 400 | The body is not valid JSON or has an unknown field, a field is sent as null, a value breaks a rule, or the id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No FAQ with this id. |
| 500 | Unexpected server error. |
Delete an FAQ#
/admin/faqs/{id}access tokenDeletes the FAQ. The response has no body.
Example
curl -X DELETE https://api.vkovalov.dev/admin/faqs/8d4f1a2b-6c3e-4f57-9a1d-2e7b5c0f9a36 \
-H "Authorization: Bearer <access_token>"
Status codes
| 204 | FAQ deleted. |
| 400 | The id in the path is not a UUID. |
| 401 | Header missing, not in the form Bearer <token>, or the token is invalid or expired. |
| 403 | The token is a pre_auth_token, or the account's role cannot manage content (only super_admin, admin and editor can). |
| 404 | No FAQ with this id. |
| 500 | Unexpected server error. |
User object#
Returned by Get profile, Update profile and Enable 2FA, and inside the Login, Verify 2FA and Refresh responses. Fields marked optional are left out when they have no value.
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
email | string | |
first_name | string | Optional. |
last_name | string | Optional. Editable with Update profile. |
avatar_url | string | Optional. Editable with Update profile. |
role | string | For example user. |
is_totp_enabled | boolean | Whether login requires a 2FA code. See Two-factor authentication for turning it on and off. |
is_active | boolean | Deactivated accounts cannot log in. |
last_login_at | string (RFC 3339) | Optional. Time of the last successful login before this one. |
created_at | string (RFC 3339) | |
updated_at | string (RFC 3339) |
The password hash, the 2FA secret and the stored refresh token are never included in the user object.
Category object#
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
name | string | |
slug | string | |
description | string | Optional. |
order_index | number | Sort position, ascending. |
created_at | string (RFC 3339) | |
updated_at | string (RFC 3339) |
Skill object#
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
name | string | |
icon | string | Optional. Inline SVG markup. |
proficiency_level | string | Optional. Beginner, Intermediate, Advanced or Expert. |
categories | array | Always present, possibly empty. Each entry has category_id (UUID) and is_primary (boolean); the primary one comes first. |
is_visible | boolean | Hidden skills are returned only by List all skills. |
order_index | number | Sort position, ascending. |
created_at | string (RFC 3339) | |
updated_at | string (RFC 3339) |
Experience object#
Fields without a value are present as null rather than left out.
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
companyName | string | |
position | string | |
location | string or null | |
employmentType | string or null | |
description | string or null | |
logoFileId | string (UUID) or null | The uploaded logo. Send it back on update to keep the logo. |
logoUrl | string or null | /files/{logoFileId}, relative to the base URL. See Get a file. |
startDate | string | YYYY-MM-DD. |
endDate | string or null | YYYY-MM-DD. null for a current position. |
isCurrent | boolean | Current positions are listed first. |
Education object#
Returned by the education endpoints. Fields without a value are present as null rather than left out.
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
type | string | Academic or Certification. |
institutionName | string | |
degree | string or null | A degree, or the certificate's name. |
fieldOfStudy | string or null | |
location | string or null | |
description | string or null | |
startDate | string | YYYY-MM-DD. |
endDate | string or null | YYYY-MM-DD. null for an ongoing entry. |
isCurrent | boolean | |
createdAt | string (RFC 3339, UTC) | |
updatedAt | string (RFC 3339, UTC) | Changes on every update. |
Project objects#
Fields without a value are present as null rather than left out, and gallery and skills are always arrays. File URLs are relative to the base URL. See Get a file.
Public and admin fields
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
title | string | |
type | string | |
domain | string | |
thumbnailUrl | string or null | /files/{id}. |
videoUrl | string or null | /files/{id}. |
gallery | array | Ordered by orderIndex. Each entry has url and orderIndex, plus the file's UUID as id (public) or fileId (admin). |
skills | array | Ordered by the skill's order_index, then name. Each entry has id and name. The public object adds icon (string or null) and leaves out hidden skills. |
year | number or null | |
description | string or null |
Admin-only fields
| Field | Type | Notes |
|---|---|---|
thumbnailFileId | string (UUID) or null | |
videoFileId | string (UUID) or null | |
createdAt | string (RFC 3339, UTC) | |
updatedAt | string (RFC 3339, UTC) | Changes on every update. |
Service objects#
The public object, from List services, has one price for the visitor's country. The admin object, from List all services, Create and Update, has all four. Every field always has a value.
Public and admin fields
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
title | string | |
description | string (HTML) | Cleaned as described in Create a service, so it can be rendered as HTML. |
deliveryTime | string | |
createdAt | string (RFC 3339, UTC) | |
updatedAt | string (RFC 3339, UTC) | Changes on every update. |
Public-only fields
| Field | Type | Notes |
|---|---|---|
price | number | Whole amount in currency. |
currency | string | USD, EUR, PLN or GBP (ISO 4217), chosen from the visitor's country as described in List services. |
Admin-only fields
| Field | Type | Notes |
|---|---|---|
priceUsd | number | Whole amount in US dollars. |
priceEur | number | Whole amount in euros. |
pricePln | number | Whole amount in Polish złoty. |
priceGbp | number | Whole amount in pounds sterling. |
FAQ object#
Returned by the FAQ endpoints, public and admin alike. Every field always has a value.
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | |
question | string | Plain text. Render it as text, not as HTML. |
answer | string (HTML) | Cleaned as described in Create an FAQ, so it can be rendered as HTML. |
order | number | Position in the list, lowest first. Not unique. |
createdAt | string (RFC 3339, UTC) | |
updatedAt | string (RFC 3339, UTC) | Changes on every update. |