Your account
const url = 'https://api.avtopodatki.si/v1/auth/me';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.avtopodatki.si/v1/auth/me \ --header 'Authorization: Bearer <token>'Your account: email, the companies you belong to with their plans, permissions and limits, and whether your account or a company is suspended.
Works even when your account or company is suspended, so an app can show why instead of a bare error. Also a quick way to check that your access token is valid.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successful Response
Your account and what it can access.
object
Your account id.
Session type; authenticated for a signed-in user.
Special roles, e.g. operator, which has access to every API.
Whether the account is an operator.
This session skipped the second factor it needs: the account has one, or is staff (who act as an ordinary user until they pass it). Other routes answer 403 two_factor_required until it is completed.
Whether this is trial access.
Whether access_expires_at has passed.
The company’s monthly limits (credits, exports, …) and this month’s use. Null if you are not metered.
One monthly limit of the company and this month’s use of it.
object
credits: spent by API calls (dashboard calls spend none). exports: catalogue exports from the dashboard or the API. full_exports: full listings exports (the listings integration’s Excel file), likewise. vin_lookups: reserved, nothing spends it yet.
What you may use, for the company your requests act for (see default_org_id). An operator reaches everything, whatever this lists.
One permission a company holds.
object
area.action, e.g. market.read, or integration.<slug>.
What narrows the data it reaches, e.g. {"sites": ["avtonet"]}. Empty: no narrowing.
object
Where it applies: dashboard, api or both.
Your account is suspended: every API except this one and logout returns 403 account_disabled.
Companies you belong to. The access fields above (trial, access_expires_at, limits, permissions) are those of the company the request acts for.
A company you belong to, its plan and what it may use.
object
dealer, parts_seller, data_customer or enterprise.
Everything the company may use.
One permission a company holds.
object
area.action, e.g. market.read, or integration.<slug>.
What narrows the data it reaches, e.g. {"sites": ["avtonet"]}. Empty: no narrowing.
object
Where it applies: dashboard, api or both.
Each monthly limit and this month’s use. Null if you are not metered.
One monthly limit of the company and this month’s use of it.
object
credits: spent by API calls (dashboard calls spend none). exports: catalogue exports from the dashboard or the API. full_exports: full listings exports (the listings integration’s Excel file), likewise. vin_lookups: reserved, nothing spends it yet.
The company’s access is suspended: every API returns 403 organization_disabled for it. You can still sign in and read this.
Example
{ "two_factor_required": false, "trial": false, "access_expired": false, "limits": [ { "meter": "credits" } ], "permissions": [ { "permission": "market.read", "channels": [ "dashboard", "api" ] } ], "locale": "sl", "disabled": false, "organizations": [ { "permissions": [ { "permission": "market.read", "channels": [ "dashboard", "api" ] } ], "limits": [ { "meter": "credits" } ], "disabled": false } ]}