goals

Cria uma meta e já calcula o progresso inicial dela. Os campos de recorte (user_id, funnel_step_id) e a lista de metas filhas (children) só são aceitos preenchidos nos tipos que os exigem; nos demais tipos eles devem ir nulos ou vazios. Metas do tipo manual informam o progresso no próprio corpo.

post/api/management/goals

Request

  • Base URL: https://api.olie.ai
  • URL: https://api.olie.ai/api/management/goals
  • Auth: HTTP bearer

Request body

titlestring required

Título da meta. Até 90 caracteres.

descriptionstring

Descrição livre da meta. Até 255 caracteres.

status'active' | 'inactive' | 'completed'

Situação da meta: active (em apuração), inactive (pausada, sem cálculo automático) ou completed (encerrada). Quando omitido na criação, a meta nasce inactive.

type'manual' | 'projects_created' | 'projects_created_by_user' | 'funnel_steps_links' | 'funnel_steps_links_by_user' | 'composite' required

Tipo da meta, que define como o progresso é apurado: manual (informado à mão), projects_created (projetos criados), projects_created_by_user (projetos criados por um usuário), funnel_steps_links (entradas em uma etapa de funil), funnel_steps_links_by_user (entradas em uma etapa de funil feitas por um usuário) e composite (soma do progresso das metas filhas).

user_idstring uuid

Usuário ao qual a meta fica restrita. Obrigatório nos tipos projects_created_by_user e funnel_steps_links_by_user e proibido nos demais (envie nulo). O usuário precisa fazer parte da empresa.

funnel_step_idinteger

Etapa de funil apurada pela meta. Obrigatório nos tipos funnel_steps_links e funnel_steps_links_by_user e proibido nos demais (envie nulo).

start_datestring date required

Data de início da apuração, no formato YYYY-MM-DD.

end_datestring date

Data de término da apuração, no formato YYYY-MM-DD. Precisa ser posterior a start_date. Nulo deixa a meta sem prazo final.

periodicityinteger

Tamanho de cada período de apuração, em dias (0 a 365). Use 0 para apurar o intervalo inteiro de uma vez, sem quebrar em períodos.

targetinteger required

Valor alvo da meta, na unidade indicada em unit. Mínimo 1.

unit'count' | 'currency' | 'percentage'

Unidade do alvo e do progresso: count (quantidade), currency (valor monetário) ou percentage (porcentagem). Padrão count.

comparison_mode'target' | 'limit'

Leitura do alvo: target quando a meta é atingir o valor, limit quando a meta é não ultrapassá-lo. Padrão target.

progressinteger

Progresso da meta. Só é aceito (e passa a ser obrigatório) em metas do tipo manual com status active; nos demais casos é ignorado, porque o progresso é calculado pelo sistema.

childrenstring[]

IDs das metas que compõem esta meta. Obrigatório no tipo composite e proibido nos demais (envie uma lista vazia). Não aceita IDs repetidos, nem a própria meta ou alguma de suas metas-pai, para não criar ciclo.

Response

Sucesso

responseboolean

Indicador de sucesso da requisição. Sempre true nas respostas bem-sucedidas.

Changes

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      removed subschema #1: Meta Manual subschema #2: Meta de Projetos Criados subschema #3: Meta de Projetos Criados por Usuário subschema #4: Meta de Projetos em Etapa subschema #5: Meta de Projetos em Etapa por Usuário subschema #6: Meta Composta from the request body oneOf list

    • breaking

      the request's body type changed from no type to object

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the / response's property type changed from integer to number for status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      added the new active enum value to the / response property for the response status

    • warning

      added the new completed enum value to the / response property for the response status

    • warning

      added the new composite enum value to the / response property for the response status

    • warning

      added the new count enum value to the / response property for the response status

    • warning

      added the new currency enum value to the / response property for the response status

    • warning

      added the new funnel_steps_links enum value to the / response property for the response status

    • warning

      added the new funnel_steps_links_by_user enum value to the / response property for the response status

    • warning

      added the new inactive enum value to the / response property for the response status

    • warning

      added the new limit enum value to the / response property for the response status

    • warning

      added the new manual enum value to the / response property for the response status

    • warning

      added the new percentage enum value to the / response property for the response status

    • warning

      added the new projects_created enum value to the / response property for the response status

    • warning

      added the new projects_created_by_user enum value to the / response property for the response status

    • warning

      added the new target enum value to the / response property for the response status

    • warning

      added the new validation_errors enum value to the response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status