# Session

Session management

## GET /v3/session/user

> Get basic details of the logged in user

```json
{"openapi":"3.0.1","info":{"title":"i3D.net Endpoints","version":"3.0.0"},"tags":[{"name":"Session","description":"Session management"}],"servers":[{"url":"https://api.i3d.net"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","name":"PRIVATE-TOKEN","in":"header"}},"schemas":{"SessionUser":{"type":"object","required":["userId","userName","email","firstName","lastName","gender","phone","accessLevel","validateEmail","isTrialAccount","trialAccountExpirationDate","requestIp","requestIpCountry","requestIpCountryCode","details","billingDetails"],"properties":{"userId":{"type":"integer","format":"integer","description":"Your user ID"},"userName":{"type":"string","format":"","description":"Your user name"},"email":{"type":"string","format":"","description":"Email"},"firstName":{"type":"string","format":"","description":"First name"},"lastName":{"type":"string","format":"","description":"Last name"},"gender":{"type":"string","format":"","description":"User gender"},"phone":{"type":"string","format":"","description":"Phone number"},"accessLevel":{"type":"integer","format":"integer","description":"0: Guest, 10: Regular logged in user, 20: Game Hosting management access"},"validateEmail":{"type":"integer","format":"integer","description":"Whether or not user email is validated","readOnly":true},"isTrialAccount":{"type":"integer","format":"integer","description":"Whether or not user is trial account","readOnly":true},"trialAccountExpirationDate":{"type":"string","format":"","description":"The expiration date of the trial account","readOnly":true},"requestIp":{"type":"string","format":"","description":"Request IP address"},"requestIpCountry":{"type":"string","format":"","description":"The GeoLocation country (ISO 3166) of the request IP address"},"requestIpCountryCode":{"type":"string","format":"","description":"The GeoLocation country code (ISO 3166 Alpha-2) of the request IP address"},"details":{"allOf":[{"$ref":"#/components/schemas/AccountDetails"}],"description":"User account details","readOnly":true},"billingDetails":{"allOf":[{"$ref":"#/components/schemas/AccountBillingDetails"}],"description":"User account billing details","readOnly":true}},"additionalProperties":false},"AccountDetails":{"type":"object","required":["accountType","firstName","lastName","address","streetNumber","zipCode","city","countryCode","emailAddress","unconfirmedEmail","emailAddressValidated","language","agreeDpa","isAllowedFlexMetal"],"properties":{"accountType":{"type":"integer","format":"integer","description":"Account type: 1 - consumer, 2 - business. Can only be updated by submitting a support ticket."},"companyName":{"type":"string","format":"","description":"Company name (for business accounts). Can only be updated by submitting a support ticket.","nullable":true},"vatNumber":{"type":"string","format":"","description":"VAT number (for business accounts). Can only be updated by submitting a support ticket.","nullable":true},"cocNumber":{"type":"string","format":"","description":"CoC number (only for Netherlands accounts). Can only be updated by submitting a support ticket.","nullable":true},"firstName":{"type":"string","format":"","description":"First name."},"lastName":{"type":"string","format":"","description":"Last name."},"address":{"type":"string","format":"","description":"Address - street name."},"streetNumber":{"type":"string","format":"","description":"House number"},"zipCode":{"type":"string","format":"","description":"ZIP / Post code."},"city":{"type":"string","format":"","description":"City."},"countryCode":{"type":"string","format":"","description":"Country code in ISO 3166-1 alpha-2 format."},"emailAddress":{"type":"string","format":"","description":"Email address","readOnly":true},"unconfirmedEmail":{"allOf":[{"$ref":"#/components/schemas/UnconfirmedEmail"}],"description":"Email address which is not confirmed yet","nullable":true,"readOnly":true},"emailAddressValidated":{"type":"integer","format":"integer","description":"Whether or not email address has been confirmed","nullable":true,"readOnly":true},"phoneNumber":{"type":"string","format":"","description":"Phone number. Either this or phoneNumberMobile is required","nullable":true},"phoneNumberMobile":{"type":"string","format":"","description":"Mobile phone number. Either this or phoneNumber is required","nullable":true},"language":{"type":"integer","format":"integer","description":"Preferred language: 0 - english, 1 - dutch"},"emailAddressAbuse":{"type":"string","format":"","description":"Email address for abuse emails","nullable":true},"newsletter":{"type":"integer","format":"integer","description":"Whether or not newsletter is subscribed to","nullable":true},"agreeToc":{"type":"integer","format":"integer","description":"Whether or not Terms and Conditions are agreed to. Cannot be changed after agreeing.","nullable":true},"agreeAup":{"type":"integer","format":"integer","description":"Whether or not Acceptable Use Policy is agreed to. Cannot be changed after agreeing.","nullable":true},"agreeDpa":{"type":"integer","format":"integer","description":"Whether or not Data Processing Agreement is agreed to. Cannot be changed after agreeing.","nullable":true},"isAllowedFlexMetal":{"type":"integer","format":"integer","description":"Whether or not the user is allowed to order flexmetal servers."}},"additionalProperties":false},"UnconfirmedEmail":{"type":"object","required":["email","expiresAt"],"properties":{"email":{"type":"string","format":"","description":"Email address which is not confirmed yet"},"expiresAt":{"type":"integer","format":"integer","description":"Expiry time of confirmation link","readOnly":true}},"additionalProperties":false,"nullable":true},"AccountBillingDetails":{"type":"object","required":["firstName","lastName","address","streetNumber","zipCode","city","countryCode","bundleInvoicesOfSameCategory","receivePaymentConfirmationsViaEmail","preferredPaymentMethod"],"properties":{"firstName":{"type":"string","format":"","description":"Billing first name."},"lastName":{"type":"string","format":"","description":"Billing last name."},"address":{"type":"string","format":"","description":"Billing address."},"streetNumber":{"type":"string","format":"","description":"Billing street number."},"zipCode":{"type":"string","format":"","description":"Billing ZIP code."},"city":{"type":"string","format":"","description":"Billing city."},"countryCode":{"type":"string","format":"","description":"Country code in ISO 3166-1 alpha-2 format."},"phoneNumber":{"type":"string","format":"","description":"Billing phone number. Either this or phoneNumberMobile is required.","nullable":true},"phoneNumberMobile":{"type":"string","format":"","description":"Billing mobile phone number. Either this or phoneNumber is required.","nullable":true},"emailAddressBilling":{"type":"string","format":"","description":"Email address for billing emails","nullable":true},"bundleInvoicesOfSameCategory":{"type":"integer","format":"integer","description":"Whether or not to bundle invoices of the same category"},"receivePaymentConfirmationsViaEmail":{"type":"integer","format":"integer","description":"Whether or not to send email confirmations via email"},"preferredPaymentMethod":{"type":"integer","format":"integer","description":"Preferred payment method"}},"additionalProperties":false},"Error":{"type":"object","required":["errorCode","errorMessage","errors"],"properties":{"errorCode":{"type":"integer","format":"integer","description":"Error code"},"errorMessage":{"type":"string","format":"","description":"Error message"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Error details"}},"additionalProperties":false},"ErrorDetails":{"type":"object","required":["property","message"],"properties":{"property":{"type":"string","format":"","description":"Property in which there is an error"},"message":{"type":"string","format":"","description":"Error message"}},"additionalProperties":false}}},"paths":{"/v3/session/user":{"get":{"tags":["Session"],"summary":"Get basic details of the logged in user","operationId":"getUser","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionUser"}}}},"404":{"description":"If you are not logged in"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /v3/session/login

> Log in

```json
{"openapi":"3.0.1","info":{"title":"i3D.net Endpoints","version":"3.0.0"},"tags":[{"name":"Session","description":"Session management"}],"servers":[{"url":"https://api.i3d.net"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","name":"PRIVATE-TOKEN","in":"header"}},"schemas":{"SessionLogin":{"type":"object","required":["userName","password"],"properties":{"userName":{"type":"string","format":"","description":"User name"},"password":{"type":"string","format":"","description":"Password"},"rememberMe":{"type":"integer","format":"integer","description":"Remember me"}},"additionalProperties":false},"SessionAuthReq":{"type":"object","required":["requiresOtp","expiresAt","otpSessionExpiresAt"],"properties":{"requiresOtp":{"type":"boolean","description":"Indicates whether a 2FA One-Time Password token is required to complete the login."},"expiresAt":{"type":"integer","format":"integer","description":"Unix timestamp indicating when the window for 2FA authentication closes, 0 if not applicable."},"otpSessionExpiresAt":{"type":"integer","format":"integer","description":"If 2FA is active on your account, you must supply the one-time-password before this unix timestamp expires."}},"additionalProperties":false},"Error":{"type":"object","required":["errorCode","errorMessage","errors"],"properties":{"errorCode":{"type":"integer","format":"integer","description":"Error code"},"errorMessage":{"type":"string","format":"","description":"Error message"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Error details"}},"additionalProperties":false},"ErrorDetails":{"type":"object","required":["property","message"],"properties":{"property":{"type":"string","format":"","description":"Property in which there is an error"},"message":{"type":"string","format":"","description":"Error message"}},"additionalProperties":false}}},"paths":{"/v3/session/login":{"post":{"tags":["Session"],"summary":"Log in","operationId":"login","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLogin"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionAuthReq"}}}},"401":{"description":"Invalid credentials"},"409":{"description":"Already logged in"},"429":{"description":"Too many login requests performed"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /v3/session/login/otp

> Provide 2FA One-Time Password after a successful login (if requiresOtp is true in SessionAuthReq, as returned by /session/login)

```json
{"openapi":"3.0.1","info":{"title":"i3D.net Endpoints","version":"3.0.0"},"tags":[{"name":"Session","description":"Session management"}],"servers":[{"url":"https://api.i3d.net"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","name":"PRIVATE-TOKEN","in":"header"}},"schemas":{"SessionLoginOtp":{"type":"object","required":["otp"],"properties":{"otp":{"type":"string","format":"","description":"6 digit One-Time Password"}},"additionalProperties":false},"Error":{"type":"object","required":["errorCode","errorMessage","errors"],"properties":{"errorCode":{"type":"integer","format":"integer","description":"Error code"},"errorMessage":{"type":"string","format":"","description":"Error message"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Error details"}},"additionalProperties":false},"ErrorDetails":{"type":"object","required":["property","message"],"properties":{"property":{"type":"string","format":"","description":"Property in which there is an error"},"message":{"type":"string","format":"","description":"Error message"}},"additionalProperties":false}}},"paths":{"/v3/session/login/otp":{"post":{"tags":["Session"],"summary":"Provide 2FA One-Time Password after a successful login (if requiresOtp is true in SessionAuthReq, as returned by /session/login)","operationId":"provideOTP","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLoginOtp"}}},"required":true},"responses":{"204":{"description":"No Content"},"401":{"description":"Invalid OTP"},"404":{"description":"Unexpected OTP call"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /v3/session/logout

> Log out

```json
{"openapi":"3.0.1","info":{"title":"i3D.net Endpoints","version":"3.0.0"},"tags":[{"name":"Session","description":"Session management"}],"servers":[{"url":"https://api.i3d.net"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","name":"PRIVATE-TOKEN","in":"header"}},"schemas":{"Error":{"type":"object","required":["errorCode","errorMessage","errors"],"properties":{"errorCode":{"type":"integer","format":"integer","description":"Error code"},"errorMessage":{"type":"string","format":"","description":"Error message"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Error details"}},"additionalProperties":false},"ErrorDetails":{"type":"object","required":["property","message"],"properties":{"property":{"type":"string","format":"","description":"Property in which there is an error"},"message":{"type":"string","format":"","description":"Error message"}},"additionalProperties":false}}},"paths":{"/v3/session/logout":{"post":{"tags":["Session"],"summary":"Log out","operationId":"logout","responses":{"204":{"description":"No Content"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/api-references/general/session.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
