surveys

Mixin for ViewSets to handle approval-gate exceptions raised from decorated serializers.

Intercepts ApprovalRequired (409) and PolicyConflict (400) raised by the @approval_gate decorator on serializer methods and converts them into the same responses the viewset path produces (see decorators._result_to_response), so both paths share one contract.

post/api/projects/{project_id}/surveys/{id}/generate_translations/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/surveys/{id}/generate_translations/
  • Auth: HTTP bearer

Path parameters

idstring uuid required

A UUID string identifying this survey.

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

target_languagestring required

Language code to generate translations for, for example pt-BR.

source_languagestring

Optional override for the source language code. Defaults to the survey's base_language (or 'en' if unset).

overwriteboolean

Whether to overwrite existing translations for this language.

surveyobject

Optional translation-only draft survey payload to translate instead of the last saved survey.

Response

translationsobject required

Survey-level translation patch keyed by language.

generated_field_pathsstring[] required

Editor field paths generated by AI and safe to highlight as draft content.

trace_idstring required

LLM trace id for debugging and feedback.

Changes

No recorded changes to this operation across all 1 revision of this API.