{
  "opencollection": "1.0.0",
  "info": {
    "name": "Pipedrive API v1 Activities Goals API",
    "version": "1.0.0"
  },
  "items": [
    {
      "info": {
        "name": "Goals",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Add a new goal",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.pipedrive.com/v1/goals",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "x-api-token",
              "value": "{{x-api-token}}",
              "placement": "header"
            }
          },
          "docs": "Adds a new goal. Along with adding a new goal, a report is created to track the progress of your goal."
        },
        {
          "info": {
            "name": "Find goals",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.pipedrive.com/v1/goals/find",
            "params": [
              {
                "name": "type.name",
                "value": "",
                "type": "query",
                "description": "The type of the goal. If provided, everyone's goals will be returned."
              },
              {
                "name": "title",
                "value": "",
                "type": "query",
                "description": "The title of the goal"
              },
              {
                "name": "is_active",
                "value": "",
                "type": "query",
                "description": "Whether the goal is active or not"
              },
              {
                "name": "assignee.id",
                "value": "",
                "type": "query",
                "description": "The ID of the user who's goal to fetch. When omitted, only your goals will be returned."
              },
              {
                "name": "assignee.type",
                "value": "",
                "type": "query",
                "description": "The type of the goal's assignee. If provided, everyone's goals will be returned."
              },
              {
                "name": "expected_outcome.target",
                "value": "",
                "type": "query",
                "description": "The numeric value of the outcome. If provided, everyone's goals will be returned."
              },
              {
                "name": "expected_outcome.tracking_metric",
                "value": "",
                "type": "query",
                "description": "The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned."
              },
              {
                "name": "expected_outcome.currency_id",
                "value": "",
                "type": "query",
                "description": "The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned."
              },
              {
                "name": "type.params.pipeline_id",
                "value": "",
                "type": "query",
                "description": "An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned."
              },
              {
                "name": "type.params.stage_id",
                "value": "",
                "type": "query",
                "description": "The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned."
              },
              {
                "name": "type.params.activity_type_id",
                "value": "",
                "type": "query",
                "description": "An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned."
              },
              {
                "name": "period.start",
                "value": "",
                "type": "query",
                "description": "The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too."
              },
              {
                "name": "period.end",
                "value": "",
                "type": "query",
                "description": "The end date of the period for which to find goals. Date in format of YYYY-MM-DD."
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "x-api-token",
              "value": "{{x-api-token}}",
              "placement": "header"
            }
          },
          "docs": "Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=<true|false>` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa."
        },
        {
          "info": {
            "name": "Update existing goal",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.pipedrive.com/v1/goals/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The ID of the goal"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "x-api-token",
              "value": "{{x-api-token}}",
              "placement": "header"
            }
          },
          "docs": "Updates an existing goal."
        },
        {
          "info": {
            "name": "Delete existing goal",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.pipedrive.com/v1/goals/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The ID of the goal"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "x-api-token",
              "value": "{{x-api-token}}",
              "placement": "header"
            }
          },
          "docs": "Marks a goal as deleted."
        },
        {
          "info": {
            "name": "Get result of a goal",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.pipedrive.com/v1/goals/:id/results",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The ID of the goal that the results are looked for"
              },
              {
                "name": "period.start",
                "value": "",
                "type": "query",
                "description": "The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date.\n"
              },
              {
                "name": "period.end",
                "value": "",
                "type": "query",
                "description": "The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date.\n"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "x-api-token",
              "value": "{{x-api-token}}",
              "placement": "header"
            }
          },
          "docs": "Gets the progress of a goal for the specified period."
        }
      ]
    }
  ],
  "bundled": true
}