goals

Atualizar informações de uma meta

Atualiza uma meta e recalcula o progresso dela em seguida. Título, tipo, data de início e alvo precisam ser enviados sempre, mesmo quando não mudam; os demais campos omitidos permanecem como estão. A lista children é sincronizada: as metas filhas que não aparecerem nela são desvinculadas.

put/api/management/goals/{goal}

Request body

titlestring required

Título da meta. Até 90 caracteres.

descriptionstring nullable

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 nullable

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 nullable

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 nullable

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 nullable

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

Changed in 6 of the 98 revisions of this API.164216

  • d71b18b1685d111613See the full diff
    • ▲

      added the new required request property

      new-required-request-property

    • ▲

      added the new required request property

      new-required-request-property

    • ▲

      added the new required request property

      new-required-request-property

    • ▲

      added the new required request property

      new-required-request-property

    • ▲

      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

      request-body-one-of-removed

    • ▲

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

      request-body-type-changed

    • ▲

      the response property / became nullable for the status

      response-property-became-nullable

    • ▲

      the response property / became nullable for the status

      response-property-became-nullable

    • ▲

      the response property / became nullable for the status

      response-property-became-nullable

    • ▲

      the response property / became nullable for the status

      response-property-became-nullable

    • ▲

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

      response-property-type-changed

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ●

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

      response-property-enum-value-added

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ○

      added the media type application/json for the response with the status

      response-media-type-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

  • 4a6533a9991446See the full diff
    • ▲

      added the new required request property /

      new-required-request-property

    • ▲

      added the new required request property /

      new-required-request-property

    • ▲

      added the new required request property /

      new-required-request-property

    • ▲

      added the new required request property /

      new-required-request-property

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

  • 17ef2bf71daa1111See the full diff
    • ▲

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

      request-body-type-changed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ○

      added 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 to the request body oneOf list

      request-body-one-of-added