Skip to main content

Session

Retrieve information about the currently authenticated session, including the user identity, network and mailbox context, and token expiry.

Endpoint​

POST /v2/auth/session

Request Body​

No request body is required. Session details are resolved from the Authorization or X-API-Key header.

Response​

Returns the session context for the currently authenticated principal.

{
"success": true,
"data": {
"userId": 4821,
"login": "jsmith@example.com",
"networkId": 1,
"mailboxId": 101,
"authLevel": "MailboxAdmin",
"expiresAt": "2026-05-07T18:30:00Z"
},
"errorCode": "",
"message": ""
}
FieldTypeDescription
userIdintegerInternal ECGrid user ID
loginstringUsername / login identifier
networkIdintegerECGrid network ID the user belongs to
mailboxIdintegerPrimary mailbox ID associated with the session
authLevelstringCurrent authorization level — see AuthLevel ENUM below
expiresAtdatetime (ISO 8601)UTC expiry time of the current token or session

ENUMs​

AuthLevel​

ValueDescription
NoChangeNo change to current level
RootSystem root access
TechOpsTechnical operations
NetOpsNetwork operations
NetworkAdminFull network administration
NetworkUserStandard network user
MailboxAdminFull mailbox administration
MailboxUserStandard mailbox user
TPUserTrading partner user
GeneralGeneral read-only access

See Appendix — ENUMs for the full AuthLevel reference.

Code Examples​

curl -X POST "https://rest.ecgrid.io/v2/auth/session" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "success": true, "data": { "userId": 4821, "login": "jsmith@example.com", "networkId": 1, "mailboxId": 101, "authLevel": "MailboxAdmin", "expiresAt": "2026-05-07T18:30:00Z" }, "errorCode": "", "message": "" }'

See Also​