REST Resource: users.availability

Resource: Availability

Represents a user's current availability information in Google Chat, including their state (for example, Active, Away, Do Not Disturb) and any custom status.

JSON representation
{
  "name": string,
  "state": enum (State),
  "customStatus": {
    object (CustomStatus)
  },

  "doNotDisturbMetadata": {
    object (DoNotDisturbMetadata)
  }
}
Fields
name

string

Identifier. Resource name of the user's availability.

Format: users/{user}/availability

{user} is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789.

The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me.

state

enum (State)

Output only. The user's current availability state.

customStatus

object (CustomStatus)

Optional. The user's custom status.

Union field state_metadata. Additional metadata associated with the user's availability state. state_metadata can be only one of the following:
doNotDisturbMetadata

object (DoNotDisturbMetadata)

Output only. Metadata if the user state is set to DO_NOT_DISTURB.

State

Represents the current availability state of the user.

Enums
STATE_UNSPECIFIED Default value. The state is unspecified.
ACTIVE The user is currently active, based on recent activity.
IDLE The user is currently idle. This state indicates a period of inactivity after being ACTIVE, before potentially transitioning to AWAY.
AWAY The user is currently away. This can be either automatically set after a period of inactivity in ACTIVE or IDLE state, or it can be manually set by the user. When manually set via availability.markAsAway, this state persists regardless of user activity.
DO_NOT_DISTURB The user is in Do Not Disturb state, which is manually set.

DoNotDisturbMetadata

Metadata associated with the DO_NOT_DISTURB availability state, specifying when the state is set to expire.

JSON representation
{
  "expirationTime": string
}
Fields
expirationTime

string (Timestamp format)

Output only. Timestamp until which the user should be marked as DO_NOT_DISTURB. This can be maximum of 1 year in the future.

CustomStatus

Represents a user's custom status in Google Chat. This includes a short text message with an optional emoji that a user sets to give more context about their availability.

JSON representation
{
  "text": string,
  "emoji": {
    object (Emoji)
  },

  "expireTime": string,
  "ttl": string
}
Fields
text

string

Required. The text of the custom status. This will be a string with maximum length of 64.

emoji

object (Emoji)

Required. The emoji of the custom status. Only Unicode emojis are supported; custom emojis are not supported.

Union field expiration. The expiration time of the custom status. It can be specified as either an absolute timestamp or a time-to-live duration. expiration can be only one of the following:
expireTime

string (Timestamp format)

The timestamp when the custom status expires.

ttl

string (Duration format)

Input only. The time-to-live duration after which the custom status expires.

Methods

get

Returns availability information for a human user in Google Chat.

markAsActive

Marks user as ACTIVE in Google Chat.

markAsAway

Marks user as AWAY in Google Chat.

markAsDoNotDisturb

Marks user asDO_NOT_DISTURB in Google Chat.

patch

Updates availability information for a human user.