---
title: "Create or update response"
method: POST
path: "/api/v1/responses/create-or-update"
tags: ["Responses"]
---

# Create or update response

`POST /api/v1/responses/create-or-update`

## Request

- Base URL: `https://api.simplesat.io`
- URL: `https://api.simplesat.io/api/v1/responses/create-or-update`
- Auth: API key in header `X-Simplesat-Token`

Create or update a response.

If the response with the specified external ID already exists, the existing response will be updated.

When creating a new response, the `survey_id` and `answers` fields are required. The `answers` array should have at least one item with the `question_id` and either a `choice` or `choices` field.

The customer and team members will be created if they do not already exist with the specified email address. Otherwise, the response will be linked to the existing customer and team member.
Team members and customers without emails will be ignored.

Updating any `tags` or `custom_attributes` field will overwrite any existing values.

When updating a response none of the fields are required, but at least one field must be provided.

Required scopes: `write responses`

## Request body

- object
  - `survey_id` integer, required
  - `language` string
  - `created` string, date-time: Optional date and time to set as the response creation timestamp (for example when importing or syncing historical responses).
  - `tags` string[]
  - `answers` object[]
    - `question_id` integer, required
    - `choice` string
    - `choices` string[]
    - `comment` string
    - `sentiment` string
    - `follow_up_answer` string
    - `follow_up_answer_choice` string
    - `follow_up_answer_choices` string[]
  - `team_members` object[]
    - `external_id` string
    - `name` string
    - `email` string, required
    - `custom_attributes` object
    - `role` string, required
    - `is_primary` boolean, required
  - `ticket` object
    - `external_id` string
    - `subject` string
    - `custom_attributes` object
  - `customer` object
    - `external_id` string
    - `name` string
    - `email` string, required
    - `tags` string[]
    - `company` string
    - `custom_attributes` object

## Response `200`

Successful response

- object
  - `survey_id` integer
  - `language` string
  - `ticket` object
    - `id` integer
    - `external_id` string
    - `subject` string
    - `custom_attributes` object
  - `team_members` object[]
    - `external_id` string
    - `name` string
    - `email` string
    - `custom_attributes` object
    - `role` string
    - `is_primary` boolean
    - `groups` TeamMemberGroup[]
      - `token` string: Unique identifier for the team member group, defined by Simplesat.
      - `name` string: The name of the team member group.
  - `customer` object
    - `external_id` string
    - `name` string
    - `email` string
    - `tags` string[]
    - `company` string
    - `custom_attributes` object
  - `answers` object[]
    - `id` integer
    - `question` object
      - `id` integer
      - `text` string
      - `metric` string
    - `choice` string
    - `choices` string[]
    - `comment` string
    - `sentiment` string
    - `follow_up_answer` string
    - `choice_label` string
    - `follow_up_answer_choice` string
    - `follow_up_answer_choices` string[]
    - `follow_up_question` object
      - `id` integer
      - `text` string
      - `metric` string
    - `topics` Topic[]
      - `id` integer: Unique identifier for the topic, defined by Simplesat.
      - `name` string: The name of the topic.
      - `description` string: A description of the topic.
      - `sentiment` string: The sentiment associated with the topic for this answer.
  - `id` integer
  - `tags` string[]
  - `created` string, date-time
  - `modified` string, date-time
  - `ip_address` string

## Other responses

- `400`: Bad request

---

[API](https://skmtc.dev/simplesat/apis/simplesat-api-v1.md) · [All operations](https://skmtc.dev/simplesat/apis/simplesat-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/simplesat/apis/simplesat-api-v1/revisions/1c245425416b?raw)
