### GET /api/v1/customers/{customer_id}
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Get a customer by ID.
Required scopes: `read customers`
```markdown
### Parameters
- **customer_id** (string, path, required): The ID of the customer to retrieve
### Responses
#### 200 - Successful response
- **id** (integer) (example: 1)
- **external_id** (string) (example: "12345")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **company** (string) (example: "Simplesat")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
#### 404 - Not found
- **detail** (string) (example: "No Customer matches the given query.")
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/customers/{customer_id}"
```
```
--------------------------------
### API Overview: Simplesat API (v1)
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Welcome to the Simplesat API reference!
The public endpoints are stable but still a work in progress. If you have
any questions or see any issues, please reach out to us at
support@simplesat.io.
## Previous API Versions
- [API v0](https://documenter.getpostman.com/view/457268/SVfRt7WJ?version=latest) (deprecated)
## Authentication
You need a Simplesat account with an API key to make requests.
You can manage API keys from the [API keys page](https://app.simplesat.io/settings/api-keys/).
Your API key needs to have the appropriate scopes to access the endpoints you want to use.
To authenticate, use an API key with the required scopes in a `X-Simplesat-Token` header.
| Key |
Value |
X-Simplesat-Token |
Your access token |
## Content Type
All requests and responses use JSON format. Ensure your `Content-Type` header
is set correctly:
```http
Content-Type: application/json
```
## Date and Time Format
Dates and times in Simplesat's API follow the ISO 8601 standard, formatted as:
```
YYYY-MM-DDTHH:MM:SSZ
```
- `T` separates the date and time.
- `Z` indicates UTC time.
Example: `2024-08-08T14:30:00Z`
## Pagination
By default, most list endpoints return a maximum of 100 records per page.
You can change the number of records on a per-request basis by passing a
`page_size` parameter in the request URL parameters. Example:
`page_size=50`.
When the response exceeds the per-page maximum, you can paginate through the
records by incrementing the page parameter. Example: `page=3`. List results
include `next` and `previous` URLs in the response body for easier
navigation:
```
{
"answers" [...],
"count": 106,
"next": "https://api.simplesat.io/api/answers/?page=2",
"previous": null,
}
```
Stop paging when the `next` attribute is `null`.
## Rate Limiting
Public v1 API requests are rate limited per account.
### How it works
- The limit is enforced in rolling 1‑minute windows.
- All requests for the same account share the same quota.
- If you exceed the limit, further requests in that window will return HTTP `429 Too Many Requests`.
### Rate limit headers
Every public v1 API response includes the following headers:
- `X-RateLimit-Limit` – the maximum number of requests allowed per 1‑minute window.
- `X-RateLimit-Remaining` – how many requests you have left in the current window.
- `X-RateLimit-Reset` – Unix timestamp (seconds) when the current window resets.
- `Retry-After` – only sent on HTTP `429 Too Many Requests`; number of seconds until you can retry.
| Header |
Example |
X-RateLimit-Limit |
300 |
X-RateLimit-Remaining |
42 |
X-RateLimit-Reset |
1737642000 |
Retry-After |
15 |
```yaml
# Simplesat API (v1)
# Version: 1.0.0
Welcome to the Simplesat API reference!
The public endpoints are stable but still a work in progress. If you have
any questions or see any issues, please reach out to us at
support@simplesat.io.
## Previous API Versions
- [API v0](https://documenter.getpostman.com/view/457268/SVfRt7WJ?version=latest) (deprecated)
## Authentication
You need a Simplesat account with an API key to make requests.
You can manage API keys from the [API keys page](https://app.simplesat.io/settings/api-keys/).
Your API key needs to have the appropriate scopes to access the endpoints you want to use.
To authenticate, use an API key with the required scopes in a `X-Simplesat-Token` header.
| Key |
Value |
X-Simplesat-Token |
Your access token |
## Content Type
All requests and responses use JSON format. Ensure your `Content-Type` header
is set correctly:
```http
Content-Type: application/json
```
## Date and Time Format
Dates and times in Simplesat's API follow the ISO 8601 standard, formatted as:
```
YYYY-MM-DDTHH:MM:SSZ
```
- `T` separates the date and time.
- `Z` indicates UTC time.
Example: `2024-08-08T14:30:00Z`
## Pagination
By default, most list endpoints return a maximum of 100 records per page.
You can change the number of records on a per-request basis by passing a
`page_size` parameter in the request URL parameters. Example:
`page_size=50`.
When the response exceeds the per-page maximum, you can paginate through the
records by incrementing the page parameter. Example: `page=3`. List results
include `next` and `previous` URLs in the response body for easier
navigation:
```
{
"answers" [...],
"count": 106,
"next": "https://api.simplesat.io/api/answers/?page=2",
"previous": null,
}
```
Stop paging when the `next` attribute is `null`.
## Rate Limiting
Public v1 API requests are rate limited per account.
### How it works
- The limit is enforced in rolling 1‑minute windows.
- All requests for the same account share the same quota.
- If you exceed the limit, further requests in that window will return HTTP `429 Too Many Requests`.
### Rate limit headers
Every public v1 API response includes the following headers:
- `X-RateLimit-Limit` – the maximum number of requests allowed per 1‑minute window.
- `X-RateLimit-Remaining` – how many requests you have left in the current window.
- `X-RateLimit-Reset` – Unix timestamp (seconds) when the current window resets.
- `Retry-After` – only sent on HTTP `429 Too Many Requests`; number of seconds until you can retry.
| Header |
Example |
X-RateLimit-Limit |
300 |
X-RateLimit-Remaining |
42 |
X-RateLimit-Reset |
1737642000 |
Retry-After |
15 |
# Base URL: https://api.simplesat.io
```
--------------------------------
### GET /api/v1/questions
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
List questions.
Required scopes: `read questions`
```markdown
### Parameters
- **survey_id** (integer, query, optional): Filter questions by survey ID
- **metric** (string, query, optional): Filter questions by metric
- **page_size** (integer, query, optional): The number of questions to return per page
- **page** (integer, query, optional)
### Responses
#### 200 - Successful response
- **next** (string) (example: "https://api.simplesat.io/api/v1/questions?page=2&page_size=10")
- **previous** (string) (example: null)
- **count** (integer) (example: 79)
- **questions** (array (object))
Array items:
- **id** (integer) (example: 1)
- **survey** (object)
- **id** (integer) (example: 1)
- **name** (string) (example: "CSAT Survey")
- **order** (integer) (example: 1)
- **metric** (string) (example: "csat")
- **text** (string) (example: "How did we do?")
- **rating_scale** (boolean) (example: true)
- **required** (boolean) (example: true)
- **choices** (array (string)) (example: ["2","3","4"])
- **rules** (array (object))
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/questions?survey_id=0&metric=string&page_size=0&page=0"
```
```
--------------------------------
### GET /api/v1/customers
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Get a paginated list of customers with optional filtering by creation/modification dates and subscription status.
Required scopes: `read customers`
```markdown
### Parameters
- **page** (integer, query, optional): The page number to retrieve
- **page_size** (integer, query, optional): The number of records per page
- **created_after** (string (date-time), query, optional): Filter customers created after this date (ISO 8601 format) (example: "2025-01-01T00:00:00Z")
- **created_before** (string (date-time), query, optional): Filter customers created before this date (ISO 8601 format) (example: "2025-12-31T23:59:59Z")
- **modified_after** (string (date-time), query, optional): Filter customers modified after this date (ISO 8601 format) (example: "2025-01-01T00:00:00Z")
- **modified_before** (string (date-time), query, optional): Filter customers modified before this date (ISO 8601 format) (example: "2025-12-31T23:59:59Z")
- **subscribed** (boolean, query, optional): Filter customers by subscription status (example: true)
### Responses
#### 200 - Successful response
- **next** (string): URL for the next page of results (example: "https://api.simplesat.io/api/v1/customers?page=2&page_size=50")
- **previous** (string): URL for the previous page of results (example: null)
- **count** (integer): Total number of customers matching the query (example: 1)
- **customers** (array (object))
Array items:
- **id** (integer) (example: 1)
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **company** (string) (example: "Simplesat")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
- **created** (string (date-time)) (example: "2025-01-01T00:00:00.000000Z")
- **modified** (string (date-time)) (example: "2025-09-26T10:28:57.000000Z")
- **subscribed** (boolean) (example: true)
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/customers?page=1&page_size=50&created_after=2025-01-01T00:00:00Z&created_before=2025-12-31T23:59:59Z&modified_after=2025-01-01T00:00:00Z&modified_before=2025-12-31T23:59:59Z&subscribed=true"
```
```
--------------------------------
### GET /api/v1/surveys
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
List surveys.
Required scopes: `read surveys`
```markdown
### Parameters
- **page_size** (integer, query, optional): The number of surveys to return per page
- **page** (integer, query, optional)
### Responses
#### 200 - Successful response
- **next** (string) (example: "https://api.simplesat.io/api/v1/surveys?page=2&page_size=10")
- **previous** (string) (example: null)
- **count** (integer) (example: 25)
- **surveys** (array (object))
Array items:
- **id** (integer) (example: 1)
- **name** (string) (example: "Follow-up CSAT Survey")
- **metric** (string) (example: "CSAT")
- **survey_token** (string) (example: "z_3OxYijnEkfZSt6hLKxCRxBlu4CPQ9feLUAW4Eaen4")
- **survey_type** (string) (example: "generic_embed")
- **brand_name** (string) (example: "Simplesat")
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/surveys?page_size=0&page=0"
```
```
--------------------------------
### GET /api/v1/answers/{answer_id}
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Get an answer by ID.
Required scopes: `read answers`
```markdown
### Parameters
- **answer_id** (string, path, required): The ID of the answer to retrieve
### Responses
#### 200 - Successful response
- **question** (object)
- **id** (integer) (example: 1)
- **text** (string) (example: "How did we do?")
- **metric** (string) (example: "csat")
- **choice** (string) (example: "3")
- **choice_label** (string) (example: "Okay, but not great")
- **choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **sentiment** (string) (example: "neutral")
- **comment** (string) (example: "Very slow!")
- **follow_up_answer** (string) (example: "Thank you!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **survey** (object)
- **id** (integer) (example: 1)
- **name** (string) (example: "Follow-up CSAT")
- **created** (string (date-time)) (example: "2024-01-01T00:00:00")
- **modified** (string (date-time)) (example: "2024-01-01T00:00:00")
- **published_as_testimonial** (boolean) (example: false)
- **response_id** (integer) (example: 1)
#### 404 - Not found
- **detail** (string) (example: "No Answer matches the given query.")
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/answers/{answer_id}"
```
```
--------------------------------
### GET /api/v1/responses/{response_id}
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Get a response by ID.
Required scopes: `read responses`
```markdown
### Parameters
- **response_id** (string, path, required): The ID of the response to retrieve
### Responses
#### 200 - Successful response
- **id** (integer) (example: 1)
- **survey** (object) (example: {"id":1,"name":"Follow-up CSAT"})
- **id** (integer) (example: 1)
- **name** (string) (example: "Follow-up CSAT")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **created** (string (date-time)) (example: "2024-01-01T00:00:00Z")
- **modified** (string (date-time)) (example: "2024-01-02T00:00:00.000000Z")
- **ip_address** (string) (example: "192.168.1.1")
- **language** (string) (example: "English")
- **ticket** (object) (example: {"id":100,"external_id":"12345","subject":"Issue with product","custom_attributes":{"Priority":"Medium","Category":"Support"}})
- **id** (integer) (example: 100)
- **external_id** (string) (example: "12345")
- **subject** (string) (example: "Issue with product")
- **custom_attributes** (object) (example: {"Priority":"Medium","Category":"Support"})
- **team_members** (array (object)) (example: [{"id":1,"role":"Assignee","is_primary":true,"external_id":"1","name":"Tester McTestFace","email":"tester@simplesat.io"},{"id":1,"role":"Closed by","is_primary":false,"external_id":"1","name":"Tester McTestFace","email":"tester@simplesat.io"}])
Array items:
- **id** (integer) (example: 1)
- **role** (string) (example: "Assignee")
- **is_primary** (boolean) (example: true)
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **customer** (object) (example: {"id":1,"external_id":"1","name":"Tester McTestFace","email":"tester@simplesat.io","company":"Simplesat","tags":["premium","beta"],"custom_attributes":{"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]}})
- **id** (integer) (example: 1)
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **company** (string) (example: "Simplesat")
- **tags** (array (string)) (example: ["premium","beta"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
- **answers** (array (object))
Array items:
- **id** (integer) (example: 1)
- **question** (object) (example: {"id":1,"text":"How satisfied are you?","metric":"csat"})
- **id** (integer) (example: 1)
- **text** (string) (example: "How satisfied are you?")
- **metric** (string) (example: "csat")
- **choice** (string) (example: "4")
- **choices** (array (string)) (example: ["1","2","3"])
- **comment** (string) (example: "Great service!")
- **sentiment** (string) (example: "positive")
- **follow_up_answer** (string) (example: "Thank you!")
- **choice_label** (string) (example: "Absolutely amazing!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option A","Option B"])
- **follow_up_question** (object) (example: {"id":2,"text":"Would you recommend us to your friends?","metric":"csat"})
- **source** (string) (example: "generic_embed")
- **source** (string) (example: "generic_embed")
#### 404 - Not found
- **detail** (string) (example: "No Response matches the given query.")
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/responses/{response_id}"
```
```
--------------------------------
### GET /api/v1/team-members/{team_member_id}
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Get a team member by ID.
Required scopes: `read team members`
```markdown
### Parameters
- **team_member_id** (string, path, required): The ID of the team member to retrieve
### Responses
#### 200 - Successful response
- **id** (integer) (example: 1)
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **custom_attributes** (object) (example: {"Department":"Support","Level":"Senior"})
#### 404 - Not found
- **detail** (string) (example: "No TeamMember matches the given query.")
### Example Usage
```bash
curl -X GET "https://api.simplesat.io/api/v1/team-members/{team_member_id}"
```
```
--------------------------------
### POST /api/v1/customers/bulk
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Bulk upsert customers, creating or updating multiple customers at once.
Maximum 1000 customers per request.
Updating the `custom_attributes` or `tags` fields will overwrite any existing values.
Customers accept arrays in `custom_attributes`.
Customers with invalid data will be ignored.
Required scopes: `write customers`
```markdown
### Request Body
**Content-Type:** application/json
- **customers** (array (object))
Array items:
- **external_id** (string) (example: "12345")
- **email** (string) (example: "tester@simplesat.io")
- **name** (string) (example: "Tester McTestFace")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
- **company** (string) (example: "Simplesat")
### Responses
#### 200 - Successful response
- **request_id** (string) (example: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
- **detail** (string) (example: "Customer(s) successfully scheduled to be updated or created.")
#### 400 - Bad request
- **customers** (array (string))
### Example Usage
```bash
curl -X POST "https://api.simplesat.io/api/v1/customers/bulk" \
-H "Content-Type: application/json" \
-d '{
"customers": [
{
"external_id": 1,
"email": "tester@simplesat.io",
"name": "Tester McTestFace",
"company": "Simplesat",
"tags": [
"tag1",
"tag2"
],
"custom_attributes": {
"City": "San Francisco",
"Country": "United States",
"Languages": [
"English",
"Spanish"
]
}
}
]
}'
```
```
--------------------------------
### POST /api/v1/customers
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Create or update a customer.
If the customer with the specified email address already exists, the
existing customer will be updated.
Updating the `custom_attributes` or `tags` fields will overwrite any existing values.
Customers accept arrays in `custom_attributes`.
Required scopes: `write customers`
```markdown
### Request Body
**Content-Type:** application/json
- **external_id** (string) (example: "12345")
- **email** (string) (example: "tester@simplesat.io")
- **name** (string) (example: "Tester McTestFace")
- **company** (string) (example: "Simplesat")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
### Responses
#### 201 - Successful response
- **id** (integer) (example: 1)
- **external_id** (string) (example: "12345")
- **email** (string) (example: "tester@simplesat.io")
- **name** (string) (example: "Tester McTestFace")
- **tags** (array (string)) (example: ["tag1","tag2"])
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
- **company** (string) (example: "Simplesat")
### Example Usage
```bash
curl -X POST "https://api.simplesat.io/api/v1/customers" \
-H "Content-Type: application/json" \
-d '{
"email": "tester@simplesat.io",
"name": "Tester McTestFace",
"company": "Simplesat",
"tags": [
"tag1",
"tag2"
],
"custom_attributes": {
"Country": "United States",
"City": "San Francisco",
"Languages": [
"English",
"Spanish"
]
}
}'
```
```
--------------------------------
### Schema: Customer
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Schema definition for Customer
```markdown
## Schema: Customer
Schema definition for Customer
**Type:** object
- **id** (integer): Unique identifier for the customer, defined by Simplesat. (example: 1)
- **external_id** (string): The unique identifier of the customer from an external system. (example: "1")
- **created** (string (date-time)): The date and time the customer was created. (example: "2024-01-01T00:00:00Z")
- **modified** (string (date-time)): The date and time the customer was last modified. (example: "2024-01-01T00:00:00Z")
- **name** (string): Full name (first and last) of the customer. (example: "Tester McTestFace")
- **email** (string (email)): Email address of the customer. (example: "tester@example.com")
- **company** (string): The company associated with the customer. (example: "Simplesat")
- **custom_attributes** (object): Custom attributes associated with the customer. (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
```
--------------------------------
### POST /api/v1/answers/search
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Search for answers.
Required scopes: `read answers`
Accepted `operator` values are:
- `and`
- `or`
Accepted `comparison` values are:
- `is`
- `is_not`
- `contains`
- `does_not_contain`
- `is_unknown`
- `has_any_value`
Accepted `key` values are:
- `choice_value`
- `comment`
- `metric`
- `sentiment`
- `survey` (token)
```markdown
### Parameters
- **page** (integer, query, optional): The page number to retrieve
- **page_size** (integer, query, optional): The number of records per page
### Request Body
**Content-Type:** application/json
- **start_date** (string (date-time)) (example: "2024-01-01T00:00:00Z")
- **end_date** (string (date-time)) (example: "2024-12-31T23:59:59.000000Z")
- **operator** (string) (example: "and")
- **filters** (array (object))
Array items:
- **key** (string) (example: "sentiment")
- **values** (array (string)) (example: ["positive"])
- **comparison** (string) (example: "is")
### Responses
#### 200 - Successful response
- **next** (string) (example: "https://api.simplesat.io/api/v1/answers/search?page=2&page_size=50")
- **previous** (string) (example: null)
- **count** (integer) (example: 65)
- **answers** (array (object))
Array items:
- **id** (integer) (example: 1)
- **choice** (string) (example: "3")
- **choice_label** (string) (example: "Okay, but not great")
- **choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **comment** (string) (example: "Very slow!")
- **follow_up_answer** (string) (example: "Thank you!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **published_as_testimonial** (boolean) (example: false)
- **created** (string (date-time)) (example: "2024-10-11T05:38:19.000000Z")
- **modified** (string (date-time)) (example: "2024-11-12T03:17:13.000000Z")
- **question** (object)
- **id** (integer) (example: 219977)
- **text** (string) (example: "How did we do?")
- **metric** (string) (example: "csat")
- **sentiment** (string) (example: "neutral")
- **survey** (object)
- **id** (integer) (example: 1)
- **name** (string) (example: "Follow-up CSAT")
- **response_id** (integer) (example: 1)
- **id** (integer) (example: 1)
- **choice** (string) (example: "3")
- **choice_label** (string) (example: "Okay, but not great")
- **choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **comment** (string) (example: "Very slow!")
- **follow_up_answer** (string) (example: "Thank you!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option1","Option2","Option3"])
- **published_as_testimonial** (boolean) (example: false)
- **created** (string (date-time)) (example: "2024-01-01T00:00:00Z")
- **modified** (string (date-time)) (example: "2024-01-01T00:00:00Z")
- **question** (object)
- **sentiment** (string) (example: "neutral")
- **survey** (object)
- **response_id** (integer) (example: 1)
### Example Usage
```bash
curl -X POST "https://api.simplesat.io/api/v1/answers/search?page=0&page_size=0" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2024-01-01T00:00:00",
"end_date": "2024-12-31T23:59:59Z",
"operator": "and",
"filters": [
{
"key": "sentiment",
"values": [
"positive"
],
"comparison": "is"
}
]
}'
```
```
--------------------------------
### Schema: Answer
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
Schema definition for Answer
```markdown
## Schema: Answer
Schema definition for Answer
**Type:** object
- **id** (integer): Unique identifier for the answer, defined by Simplesat. (example: 1)
- **created** (string (date-time)): The date and time the answer was created. (example: "2024-01-01T00:00:00Z")
- **modified** (string (date-time)): The date and time the answer was last modified. (example: "2024-01-01T00:00:00Z")
- **question** (object): Information about the question the answer is associated with. (example: {"id":1,"text":"How did we do?","metric":"csat"})
- **id** (integer) (example: 1)
- **text** (string) (example: "How did we do?")
- **metric** (string) (example: "csat")
- **choice** (string): The choice selected by the customer for the question. (example: "3")
- **choice_label** (string): The label for the choice selected by the customer. (example: "Okay, but not great")
- **choices** (array (string)): The selected choices for the question. (example: ["Option1","Option2","Option3"])
- **sentiment** (string): The sentiment associated with the answer. (example: "neutral")
- **comment** (string): Any comment provided by the customer for the question. (example: "Very slow!")
- **follow_up_answer** (string): Any follow-up answer provided by the customer. (example: "Thank you!")
- **follow_up_answer_choice** (string): The choice selected by the customer for the follow-up question. (example: "yes")
- **follow_up_answer_choices** (array (string)): The selected choices for the follow-up question. (example: ["Option1","Option2","Option3"])
- **survey** (object): Information about the survey the answer is associated with. (example: {"id":1,"name":"Follow-up CSAT"})
- **id** (integer) (example: 1)
- **name** (string) (example: "Follow-up CSAT")
- **published_as_testimonial** (boolean): Whether the answer was published as a testimonial. (example: false)
- **response_id** (integer): The unique identifier of the response associated with the answer. (example: 1)
```
--------------------------------
### POST /api/v1/responses/create-or-update
Source: https://developer.simplesat.io/api/Simplesat%20API%20(v1)%20OpenAPI.yaml
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`
```markdown
### Request Body
**Content-Type:** application/json
- **survey_id** (integer) (required) (example: 1)
- **created** (string (date-time)): Optional date and time to set as the response creation timestamp (for example when importing or syncing historical responses). (example: "2024-01-01T00:00:00Z")
- **tags** (array (string)) (example: ["asset","issue"])
- **answers** (array (object))
Array items:
- **question_id** (integer) (required) (example: 1)
- **choice** (string) (example: "4")
- **choices** (array (string)) (example: ["Option1","Option2"])
- **comment** (string) (example: "Great!")
- **sentiment** (string) (example: "positive")
- **follow_up_answer** (string) (example: "Thank you!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option A","Option B"])
- **team_members** (array (object))
Array items:
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (required) (example: "tester@simplesat.io")
- **custom_attributes** (object) (example: {"Level":"Senior","Group":"Support"})
- **role** (string) (required) (example: "Closed by")
- **is_primary** (boolean) (required) (example: true)
- **ticket** (object) (example: {"external_id":"1","subject":"Coffee machine broken!","custom_attributes":{"Priority":"Medium","Category":"Support"}})
- **external_id** (string) (example: "1")
- **subject** (string) (example: "Coffee machine broken!")
- **custom_attributes** (object) (example: {"Priority":"Medium","Category":"Support"})
- **customer** (object) (example: {"external_id":"1","name":"Tester McTestFace","email":"tester@simplesat.io","tags":["asset","issue"],"company":"Simplesat","custom_attributes":{"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]}})
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (required) (example: "tester@simplesat.io")
- **tags** (array (string)) (example: ["asset","issue"])
- **company** (string) (example: "Simplesat")
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
### Responses
#### 200 - Successful response
- **survey_id** (integer) (example: 1)
- **language** (string) (example: "English")
- **ticket** (object)
- **id** (integer) (example: 1)
- **external_id** (string) (example: "1")
- **subject** (string) (example: "Issue with product")
- **custom_attributes** (object) (example: {"Priority":"Medium","Category":"Support"})
- **team_members** (array (object))
Array items:
- **external_id** (string) (example: "1")
- **name** (string) (example: "Tester McTestFace")
- **email** (string) (example: "tester@simplesat.io")
- **custom_attributes** (object) (example: {"Group":"Support","Level":"Senior"})
- **role** (string) (example: "Developer")
- **is_primary** (boolean) (example: true)
- **customer** (object)
- **external_id** (string) (example: "1")
- **name** (string) (example: "Simplesat")
- **email** (string) (example: "tester@simplesat.io")
- **tags** (array (string)) (example: ["premium","beta"])
- **company** (string) (example: "Simplesat")
- **custom_attributes** (object) (example: {"Country":"United States","City":"San Francisco","Languages":["English","Spanish"]})
- **answers** (array (object))
Array items:
- **id** (integer) (example: 1)
- **question** (object) (example: {"id":1,"text":"How did we do?","metric":"csat"})
- **id** (integer) (example: 1)
- **text** (string) (example: "How did we do?")
- **metric** (string) (example: "csat")
- **choice** (string) (example: "4")
- **choices** (array (string)) (example: ["Option A","Option B"])
- **comment** (string) (example: "Great service!")
- **sentiment** (string) (example: "positive")
- **follow_up_answer** (string) (example: "Thank you!")
- **choice_label** (string) (example: "Absolutely amazing!")
- **follow_up_answer_choice** (string) (example: "yes")
- **follow_up_answer_choices** (array (string)) (example: ["Option A","Option B"])
- **follow_up_question** (object) (example: {"id":2,"text":"Was there anything in particular we did that delighted you?","metric":"custom"})
- **id** (integer) (example: 1)
- **tags** (array (string)) (example: ["tag1","tag2"])
- **created** (string (date-time)) (example: "2024-01-01T01:00:00Z")
- **modified** (string (date-time)) (example: "2024-01-01T01:00:00Z")
- **ip_address** (string) (example: "192.168.1.1")
#### 400 - Bad request
- **survey_id** (array (string)) (example: ["This field is required."])
- **answers** (array (string)) (example: ["This field is required."])
### Example Usage
```bash
curl -X POST "https://api.simplesat.io/api/v1/responses/create-or-update" \
-H "Content-Type: application/json" \
-d '{
"survey_id": 1,
"created": "2024-01-01T00:00:00Z"
}'
```
```