Create a Project from Template

POST/projects​/from-template/ — Use this method to create a new project from another project or from a project template.

Parameters

Path parameters

None

Query string parameter

Path parameter

Required / Optional

Description

Type

expand

Optional

A comma-separated list of attributes available for expansion. The comma-separated list may include spaces (or %20 in the URL encoded string).

Note:

The expand value must contain only attributes referencing a supported object type. If return_object is set to any value other than 0 (zero), and the comma-separated list includes at least one attribute that is not available for expansion, the request fails — an error is returned and the object is not added or updated. For more information about attributes available for expansion and supported object types, see Available Expansions and Supported Object Types.

string

fields

Optional

A comma-separated list of attributes to include in the response. If not specified, the response includes all attributes for the project returned.

string

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

return_object

Optional

If set to any value other than 0 (zero), the response will return the project created. Otherwise, the response will include only the internal ID of the project created.

Boolean

Request body

The Project object to be created. The object must include valid key-value pairs for all required attributes and cannot include key-value pairs for read-only attributes. For information about the Project object model, see Project object properties.

The following properties are specific to the POST/projects​/from-template/ method. The internal ID of the template project (templateProjectId) must be included.

Property

Description

Type

Optional / Required

Query allowed

copyApprovers

A 1/0 field indicating whether to copy the project approvers associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyBookings

A 1/0 field indicating whether to copy the bookings associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyCpExcludeFilters

A 1/0 field indicating whether to copy the customers and projects to exclude from denominator when calculating user allocation % from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

copyCustomFields

A 1/0 field indicating whether to copy the custom field values from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyDashboardSettings

A 1/0 field indicating whether to copy the dashboard settings from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyExpensePolicy

A 1/0 field indicating whether to copy the expense policy associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyInvoiceLayoutSettings

A 1/0 field indicating whether to copy the invoice layout settings associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyIssues

A 1/0 field indicating whether to copy the issues associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyLoadedCost

A 1/0 field indicating whether to copy the loaded costs from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyNotificationSettings

A 1/0 field indicating whether to copy the notification settings from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyProjectAssignmentProfiles

A 1/0 field indicating whether to copy the project assignment profiles associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyProjectBillingAutoSetting

A 1/0 field indicating whether to copy the automated project autobilling settings from the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyProjectBillingRules

A 1/0 field indicating whether to copy the project billing rules associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyProjectBudgetGroups

A 1/0 field indicating whether to copy the project budget groups associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyProjectPricing

A 1/0 field indicating whether to copy the project pricing associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyRevenueRecognitionAutoSettings

A 1/0 field indicating whether to copy the project revenue recognition autorun settings associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

copyRevenueRecognitionRules

A 1/0 field indicating whether to copy the project revenue recognition rules associated with the project or project template specified in templateProjectId. Used only with POST/projects/from-template/.

Boolean

Optional

templateProjectId

The internal ID of the project or project template to be copied. Used only with POST/projects/from-template/.

integer($int64)

Required

Response definitions

A successful request returns a JSON object with the following properties:

Property

Description

data

An array containing one of the following:

  • The Project objects created, if the return_object parameter was set to any value other than 0 (zero) in the request. The object includes all the attributes specified using the fields if included in the request.

  • An object with only the internal ID of the project created.

See Returned Data.

included

An array of expanded objects, if the expand parameter was set in the request.

See Referenced Objects and Expansion.

meta

An object containing information about objects referenced by internal ID in the data array (object type and internal ID). Only returned if the return_object parameter was set to any value other than 0 (zero) in the request.

See Referenced Objects and Expansion.

message

A string containing a brief message about the status of your request — for example, “Success”.

A failed request returns a JSON object with the following properties:

Property

Description

message

A string containing a brief message about the status of your request.

Sample request

            POST /rest/v1/projects/from-template?return_object=1 HTTP/1.1
Host: company-id.app.openair.com
Content-Type: application/json
Authorization: Bearer <OAuth2_access_token>

{
  "name": "New project copied from template",
  "customerId": 1,
  "hierarchyNodes": [{"id": 72}],
  "filterSets": [{"id": 2}, {"id": 3}],
  "templateProjectId": 7,
  "startDate": "2022-12-31",
  "copyProjectBillingRules": 1,
  "copyProjectBillingAutoSetting": 1,
  "copyProjectPricing": true,
  "copyCustomFields": true,
  "copyLoadedCost": true,
  "copyApprovers": true,
  "copyIssues": true,
  "copyNotificationSettings": true,
  "copyDashboardSettings": true,
  "copyInvoiceLayoutSettings": true,
  "copyBookings": true,
  "copyProjectBudgetGroups": true,
  "copyExpensePolicy": true,
  "copyProjectAssignmentProfiles": true,
 } 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

            {
    "message": "success",
    "data": [{
          "id": 123
    }]
}