---
title: Update a Salesforce incident template
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Salesforce Integration
---

# Update a Salesforce incident template{% #update-a-salesforce-incident-template %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                                          |
| ----------------- | --------------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id} |

### Overview

Update a single Salesforce incident template in your organization. This endpoint requires the `manage_integrations` permission.

### Arguments

#### Path Parameters

| Name                                   | Type   | Description                                 |
| -------------------------------------- | ------ | ------------------------------------------- |
| incident_template_id [*required*] | string | The ID of the Salesforce incident template. |

### Request

#### Body Data (required)

Salesforce incident template payload.

{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                                                                       |
| ------------ | ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Salesforce incident template data for an update request.                                                          |
| data         | attributes [*required*] | object | Salesforce incident template attributes for an update request.                                                    |
| attributes   | description                  | string | Long-form description body for Salesforce incidents created from this template.                                   |
| attributes   | name                         | string | Human-readable name for this incident template.                                                                   |
| attributes   | owner_id                     | string | The Salesforce user ID that owns incidents created from this template.                                            |
| attributes   | priority                     | enum   | Priority of the Salesforce incident created from this template. Allowed enum values: `Critical,High,Moderate,Low` |
| attributes   | salesforce_org_id            | uuid   | The Datadog-assigned ID of the Salesforce organization this template belongs to.                                  |
| attributes   | subject                      | string | Subject line for Salesforce incidents created from this template.                                                 |
| data         | id [*required*]         | string | The ID of the Salesforce incident template being updated. Must match the path parameter.                          |
| data         | type [*required*]       | enum   | Salesforce incident template resource type. Allowed enum values: `salesforce-incidents-incident-template`         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "An incident was detected by Datadog monitors.",
      "name": "production-outage",
      "owner_id": "005000000000000",
      "priority": "High",
      "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3",
      "subject": "Datadog Incident: Production Outage"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "salesforce-incidents-incident-template"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a Salesforce incident template.

| Parent field | Field                        | Type   | Description                                                                                                       |
| ------------ | ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Salesforce incident template data from a response.                                                                |
| data         | attributes [*required*] | object | Salesforce incident template attributes returned by the API.                                                      |
| attributes   | description                  | string | Long-form description body for Salesforce incidents created from this template.                                   |
| attributes   | name                         | string | Human-readable name for this incident template.                                                                   |
| attributes   | owner_id                     | string | The Salesforce user ID that owns incidents created from this template.                                            |
| attributes   | priority                     | enum   | Priority of the Salesforce incident created from this template. Allowed enum values: `Critical,High,Moderate,Low` |
| attributes   | salesforce_org_id            | uuid   | The Datadog-assigned ID of the Salesforce organization this template belongs to.                                  |
| attributes   | subject                      | string | Subject line for Salesforce incidents created from this template.                                                 |
| data         | id [*required*]         | string | The ID of the Salesforce incident template.                                                                       |
| data         | type [*required*]       | enum   | Salesforce incident template resource type. Allowed enum values: `salesforce-incidents-incident-template`         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "An incident was detected by Datadog monitors.",
      "name": "production-outage",
      "owner_id": "005000000000000",
      "priority": "High",
      "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3",
      "subject": "Datadog Incident: Production Outage"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "salesforce-incidents-incident-template"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="409" %}
Conflict
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export incident_template_id="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/integration/salesforce-incidents/incident-templates/${incident_template_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "production-outage-renamed"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "salesforce-incidents-incident-template"
  }
}
EOF 
                
##### 

```python
"""
Update a Salesforce incident template returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.salesforce_integration_api import SalesforceIntegrationApi
from datadog_api_client.v2.model.salesforce_incidents_template_priority import SalesforceIncidentsTemplatePriority
from datadog_api_client.v2.model.salesforce_incidents_template_type import SalesforceIncidentsTemplateType
from datadog_api_client.v2.model.salesforce_incidents_template_update_attributes import (
    SalesforceIncidentsTemplateUpdateAttributes,
)
from datadog_api_client.v2.model.salesforce_incidents_template_update_data import SalesforceIncidentsTemplateUpdateData
from datadog_api_client.v2.model.salesforce_incidents_template_update_request import (
    SalesforceIncidentsTemplateUpdateRequest,
)
from uuid import UUID

body = SalesforceIncidentsTemplateUpdateRequest(
    data=SalesforceIncidentsTemplateUpdateData(
        attributes=SalesforceIncidentsTemplateUpdateAttributes(
            description="An incident was detected by Datadog monitors.",
            name="production-outage",
            owner_id="005000000000000",
            priority=SalesforceIncidentsTemplatePriority.HIGH,
            salesforce_org_id=UUID("596da4af-0563-4097-90ff-07230c3f9db3"),
            subject="Datadog Incident: Production Outage",
        ),
        id="596da4af-0563-4097-90ff-07230c3f9db3",
        type=SalesforceIncidentsTemplateType.SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = SalesforceIntegrationApi(api_client)
    response = api_instance.update_incident_template(incident_template_id="incident_template_id", body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Update a Salesforce incident template returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new

body = DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateRequest.new({
  data: DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateData.new({
    attributes: DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateAttributes.new({
      description: "An incident was detected by Datadog monitors.",
      name: "production-outage",
      owner_id: "005000000000000",
      priority: DatadogAPIClient::V2::SalesforceIncidentsTemplatePriority::HIGH,
      salesforce_org_id: "596da4af-0563-4097-90ff-07230c3f9db3",
      subject: "Datadog Incident: Production Outage",
    }),
    id: "596da4af-0563-4097-90ff-07230c3f9db3",
    type: DatadogAPIClient::V2::SalesforceIncidentsTemplateType::SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
  }),
})
p api_instance.update_incident_template("incident_template_id", body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Update a Salesforce incident template returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
	"github.com/google/uuid"
)

func main() {
	body := datadogV2.SalesforceIncidentsTemplateUpdateRequest{
		Data: datadogV2.SalesforceIncidentsTemplateUpdateData{
			Attributes: datadogV2.SalesforceIncidentsTemplateUpdateAttributes{
				Description:     datadog.PtrString("An incident was detected by Datadog monitors."),
				Name:            datadog.PtrString("production-outage"),
				OwnerId:         datadog.PtrString("005000000000000"),
				Priority:        datadogV2.SALESFORCEINCIDENTSTEMPLATEPRIORITY_HIGH.Ptr(),
				SalesforceOrgId: datadog.PtrUUID(uuid.MustParse("596da4af-0563-4097-90ff-07230c3f9db3")),
				Subject:         datadog.PtrString("Datadog Incident: Production Outage"),
			},
			Id:   "596da4af-0563-4097-90ff-07230c3f9db3",
			Type: datadogV2.SALESFORCEINCIDENTSTEMPLATETYPE_SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSalesforceIntegrationApi(apiClient)
	resp, r, err := api.UpdateIncidentTemplate(ctx, "incident_template_id", body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SalesforceIntegrationApi.UpdateIncidentTemplate`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SalesforceIntegrationApi.UpdateIncidentTemplate`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Update a Salesforce incident template returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SalesforceIntegrationApi;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplatePriority;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplateResponse;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplateType;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplateUpdateAttributes;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplateUpdateData;
import com.datadog.api.client.v2.model.SalesforceIncidentsTemplateUpdateRequest;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    SalesforceIntegrationApi apiInstance = new SalesforceIntegrationApi(defaultClient);

    SalesforceIncidentsTemplateUpdateRequest body =
        new SalesforceIncidentsTemplateUpdateRequest()
            .data(
                new SalesforceIncidentsTemplateUpdateData()
                    .attributes(
                        new SalesforceIncidentsTemplateUpdateAttributes()
                            .description("An incident was detected by Datadog monitors.")
                            .name("production-outage")
                            .ownerId("005000000000000")
                            .priority(SalesforceIncidentsTemplatePriority.HIGH)
                            .salesforceOrgId(
                                UUID.fromString("596da4af-0563-4097-90ff-07230c3f9db3"))
                            .subject("Datadog Incident: Production Outage"))
                    .id("596da4af-0563-4097-90ff-07230c3f9db3")
                    .type(SalesforceIncidentsTemplateType.SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE));

    try {
      SalesforceIncidentsTemplateResponse result =
          apiInstance.updateIncidentTemplate("incident_template_id", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SalesforceIntegrationApi#updateIncidentTemplate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Update a Salesforce incident template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_salesforce_integration::SalesforceIntegrationAPI;
use datadog_api_client::datadogV2::model::SalesforceIncidentsTemplatePriority;
use datadog_api_client::datadogV2::model::SalesforceIncidentsTemplateType;
use datadog_api_client::datadogV2::model::SalesforceIncidentsTemplateUpdateAttributes;
use datadog_api_client::datadogV2::model::SalesforceIncidentsTemplateUpdateData;
use datadog_api_client::datadogV2::model::SalesforceIncidentsTemplateUpdateRequest;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body =
        SalesforceIncidentsTemplateUpdateRequest::new(SalesforceIncidentsTemplateUpdateData::new(
            SalesforceIncidentsTemplateUpdateAttributes::new()
                .description("An incident was detected by Datadog monitors.".to_string())
                .name("production-outage".to_string())
                .owner_id("005000000000000".to_string())
                .priority(SalesforceIncidentsTemplatePriority::HIGH)
                .salesforce_org_id(
                    Uuid::parse_str("596da4af-0563-4097-90ff-07230c3f9db3").expect("invalid UUID"),
                )
                .subject("Datadog Incident: Production Outage".to_string()),
            "596da4af-0563-4097-90ff-07230c3f9db3".to_string(),
            SalesforceIncidentsTemplateType::SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
        ));
    let configuration = datadog::Configuration::new();
    let api = SalesforceIntegrationAPI::with_config(configuration);
    let resp = api
        .update_incident_template("incident_template_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Update a Salesforce incident template returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.SalesforceIntegrationApi(configuration);

const params: v2.SalesforceIntegrationApiUpdateIncidentTemplateRequest = {
  body: {
    data: {
      attributes: {
        description: "An incident was detected by Datadog monitors.",
        name: "production-outage",
        ownerId: "005000000000000",
        priority: "High",
        salesforceOrgId: "596da4af-0563-4097-90ff-07230c3f9db3",
        subject: "Datadog Incident: Production Outage",
      },
      id: "596da4af-0563-4097-90ff-07230c3f9db3",
      type: "salesforce-incidents-incident-template",
    },
  },
  incidentTemplateId: "incident_template_id",
};

apiInstance
  .updateIncidentTemplate(params)
  .then((data: v2.SalesforceIncidentsTemplateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
