---
updatedAt: 2026-10-29T11:54:48.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Create an Answer

Posts the store's answer to a question by `question_id`. A question takes one answer from the store: if it already has one, the call returns `400`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "App partners API",
    "description": "Endpoints for apps that Yotpo merchants install. The app-level webhook is defined separately, in webhooks.json.",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://developers.yotpo.com"
    }
  ],
  "security": [
    {
      "X-Yotpo-Token": []
    }
  ],
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "paths": {
    "/v2/{account_id}/questions/{question_id}/answers": {
      "post": {
        "summary": "Create an Answer",
        "description": "Posts the store's answer to a question by `question_id`. A question takes one answer from the store: if it already has one, the call returns `400` with `Answer already exist`.",
        "operationId": "create-an-answer",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "Your account's API app key",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "question_id",
            "in": "path",
            "description": "The question's unique identifier. Can be retrieved using [Retrieve All Questions](ref:retrieve-all-questions)",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "The textual content of the answer to a question. No maximum length."
                  },
                  "public": {
                    "type": "boolean",
                    "description": "True by default. Pass a value of `false` to make your answer visible solely to the reviewer who asked the question.",
                    "default": true
                  }
                }
              },
              "examples": {
                "Public answer": {
                  "value": {
                    "content": "Yes, this jacket is machine washable on a cold cycle.",
                    "public": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status\": {\n        \"code\": 200,\n        \"message\": \"OK\"\n    },\n    \"pagination\": null,\n    \"answer\": {\n        \"id\": \"13\",\n        \"content\": \"mr shop owner\",\n        \"public\": true,\n        \"answerer\": {\n            \"id\": \"8315\",\n            \"display_name\": \"\",\n            \"social_image\": \"\"\n        },\n        \"votes_up\": 0,\n        \"votes_down\": 0\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "example": 200,
                          "default": 0,
                          "description": "HTTP status code."
                        },
                        "message": {
                          "type": "string",
                          "example": "OK",
                          "description": "Status message, such as `OK`."
                        }
                      },
                      "description": "Request status."
                    },
                    "pagination": {
                      "type": "null",
                      "description": "Always `null` for this endpoint."
                    },
                    "answer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "13",
                          "description": "The answer ID. Use it with [Delete an Answer](ref:delete-an-answer)."
                        },
                        "content": {
                          "type": "string",
                          "example": "mr shop owner",
                          "description": "The answer text."
                        },
                        "public": {
                          "type": "boolean",
                          "example": true,
                          "default": true,
                          "description": "Whether the answer is public. `false` means only the asker can see it."
                        },
                        "answerer": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "8315",
                              "description": "The answerer's user ID."
                            },
                            "display_name": {
                              "type": "string",
                              "example": "",
                              "description": "The answerer's display name. Can be an empty string."
                            },
                            "social_image": {
                              "type": "string",
                              "example": "",
                              "description": "URL of the answerer's profile image. Can be an empty string."
                            }
                          },
                          "description": "Who wrote the answer."
                        },
                        "votes_up": {
                          "type": "integer",
                          "example": 0,
                          "default": 0,
                          "description": "Number of up votes."
                        },
                        "votes_down": {
                          "type": "integer",
                          "example": 0,
                          "default": 0,
                          "description": "Number of down votes."
                        }
                      },
                      "description": "The new answer."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The question already has the store's answer, or `content` is empty.",
            "content": {
              "application/json": {
                "examples": {
                  "Answer already exists": {
                    "value": "{\n    \"error\": \"Answer already exist\",\n    \"code\": 3,\n    \"message\": \"Answer already exist\",\n    \"details\": []\n}"
                  },
                  "Empty content": {
                    "value": "{\n    \"error\": \"content must be a non empty string\",\n    \"code\": 3,\n    \"message\": \"content must be a non empty string\",\n    \"details\": []\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error message.",
                      "example": "Answer already exist"
                    },
                    "code": {
                      "type": "integer",
                      "description": "Yotpo error code.",
                      "example": 3
                    },
                    "message": {
                      "type": "string",
                      "description": "Error message, same as `error`.",
                      "example": "Answer already exist"
                    },
                    "details": {
                      "type": "array",
                      "description": "Extra error details. Usually empty.",
                      "items": {
                        "description": "An error detail. Empty in every response we tested, so the item shape isn't documented."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid access token, or the token belongs to a different store.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": " {\n    \"error\": \"Feature is disabled questions_and_answers\",\n    \"code\": 16\n}"
                  },
                  "Missing token": {
                    "summary": "No token sent (or sent as Authorization: Bearer)",
                    "value": {
                      "error": "invalid_request",
                      "error_description": "The access token is missing"
                    }
                  },
                  "Invalid token": {
                    "summary": "Token unknown, revoked or for another app",
                    "value": {
                      "error": "invalid_token",
                      "error_description": "The access token is invalid or has expired"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Feature is disabled questions_and_answers",
                      "description": "Error message."
                    },
                    "code": {
                      "type": "integer",
                      "example": 16,
                      "default": 0,
                      "description": "Yotpo error code."
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable reason for the error."
                    }
                  }
                }
              },
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "No such `account_id` or `access_token` doesn't match the `account_id`"
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"error\": \"Question not found\",\n    \"code\": 5\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Question not found",
                      "description": "Error message."
                    },
                    "code": {
                      "type": "integer",
                      "example": 5,
                      "default": 0,
                      "description": "Yotpo error code."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "securitySchemes": {
      "X-Yotpo-Token": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Yotpo-Token",
        "description": "Send your app's access token for the merchant's store in the `X-Yotpo-Token` header of every request. To get a token, see [Generate Access Token](ref:generate-a-token). The API also reads the token from an `access_token` query parameter, but that isn't recommended: URLs end up in server and proxy logs. `Authorization: Bearer` is not supported."
      }
    }
  }
}
```

# Sibling pages

* [Retrieve Questions and Answers for a Product](https://docs.yotpo.com/reference/partners-retrieve-questions-and-answers-for-a-product.md)
* [Retrieve the Bottom Line for Questions and Answers](https://docs.yotpo.com/reference/partners-retrieve-the-bottom-line-for-questions-and-answers.md)
* [Retrieve Q\&A by Question ID](https://docs.yotpo.com/reference/retrieve-qa-by-question-id.md)
* [Update an Answer](https://docs.yotpo.com/reference/update-an-answer.md)
* [Delete an Answer](https://docs.yotpo.com/reference/delete-an-answer.md)