---
title: "POST /v1/{+parent}/answers:upsert"
method: POST
path: "/v1/{+parent}/answers:upsert"
tags: ["locations"]
---

# POST /v1/{+parent}/answers:upsert

`POST /v1/{+parent}/answers:upsert`

## Request

- Base URL: `https://mybusinessqanda.googleapis.com`
- URL: `https://mybusinessqanda.googleapis.com/v1/{+parent}/answers:upsert`
- Auth: none declared
- TypeScript: <https://skmtc.dev/google/apis/mybusinessqanda/docs/v1/:parent/answers:upsert/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates an answer or updates the existing answer written by the user for the specified question. A user can only create one answer per question.

## Path parameters

- `parent` string, required

## Request body

- UpsertAnswerRequest: Request message for QuestionsAndAnswers.UpsertAnswer
  - `answer` Answer: Represents an answer to a question
    - `name` string: Output only. The unique name for the answer locations/*/questions/*/answers/*
    - `createTime` string, google-datetime: Output only. The timestamp for when the answer was written. Only retrieved during ListResponse fetching.
    - `upvoteCount` integer: Output only. The number of upvotes for the answer.
    - `text` string: Required. The text of the answer. It should contain at least one non-whitespace character. The maximum length is 4096 characters.
    - `author` Author: Represents the author of a question or answer
      - `profilePhotoUri` string: The profile photo URI of the user.
      - `type` 'AUTHOR_TYPE_UNSPECIFIED' | 'REGULAR_USER' | 'LOCAL_GUIDE' | 'MERCHANT': The type of user the author is.
      - `displayName` string: The display name of the user
    - `updateTime` string, google-datetime: Output only. The timestamp for when the answer was last modified.

## Response `200`

Successful response

- Answer: Represents an answer to a question
  - `name` string: Output only. The unique name for the answer locations/*/questions/*/answers/*
  - `createTime` string, google-datetime: Output only. The timestamp for when the answer was written. Only retrieved during ListResponse fetching.
  - `upvoteCount` integer: Output only. The number of upvotes for the answer.
  - `text` string: Required. The text of the answer. It should contain at least one non-whitespace character. The maximum length is 4096 characters.
  - `author` Author: Represents the author of a question or answer
    - `profilePhotoUri` string: The profile photo URI of the user.
    - `type` 'AUTHOR_TYPE_UNSPECIFIED' | 'REGULAR_USER' | 'LOCAL_GUIDE' | 'MERCHANT': The type of user the author is.
    - `displayName` string: The display name of the user
  - `updateTime` string, google-datetime: Output only. The timestamp for when the answer was last modified.

---

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