---
title: "Create a question"
method: POST
path: "/{teamPid}/questions"
tags: ["Questions"]
---

# Create a question

`POST /{teamPid}/questions`

## Request

- Base URL: `https://api.rightmessage.com/v1`
- URL: `https://api.rightmessage.com/v1/{teamPid}/questions`
- Auth: HTTP bearer

Adds a question to the project's draft. Publish the draft to make it live.

Requires an API token with the `write` ability. Tokens created without abilities have `*`, which grants every ability.

## Path parameters

- `teamPid` string, required

## Request body

- StoreQuestionRequest
  - `text` string, required
  - `name` string
  - `description` string, nullable
  - `sync_to` string, nullable
  - `sync_to_field` string, nullable
  - `display_options` string[]
  - `segment_group_id` string, nullable
  - `display_type` 'buttons' | 'image' | 'list' | 'radio' | 'input'
  - `input_type` 'text' | 'textarea' | 'number' | 'email' | 'phone' | 'name' | 'address' | 'country' | 'url' | 'date' | 'rating' | 'nps' | 'null', nullable
  - `input_settings` object
    - `placeholder` string
    - `validation` string
    - `required` boolean
    - `nextButtonLabel` string, nullable
    - `skipButtonLabel` string, nullable
    - `numberType` 'plain' | 'currency' | 'percentage'
    - `currency` string
    - `prefix` string
    - `suffix` string
    - `min` number, nullable
    - `max` number, nullable
    - `step` number, nullable
    - `display` 'field' | 'slider'
    - `defaultValue` number, nullable
    - `minLabel` string
    - `maxLabel` string
    - `ratingMax` integer
    - `nameFormat` 'first_last' | 'full'
    - `defaultCountry` string
    - `partLabels` string[]
    - `partPlaceholders` string[]
    - `pinnedCountries` string[]
    - `excludedCountries` string[]
    - `detectCountry` boolean
    - `dateRange` 'any' | 'past' | 'future'
    - `dateRangeDays` integer
    - `mobileOnly` boolean
    - `suggestTypoFixes` boolean
    - `identify` boolean
    - `contactAction` object, nullable
      - `type` 'contact' | 'form' | 'list' | 'tag'
      - `settings` object
        - `partnerName` string
        - `formIds` string[]
        - `listIds` string[]
        - `tagIds` string[]
    - `consent` object
      - `disclosure` object
        - `enabled` boolean
        - `text` string
      - `checkbox` object
        - `enabled` boolean
        - `label` string
    - `syncFieldMap` string[]
  - `randomize_options` boolean
  - `options` object[]
    - `label` string
    - `segment_id` string, nullable
    - `id` string
    - `image_url` string
    - `conditions` string[]
    - `scores` string[]
  - `other_option` object
    - `enabled` boolean
    - `label` string
    - `input_type` string
    - `prompt` string
    - `placeholder` string, nullable
    - `sync_to_custom_field` string, nullable

## Response `201`

`QuestionResource`

- object
  - `data` QuestionResource, required
    - `id` string, nullable, required
    - `text` string, nullable, required
    - `sync_to` string, nullable, required
    - `sync_to_field` string, nullable, required
    - `display_options` string, required
    - `segment_group_id` string, nullable, required
    - `display_type` union, required
      - string
      - 'buttons'
    - `input_type` string, nullable, required
    - `input_settings` unknown[], nullable, required
      - unknown
    - `randomize_options` union, required
      - string
      - boolean
    - `options` object, required
    - `other_option` unknown[], nullable, required
      - unknown

## Other responses

- `401`: Missing, invalid or revoked API token.
- `403`: Authorization error
- `404`: Not found
- `422`: Validation error
- `429`: Rate limit exceeded: 120 requests per minute for project endpoints, 60 per minute for token and connection endpoints. Retry after the `Retry-After` seconds.

---

[API](https://skmtc.dev/rightmessage/apis/rightmessage-api.md) - [All operations](https://skmtc.dev/rightmessage/apis/rightmessage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rightmessage/apis/rightmessage-api/revisions/adec35e9720c?raw)
