> ## 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.

# Criar uma meta

> Cria uma nova meta. Permite associar metas filhas (children) para metas compostas. Após a criação, executa o cálculo persistente do progresso.



## OpenAPI

````yaml /api-reference/openapi.json post /api/management/goals
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/goals:
    post:
      tags:
        - goals
      summary: Criar uma meta
      description: >-
        Cria uma nova meta. Permite associar metas filhas (children) para metas
        compostas. Após a criação, executa o cálculo persistente do progresso.
      operationId: criarMeta
      requestBody:
        content:
          application/json:
            schema:
              title: Criação de Meta
              description: Payload para criação de metas de diferentes tipos.
              oneOf:
                - title: Meta Manual
                  type: object
                  properties:
                    title:
                      type: string
                      maxLength: 191
                      example: Nova meta
                      description: Título da meta.
                    description:
                      type: string
                      example: Descrição da meta
                      description: Descrição detalhada da meta.
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - manual
                      example: manual
                      description: Tipo da meta.
                    periodicity:
                      type: integer
                      example: 1
                      description: Periodicidade da meta.
                    target:
                      type: number
                      example: 10
                      description: Valor alvo da meta.
                    unit:
                      type: string
                      example: count
                      description: Unidade utilizada na meta.
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                      description: Modo de comparação utilizado para validação da meta.
                    progress:
                      type: number
                      example: 1
                      description: Progresso inicial da meta manual.
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                      description: Data de início da meta.
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                      description: Data final da meta.
                    children:
                      type: array
                      description: Lista de metas filhas.
                      items:
                        type: string
                        format: uuid
                      example: []
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - progress
                    - start_date
                    - end_date
                - title: Meta de Projetos Criados
                  type: object
                  properties:
                    title:
                      type: string
                      example: Nova meta
                    description:
                      type: string
                      example: Descrição da meta
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - projects_created
                      example: projects_created
                    periodicity:
                      type: integer
                      example: 1
                    target:
                      type: number
                      example: 10
                    unit:
                      type: string
                      example: count
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                    children:
                      type: array
                      items:
                        type: string
                        format: uuid
                      example: []
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - start_date
                    - end_date
                - title: Meta de Projetos Criados por Usuário
                  type: object
                  properties:
                    title:
                      type: string
                      example: Nova meta
                    description:
                      type: string
                      example: Descrição da meta
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - projects_created_by_user
                      example: projects_created_by_user
                    periodicity:
                      type: integer
                      example: 1
                    target:
                      type: number
                      example: 10
                    unit:
                      type: string
                      example: count
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                    user_id:
                      type: string
                      format: uuid
                      example: 019c75de-5124-71d6-8698-271e32b743ce
                      description: ID do usuário associado à meta.
                    children:
                      type: array
                      items:
                        type: string
                        format: uuid
                      example: []
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - start_date
                    - end_date
                    - user_id
                - title: Meta de Projetos em Etapa
                  type: object
                  properties:
                    title:
                      type: string
                      example: Nova meta
                    description:
                      type: string
                      example: Descrição da meta
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - funnel_steps_links
                      example: funnel_steps_links
                    periodicity:
                      type: integer
                      example: 1
                    target:
                      type: number
                      example: 10
                    unit:
                      type: string
                      example: count
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                    funnel_step_id:
                      type: integer
                      example: 310
                      description: ID da etapa do funil.
                    children:
                      type: array
                      items:
                        type: string
                        format: uuid
                      example: []
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - start_date
                    - end_date
                    - funnel_step_id
                - title: Meta de Projetos em Etapa por Usuário
                  type: object
                  properties:
                    title:
                      type: string
                      example: Nova meta
                    description:
                      type: string
                      example: Descrição da meta
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - funnel_steps_links_by_user
                      example: funnel_steps_links_by_user
                    periodicity:
                      type: integer
                      example: 1
                    target:
                      type: number
                      example: 10
                    unit:
                      type: string
                      example: count
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                    funnel_step_id:
                      type: integer
                      example: 197
                      description: ID da etapa do funil.
                    user_id:
                      type: string
                      format: uuid
                      example: 019c75de-5124-71d6-8698-271e32b743ce
                      description: ID do usuário associado à meta.
                    children:
                      type: array
                      items:
                        type: string
                        format: uuid
                      example: []
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - start_date
                    - end_date
                    - funnel_step_id
                    - user_id
                - title: Meta Composta
                  type: object
                  properties:
                    title:
                      type: string
                      example: Nova meta
                    description:
                      type: string
                      example: Descrição da meta
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                        - completed
                      example: active
                      description: >-
                        Status atual da meta. Valores possíveis: active (Ativa),
                        inactive (Inativa), completed (Concluída).
                    type:
                      type: string
                      enum:
                        - composite
                      example: composite
                    periodicity:
                      type: integer
                      example: 1
                    target:
                      type: number
                      example: 10
                    unit:
                      type: string
                      example: count
                    comparison_mode:
                      type: string
                      enum:
                        - target
                      example: target
                    start_date:
                      type: string
                      format: date
                      example: '2026-05-27'
                    end_date:
                      type: string
                      format: date
                      example: '2026-06-05'
                    children:
                      type: array
                      description: Lista de UUIDs das metas filhas que compõem esta meta.
                      items:
                        type: string
                        format: uuid
                      example:
                        - 019e69d4-a622-7284-853c-762316b97783
                        - 019e69d2-a05d-71b8-8092-71ef4698c5ba
                  required:
                    - title
                    - status
                    - type
                    - periodicity
                    - target
                    - unit
                    - comparison_mode
                    - start_date
                    - end_date
                    - children
            examples:
              Criar meta:
                value:
                  title: Nova meta
                  description: Descrição da meta
                  status: active
                  type: funnel_steps_links_by_user
                  periodicity: 1
                  target: 10
                  unit: count
                  comparison_mode: target
                  start_date: '2026-05-27'
                  end_date: '2026-06-05'
                  children: []
                  funnel_step_id: 197
                  user_id: 019c75de-5124-71d6-8698-271e32b743ce
      responses:
        '200':
          description: '200'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````