message

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_at is 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

FieldNumberTypeCardinalityValidationDescription
id1stringimplicit—

Session identifier. Output only; keep it opaque to clients.

Details
  • JSON name: id
  • Presence: IMPLICIT
  • Annotations: OUTPUT_ONLY
(google.api.field_behavior) = [
  OUTPUT_ONLY
]
user2acme.user.v1.Useroptional—

Associated account, using the shared acme.user.v1.User schema.

Details
  • JSON name: user
  • Presence: EXPLICIT
  • Annotations: REQUIRED
(google.api.field_behavior) = [
  REQUIRED
]
expires_at3google.protobuf.Timestampoptional—

Expiration instant, if supplied; format with the reader's time zone.

Details
  • JSON name: expiresAt
  • Presence: EXPLICIT

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: ALLOW
    inherited from acme/user/v2/session

Used by

What will be affected if this symbol changes.