- [Resource: Availability](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#Availability)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#Availability.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#State)
- [DoNotDisturbMetadata](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#DoNotDisturbMetadata)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#DoNotDisturbMetadata.SCHEMA_REPRESENTATION)
- [CustomStatus](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#CustomStatus)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#CustomStatus.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#METHODS_SUMMARY)

## 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 (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#State`), "customStatus": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#CustomStatus`) }, "doNotDisturbMetadata": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#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 (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#State`)`` Output only. The user's current availability state. |
| `customStatus` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#CustomStatus`)`` Optional. The user's custom status. |
| Additional metadata associated with the user's availability state. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `doNotDisturbMetadata` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability#DoNotDisturbMetadata`)`` Output only. Metadata if the user state is set to DO_NOT_DISTURB. |
| End of mutually exclusive fields. ||

## 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 (`https://protobuf.dev/reference/protobuf/google.protobuf#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 (`https://developers.google.com/workspace/chat/api/reference/rest/v1/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 (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji`)`` Required. The emoji of the custom status. Only Unicode emojis are supported; custom emojis are not supported. |
| The expiration time of the custom status. It can be specified as either an absolute timestamp or a time-to-live duration. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The timestamp when the custom status expires. |
| `ttl` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Input only. The time-to-live duration after which the custom status expires. |
| End of mutually exclusive fields. ||

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability/get` | Returns availability information for a human user in Google Chat. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability/markAsActive` | Marks user as `ACTIVE` in Google Chat. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability/markAsAway` | Marks user as `AWAY` in Google Chat. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability/markAsDoNotDisturb` | Marks user as `DO_NOT_DISTURB` in Google Chat. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/users.availability/patch` | Updates availability information for a human user. |