---
title: "POST /v1/users/{usersId}/availability:markAsAway"
method: POST
path: "/v1/users/{usersId}/availability:markAsAway"
tags: ["users"]
---

# POST /v1/users/{usersId}/availability:markAsAway

`POST /v1/users/{usersId}/availability:markAsAway`

## Request

- Base URL: `https://chat.googleapis.com`
- URL: `https://chat.googleapis.com/v1/users/{usersId}/availability:markAsAway`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/chat.users.availability`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.users.availability`

Marks user as `AWAY` in Google Chat. Sets the user's state to away and is not affected by the user's activity. This method only updates the authenticated user's availability. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.availability`

## Path parameters

- `usersId` string, required

## Request body

- MarkAsAwayRequest: Request message for the `MarkAsAway` method.

## Response `200`

Successful response

- 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.
  - `customStatus` 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.
    - `emoji` Emoji: An emoji that is used as a reaction to a message.
      - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
        - `emojiName` string: Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization. Required when the custom emoji is created, output only otherwise. Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively. Example: `:valid-emoji-name:`
        - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
        - `payload` CustomEmojiPayload: Payload data for the custom emoji.
          - `fileContent` string, byte: Required. Input only. The image used for the custom emoji. The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change.
          - `filename` string: Required. Input only. The image file name. Supported file extensions: `.png`, `.jpg`, `.gif`.
        - `temporaryImageUri` string: Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created.
        - `uid` string: Output only. Unique key for the custom emoji resource.
      - `unicode` string: Optional. A basic emoji represented by a unicode string.
    - `expireTime` string, google-datetime: The timestamp when the custom status expires.
    - `text` string: Required. The text of the custom status. This will be a string with maximum length of 64.
    - `ttl` string, google-duration: Input only. The time-to-live duration after which the custom status expires.
  - `doNotDisturbMetadata` DoNotDisturbMetadata: Metadata associated with the `DO_NOT_DISTURB` availability state, specifying when the state is set to expire.
    - `expirationTime` string, google-datetime: Output only. Timestamp until which the user should be marked as DO_NOT_DISTURB. This can be maximum of 1 year in the future.
  - `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` 'STATE_UNSPECIFIED' | 'ACTIVE' | 'IDLE' | 'AWAY' | 'DO_NOT_DISTURB': Output only. The user's current availability state.

---

[API](https://skmtc.dev/google/apis/chat.md) - [All operations](https://skmtc.dev/google/apis/chat/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/chat/revisions/ffee5784d4b1?raw)
