{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":526,"path":"api-reference/rest-apis/ppm-api.md","title":"Project Portfolio Management API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Project Portfolio Management API\n\nThe Project Portfolio Management API provides endpoints to bulk import cost plans and project tasks.\n\nThe PPM Standard plugin \\(com.snc.financial\\_planning\\_pmo\\) is required to access this API. The calling user must have the it\\_project\\_manager role.\n\nThis API is provided within the `now` namespace.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Project Portfolio Management - POST /now/ppm/insert\\_cost\\_plans\n\nCreates cost plans in the Cost Plan \\[cost\\_plan\\] table.\n\n### URL format\n\nDefault URL: `/api/now/ppm/insert_cost_plans`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nend\\_fiscal\\_period\n\n</td><td>\n\nRequired. Sys\\_id of the ending fiscal period for the cost plan.Data type: String\n\nTable: Fiscal Period \\[fiscal\\_period\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the cost plan.Data type: String\n\n</td></tr><tr><td>\n\nresource\\_type\n\n</td><td>\n\nRequired. Sys\\_id of the resource type.Data type: String\n\nTable: Resource Type Definition \\[resource\\_type\\_definition\\]\n\n</td></tr><tr><td>\n\nstart\\_fiscal\\_period\n\n</td><td>\n\nRequired. Sys\\_id of the starting fiscal period for the cost plan.Data type: String\n\nTable: Fiscal Period \\[fiscal\\_period\\]\n\n</td></tr><tr><td>\n\ntask\n\n</td><td>\n\nRequired. Sys\\_id of the project or demand for the cost plan.Data type: String\n\nTable: Project \\[pm\\_project\\] or Demand \\[dmn\\_demand\\]\n\n</td></tr><tr><td>\n\nunit\\_cost\n\n</td><td>\n\nRequired. Unit cost for the cost plan.Data type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n\n### Response body parameters \\(JSON\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nObject containing information about the status of the API request.Data type: Object\n\n```\n\"result\": {\n   \"status\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.status\n\n</td><td>\n\nStatus of the API request.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example imports two cost plans.\n\n```\ncurl \"https://instance.servicenow.com/api/now/ppm/insert_cost_plans\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"[\n   {\n      \"name\": \"Cost plan 1\",\n      \"resource_type\": \"3d16eaf79330120064f572edb67ffb04\",\n      \"start_fiscal_period\": \"ed47e5d90b3010108d9ac74363673a98\",\n      \"end_fiscal_period\": \"0a47e5d90b3010108d9ac74363673afd\",\n      \"task\": \"0fc9f992db601810852ca6dc13961951\",\n      \"unit_cost\": 1200\n   },\n   {\n      \"name\": \"Cost plan 2\",\n      \"resource_type\": \"3d16eaf79330120064f572edb67ffb04\",\n      \"start_fiscal_period\": \"ed47e5d90b3010108d9ac74363673a98\",\n      \"end_fiscal_period\": \"7947e5d90b3010108d9ac74363673ac9\",\n      \"task\": \"0fc9f992db601810852ca6dc13961951\",\n      \"unit_cost\": 3600\n   }\n]\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n   \"result\": {\n      \"status\": \"success\"\n   }\n}\n```\n\n## Project Portfolio Management - POST /now/ppm/insert\\_project\\_tasks\n\nCreates a project and associated project tasks.\n\nProjects are created in the Project \\[pm\\_project\\] table and project tasks are created in the Project Task \\[pm\\_project\\_task\\] table.\n\n### URL format\n\nDefault URL: `/api/now/ppm/insert_project_tasks`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"table_qqf_x5s_bwb\" class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nchild\\_tasks\n\n</td><td>\n\nArray of tasks for the project. Each task is an object in the array.Data type: Array\n\n ```\n\"child_tasks\": [\n   {\n      \"child_tasks\": [Array],\n      \"external_id\": \"String\",\n      \"short_description\": \"String\" \n   }\n]\n```\n\n</td></tr><tr><td>\n\nchild\\_tasks.child\\_tasks\n\n</td><td>\n\nArray of child tasks for the parent task. Each child task is an object in the array. Each child task can have its own array of child tasks. Data type: Array\n\n ```\n\"child_tasks\": [\n   {\n      \"child_tasks\": [Array],\n      \"external_id\": \"String\",\n      \"short_description\": \"String\" \n   }\n]\n```\n\n</td></tr><tr><td>\n\nchild\\_tasks.external\\_id\n\n</td><td>\n\nUnique identifier of the task from the external system.Data type: String\n\n</td></tr><tr><td>\n\nchild\\_tasks.short\\_description\n\n</td><td>\n\nShort description of the task.Data type: String\n\n</td></tr><tr><td>\n\nend\\_date\n\n</td><td>\n\nEnd date for the project.Data type: String\n\n</td></tr><tr><td>\n\nexternal\\_id\n\n</td><td>\n\nUnique identifier of the project from the external system.Data type: String\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nShort description of the project.Data type: String\n\n</td></tr><tr><td>\n\nstart\\_date\n\n</td><td>\n\nStart date for the project.Data type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n\n### Response body parameters \\(JSON\\)\n\n<table id=\"table_wtd_kbt_bwb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nObject containing information about the status of the API request.Data type: Object\n\n ```\n\"result\": {\n   \"status\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.status\n\n</td><td>\n\nStatus of the API request.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example imports a project with two tasks \\(zpq\\_T1 and zpq\\_T2\\). The first task contains several child tasks, and the second task has dependencies on the child tasks from the first task.\n\n```\ncurl \"https://instance.servicenow.com/api/now/ppm/insert_project_tasks\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n   \"start_date\": \"2022-05-18 08:00:00\",\n   \"end_date\": \"2022-05-18 17:00:00\",\n   \"short_description\": \"zpq_Project\",\n   \"external_id\": \"0\",\n   \"child_tasks\": [\n      {\n         \"short_description\": \"zpq_T1\",\n         \"external_id\": \"1\",\n         \"child_tasks\": [\n            {\n               \"external_id\": \"1.1\",\n               \"short_description\": \"zpq_T11\",\n               \"child_tasks\": [\n                  {\n                     \"external_id\": \"1.1.1\",\n                     \"short_description\": \"zpq_T111\"\n                  }\n               ]\n            },\n            {\n               \"external_id\": \"1.2\",\n               \"short_description\": \"zpq_T12\"\n            }\n         ]\n      },\n      {\n         \"short_description\": \"zpq_T2\",\n         \"external_id\": \"2\",\n         \"dependencies\": [\n            {\n               \"external_id\": \"1.1\",\n               \"lag\": -1,\n               \"type\": \"fs\"\n            },\n            {\n               \"external_id\": \"1.2\",\n               \"lag\": 2,\n               \"type\": \"fs\"\n            }\n         ]\n      }\n   ]\n}\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n   \"result\": {\n      \"status\": \"success\"\n   }\n}\n```\n\n"}}