Session
acme.user.v2.Session
A signed-in session for a v1 user account.
Session fields
| Field | Direction | Purpose |
|---|---|---|
id |
Output only | Identifier of this session. |
user |
Required | The account associated with the session. |
expires_at |
Optional | Expiration time, when supplied. |
The v2 session API reuses the v1 User message. A new API package can introduce session operations without duplicating the account schema or changing the version of every related message.
Example JSON
This illustrates the session value inside a GetSessionResponse.
Timestamps use RFC 3339 strings in the
ProtoJSON mapping.
{
"id": "session-example-001",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "alex@example.com",
"displayName": "Alex Chen",
"state": "USER_STATE_ACTIVE"
},
"expiresAt": "2026-01-15T10:30:00Z"
}
Working with expiration
- Check whether
expires_atis present before reading its value. - Interpret a supplied timestamp as an instant, independent of display zone.
- Keep authentication and expiration enforcement in the service implementation.
Versioning: the embedded user still uses the v1 definition, including its validation rules and PII annotations. The session itself belongs to v2.
Fields
| Field | Number | Type | Cardinality | Validation | Description |
|---|---|---|---|---|---|
| id | 1 | string | implicit | — | Session identifier. Output only; keep it opaque to clients. Details
(google.api.field_behavior) = [ OUTPUT_ONLY ] |
| user | 2 | acme.user.v1.User | optional | — | Associated account, using the shared Details
(google.api.field_behavior) = [ REQUIRED ] |
| expires_at | 3 | google.protobuf.Timestamp | optional | — | Expiration instant, if supplied; format with the reader's time zone. Details
|
Example JSON
{
"id": "string",
"user": {
"id": "string",
"email": "string",
"displayName": "string",
"nickname": "string",
"state": "USER_STATE_UNSPECIFIED",
"createdAt": "2026-09-18T17:30:00Z",
"updatedAt": "2026-09-18T17:30:00Z",
"phone": "string",
"labels": {
"key": "string"
},
"addresses": [
{
"line1": "string",
"line2": "string",
"city": "string",
"region": "string",
"postalCode": "string",
"countryCode": "string"
}
],
"preferences": {
"marketingOptIn": true,
"locale": "string",
"timeZone": "string"
}
},
"expiresAt": "2026-09-18T17:30:00Z"
}Effective features
- json_format: ALLOWinherited from acme/user/v2/session
Used by
What will be affected if this symbol changes.