> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Responder um formulário dinâmico

> Responder um formulário dinâmico. Essa requisição recebe dois principais atributos:

- Identificação do formulário (`target`): Aqui é usado um objeto com propriedades variáveis, são usados para identificar qual formulário será respondido.
    
- Respostas (`answers`): Um array com objetos, cada objeto contendo `id` e `answer`, sendo o ID do campo do formulário e answer sendo a resposta que este campo receberá.



## OpenAPI

````yaml /api-reference/openapi.json post /api/management/dynamic-forms/set-form-answers
openapi: 3.0.0
info:
  title: Olie API
  version: 1.0.0
  description: >
    # Introdução 👋


    Olá! Esta é a documentação oficial da API da [olie.ai](https://olie.ai/).
    Aqui você encontra as referências e exemplos de uso dos nossos endpoints.


    Para uma visão completa, recomendamos fortemente que você leia a
    [documentação oficial](https://docs.olie.ai/api-reference/introduction). Lá
    estão detalhados tópicos essenciais como
    [autenticação](https://docs.olie.ai/api-reference/introduction/authentication),
    [estrutura de
    respostas](https://docs.olie.ai/api-reference/general/response-structure),
    [paginação](https://docs.olie.ai/api-reference/general/pagination) e outros
    guias de integração.


    No Postman, esta coleção foca nas informações específicas de cada requisição
    (endpoints, parâmetros e exemplos), servindo como apoio rápido para testes e
    desenvolvimento.
servers:
  - url: https://api.olie.ai
security:
  - BearerAuth: []
paths:
  /api/management/dynamic-forms/set-form-answers:
    post:
      tags:
        - dynamic-forms
      summary: Responder um formulário dinâmico
      description: >-
        Responder um formulário dinâmico. Essa requisição recebe dois principais
        atributos:


        - Identificação do formulário (`target`): Aqui é usado um objeto com
        propriedades variáveis, são usados para identificar qual formulário será
        respondido.
            
        - Respostas (`answers`): Um array com objetos, cada objeto contendo `id`
        e `answer`, sendo o ID do campo do formulário e answer sendo a resposta
        que este campo receberá.
      requestBody:
        content:
          application/json:
            schema:
              description: Dados para responder um formulário dinâmico
              title: SetFormAnswers
              type: object
              properties:
                target:
                  type: object
                  title: Target
                  description: Objeto que descreve o alvo do formulário dinâmico
                  properties:
                    pivot_class:
                      type: string
                      enum:
                        - project
                        - contact
                        - customer
                        - projectfunnelassignment
                        - projectlooseform
                        - projectstepform
                      example: project
                    father_class:
                      type: string
                      enum:
                        - project
                        - contact
                        - customer
                        - projectfunnelassignment
                        - projectlooseform
                        - projectstepform
                      example: project
                    form_id:
                      type: integer
                      example: 43
                      description: ID do formulário
                    related_model_attribute_id:
                      type: string
                      example: 9ee8c42a-909e-4502-a1e9-4431245c5455
                      description: Necessário quando pivot_class é 'Project'.
                      format: uuid
                    id:
                      example: 9ee8c42a-909e-4502-a1e9-4431245c5455
                      description: >-
                        Necessário quando pivot_class é 'Project' ou
                        'ProjectLooseForm'. É o ID da classe que detém o
                        formulário
                      anyOf:
                        - type: string
                        - type: integer
                    project_funnel_id:
                      type: integer
                      example: 129
                      description: >-
                        Necessário quando pivot_class é
                        'ProjectFunnelAssignment'.
                    project_id:
                      type: string
                      example: 9ee8c42a-909e-4502-a1e9-4431245c5455
                      description: >-
                        Necessário quando pivot_class é
                        'ProjectFunnelAssignment', 'ProjectLooseForm' ou
                        'ProjectStepForm'.
                      format: uuid
                    funnel_step_id:
                      type: integer
                      example: 402
                      description: Necessário quando pivot_class é 'ProjectStepForm'.
                    father_id:
                      type: string
                      example: 9ee8c42a-909e-4502-a1e9-4431245c5455
                      format: uuid
                  required:
                    - father_class
                    - father_id
                    - pivot_class
                    - form_id
                form_answers:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 179
                        description: ID do campo do formulário
                      answer:
                        example: exemple
                        anyOf:
                          - type: string
                          - type: array
                            items: {}
                    required:
                      - id
                      - answer
            example:
              target:
                father_class: project
                father_id: 00000000-0000-0000-0000-000000000000
                pivot_class: project
                form_id: 0
                related_model_attribute_id: 00000000-0000-0000-0000-000000000000
                id: 00000000-0000-0000-0000-000000000000
                project_funnel_id: 0
                project_id: 00000000-0000-0000-0000-000000000000
                funnel_step_id: 0
              form_answers:
                - id: 0
                  answer: ''
                - id: 0
                  answer: ''
      responses:
        '200':
          description: 'Resposta: Formulário objeto projeto'
          headers:
            Date:
              schema:
                type: string
              example: Tue, 16 Dec 2025 14:49:55 GMT
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
            Connection:
              schema:
                type: string
              example: keep-alive
            Cache-Control:
              schema:
                type: string
              example: private, must-revalidate
            pragma:
              schema:
                type: string
              example: no-cache
            expires:
              schema:
                type: integer
              example: -1
            X-RateLimit-Limit:
              schema:
                type: integer
              example: 160
            X-RateLimit-Remaining:
              schema:
                type: integer
              example: 154
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    type: boolean
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        label:
                          type: string
                        answer:
                          type: string
                        model:
                          type: string
                        answered_by:
                          type: string
                        updated_at:
                          type: string
                          format: date-time
              example:
                response: true
                edges:
                  - id: 2130
                    label: Texto curto
                    answer: >-
                      Exemplo de resposta no formulário do objeto projeto:
                      Voluptates ipsam amet vel mollitia.
                    model: Project
                    answered_by: 019aeaa3-2370-731c-9008-be759795f449
                    updated_at: '2025-12-16T14:49:55.000000Z'
                  - id: 2131
                    label: Texto longo
                    answer: >-
                      Exemplo de resposta no formulário do objeto projeto: Quia
                      perspiciatis voluptates maiores.
                    model: Project
                    answered_by: 019aeaa3-2370-731c-9008-be759795f449
                    updated_at: '2025-12-16T14:49:55.000000Z'
        '401':
          description: 'Erro: Não autorizado'
          headers:
            Date:
              schema:
                type: string
              example: Tue, 16 Dec 2025 15:01:12 GMT
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
            Connection:
              schema:
                type: string
              example: keep-alive
            Cache-Control:
              schema:
                type: string
              example: private, must-revalidate
            pragma:
              schema:
                type: string
              example: no-cache
            expires:
              schema:
                type: integer
              example: -1
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
        '404':
          description: 'Erro: Objeto não encontrado'
          headers:
            Date:
              schema:
                type: string
              example: Tue, 16 Dec 2025 15:03:37 GMT
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
            Connection:
              schema:
                type: string
              example: keep-alive
            Cache-Control:
              schema:
                type: string
              example: private, must-revalidate
            X-RateLimit-Limit:
              schema:
                type: integer
              example: 160
            X-RateLimit-Remaining:
              schema:
                type: integer
              example: 159
            pragma:
              schema:
                type: string
              example: no-cache
            expires:
              schema:
                type: integer
              example: -1
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    type: boolean
                  message:
                    type: string
                  error:
                    type: string
              example:
                response: false
                message: project_model_not_found
                error: >-
                  No query results for model [App\Models\Project]
                  00000000-0000-0000-0000-000000000000
        '422':
          description: 'Erro: Objeto sem relação com o formulário'
          headers:
            Date:
              schema:
                type: string
              example: Tue, 16 Dec 2025 15:06:23 GMT
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
            Connection:
              schema:
                type: string
              example: keep-alive
            Cache-Control:
              schema:
                type: string
              example: private, must-revalidate
            X-RateLimit-Limit:
              schema:
                type: integer
              example: 160
            X-RateLimit-Remaining:
              schema:
                type: integer
              example: 154
            pragma:
              schema:
                type: string
              example: no-cache
            expires:
              schema:
                type: integer
              example: -1
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    type: boolean
                  service:
                    type: string
                  message:
                    type: string
                  error:
                    type: string
              example:
                response: false
                service: App\Exceptions\Services\Form\FormException
                message: father_df_options_has_none_compatible_possibility
                error: >-
                  The father class possibilities has none compatible form with
                  given attributes
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````