Skip to Content
API ReferencePrivate API EndpointsAdd Industry-Specific Question

Add Industry-Specific Question


PUT

/api/specificQuestion


Summary

Adds a new question into the set of questions that are answered for a given industry.


Description

The Add Industry-Specific Question API adds a new question into the set of questions that are answered for a given industry in the database.

Key characteristics of this endpoint:

  • Private access only.
  • Three query parameters, no request body
  • Clear separation between database errors and unexpected server failures

Endpoint

PUT /api/specificQuestion

Request

This endpoint accepts three parameters.

Parameters

ParametersRequiredTypeDescription
industrymandatorystringThe industry to which the question should be added for future data addition
questionmandatorystringThe question itself. Note that all special characters must be appropriately encoded
qualitativemandatorybooleanWhether the question is of type qualitative or not

Headers

This endpoint accepts a singular optional header.

HeaderRequiredDescription
AcceptoptionalDefaults to application/json

Response Schema

Success - 200 OK

Example Response
[]

Error Codes & Response Types

503 Service Unavailable

Returned when the database is temporarily unavailable, a query fails due to a database issue, or Gemini is overloaded.

Response Body
{ "detail" : "Database temporarily unavailable" }
Typical Causes
  1. MongoDB Connection Issues
  2. Database timeout or query failure for a non-general reason

500 Internal Server Error

Returned when an unexpected server-side error occurs.

Response Body
{ "detail" : "Internal server error" }
Typical Causes
  1. Unhandled runtime exception
  2. Application-level failure outside database operations.

Implementation Notes

  1. Logs both database-specific and unexpected errors for observability
  2. Treats empty datasets as a valid state, not an error condition
Last updated on