Skip to main content
PUT
/
modalities
/
{modality}
/
question
Definir pergunta da modalidade
curl --request PUT \
  --url http://localhost/api/v1/modalities/{modality}/question \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "label": "<string>",
  "options": [
    "<string>"
  ],
  "help_text": "<string>",
  "is_active": true,
  "sort_order": 123
}
'
{
  "data": {
    "id": 123,
    "modality_id": 123,
    "label": "<string>",
    "type": "<string>",
    "options": [
      "<unknown>"
    ],
    "help_text": "<string>",
    "is_active": true,
    "sort_order": 123,
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.

Path Parameters

modality
integer
required

Body

application/json

PUT /api/v1/modalities/{modality}/question — cria/atualiza a pergunta de opt-in do hub autenticado pra aquela modalidade (1 por (hub, modalidade)).

options é obrigatória quando o tipo exige lista (select/multiselect), espelhando RegistrationFieldType::requiresOptions().

label
string
required
Maximum string length: 120
type
enum<string>
required
Available options:
text,
textarea,
select,
multiselect,
checkbox,
file
options
string[] | null
help_text
string | null
Maximum string length: 500
is_active
boolean | null
sort_order
integer | null

Response

JsonResource

data
ModalityQuestionResource · object
required