> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Update a callout template

PUT https://rest.test.zuora.com/notifications/callout-templates/{id}
Content-Type: application/json

Updates a callout template. This operation supports updating the callout template for all event types.

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/events-and-notifications/notifications/update-callout-template

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `id` (string, required) — The ID of the callout template to be updated.

### Headers

- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).
- `Zuora-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.
- `Zuora-Org-Ids` (string, optional) — Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.

### Body (application/json)

This endpoint expects a PUTPublicCalloutTemplateRequest.

- `PUTPublicCalloutTemplateRequest`

## Response

### 200

OK

- `active` (boolean, optional) — The status of the callout template.
- `calloutAuth` (CalloutAuth, optional) — If `requiredAuth` is `true`, this object is required.
- `calloutBaseurl` (string, optional) — The callout URL.
- `calloutHeaders` (map from string to string, optional, nullable) — Container for custom callout headers. Each custom callout header consists of a header name and a header value.
- `calloutParams` (map from string to string, optional, nullable) — Container for callout parameters sent in the request body. Each callout parameter consists of a parameter name and a parameter value.
- `calloutRetry` (boolean, optional) — Indicates whether to retry the callout when the callout fails.
- `certificate` (string, optional, nullable) — The SSL certificate for the domain of the callout receiver server specified in `calloutBaseurl`.
- `confirmSuccessFromResponseContent` (boolean, optional) — Indicates how Zuora determines whether callout notifications to your system succeed or fail: * If `false`, Zuora determines the result based solely on the HTTP response status code. This is the default value. * If `true`, and the HTTP response status code is 200, Zuora evaluates the callout response and considers the notification successful only if the `Content-Type` header is set to `application/json`, and the response body contains a `success` field set to `true`.
- `contentType` (string, optional) — The callout body format.
- `createdBy` (string, optional) — The ID of the user who created the callout template.
- `createdOn` (datetime, optional) — The time when the callout template was created. Specified in the UTC timezone in the ISO860 format (YYYY-MM-DDThh:mm:ss.sTZD). E.g. 1997-07-16T19:20:30.45+00:00
- `customRequestBody` (string, optional, nullable) — Customized request body.
- `description` (string, optional) — Description for the callout template.
- `eventCategory` (double, optional) — The event category code for the standard event that the callout template relates to. This field is available only if the related event of this callout template is a standard event. For the list of supported standard event category codes, see Standard event category code for events and notifications.
- `eventTypeName` (string, optional) — The name of the custom event that the callout template relates to. This field is available only if the related event of this callout template is a Zuora custom event, custom event, or custom scheduled event.
- `eventTypeNamespace` (enum, optional) — The namespace of the `eventTypeName` field. It indicates who created the event and which namespace the event is assigned to. Supported values are as follows: - `com.zuora.notification`: events that are created by Zuora. This value applies to Zuora custom events. - `user.notification`: events that are created by tenant users. This value applies to custom events and custom scheduled events. This is the default value. This field is available only if the related event of this callout template is a Zuora custom event, custom event, or custom scheduled event.
  - Allowed values: `user.notification`, `com.zuora.notification`
- `hmacAlgorithm` (enum, optional, nullable) — The hash function Zuora uses to generate the signed data for HMAC authentication.
  - Allowed values: `MD5`, `SHA-1`, `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512`
- `hmacData` (string, optional, nullable) — The message to be authenticated for HMAC authentication.
- `hmacKey` (string, optional, nullable) — The header key that Zuora uses to send the header value for HMAC authentication. The header value is specified in the `hmacValue` field and typically contains the signed data.
- `hmacOutputFormat` (enum, optional, nullable) — The format of the signed data for HMAC authentication.
  - Allowed values: `BASE64`, `HEX`
- `hmacSecret` (string, optional, nullable) — The shared secret key that Zuora uses to generate the signed data for HMAC authentication.
- `hmacValue` (string, optional, nullable) — The header value for HMAC authentication. The header key is specified in the `hmacKey` field.
- `httpMethod` (enum, optional) — The HTTP method of the callout.
  - Allowed values: `POST`, `GET`, `PUT`, `PATCH`, `DELETE`
- `id` (string, optional) — The ID of the callout template.
- `name` (string, optional) — The name of the callout template.
- `oauth2ProviderId` (string, optional, nullable) — The ID of the OAuth 2.0 provider in your tenant that provides access tokens for the callout.
- `requiredAuth` (boolean, optional) — Indicates whether Basic authentication is enabled for the callout.
- `requiredOauth2` (boolean, optional) — Indicates whether OAuth 2.0 authentication is enabled for the callout.
- `updatedBy` (string, optional) — The ID of the user who updated the callout template.
- `updatedOn` (datetime, optional) — The time when the callout template was updated. Specified in the UTC timezone in the ISO860 format (YYYY-MM-DDThh:mm:ss.sTZD). E.g. 1997-07-16T19:20:30.45+00:00
- `useCustomRequestBody` (boolean, optional) — Indicates whether to enable the customized request body configured in the `customRequestBody` field.

## Errors

### 400 Bad Request Error

Bad Request

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 404 Not Found Error

Not Found

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 405 Method Not Allowed Error

Method Not Allowed

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 415 Unsupported Media Type Error

Unsupported Media Type

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 500 Internal Server Error

Internal Server Error

- `reasons` (list of ErrorResponseReasonsItems, optional)

## Types

### PUTPublicCalloutTemplateRequestCommon

Common information for callout templates.

- `active` (boolean, optional, default: true) — The status of the callout.
- `calloutBaseurl` (string, optional) — The callout URL. It must start with `https://`. Zuora uses port 443 to send callout notifications by default. If you want to use other ports, submit a request at Zuora Global Support. You can add merge fields in the callout URL. For example, `https://mywebsite.com/zuora/{{DataSource.Account.Id}}`. For more information, see Merge field syntax for email and callout templates.
- `calloutHeaders` (map from string to string, optional) — Container for custom callout headers. Each custom callout header consists of a header name and a header value.
- `calloutParams` (map from string to string, optional) — Container for callout parameters sent in the request body. Each callout parameter consists of a parameter name and a parameter value.
- `calloutRetry` (boolean, optional, default: true) — Specified whether to retry the callout when the callout fails. The default value is `true`.
- `certificate` (string, optional) — The SSL certificate for the domain of the callout receiver server specified in `calloutBaseurl`. The value must be in PEM format, which typically starts with `-----BEGIN CERTIFICATE-----` and ends with `-----END CERTIFICATE-----`. Specifying the SSL certificate can eliminate SSL certificate errors (HTTP status code 495) for callout notifications.
- `confirmSuccessFromResponseContent` (boolean, optional, default: false) — Indicates how Zuora determines whether callout notifications to your system succeed or fail: * If `false`, Zuora determines the result based solely on the HTTP response status code. This is the default value. * If `true`, and the HTTP response status code is 200, Zuora evaluates the callout response and considers the notification successful only if the `Content-Type` header is set to `application/json`, and the response body contains a `success` field set to `true`.
- `customRequestBody` (string, optional) — Customized request body. This field is available only for callouts whose Content-Type in the request body is `application/json`. The value must be in JSON format and double quotes in the value must be escaped. You can add merge fields to the request body. For example, `{\"AccountNumber\": \"{{DataSource.Account.AccountNumber}}\",\"AccountId\": \"{{DataSource.Account.Id}}\"}`. For more information, see Merge field syntax for email and callout templates. You must set `useCustomRequestBody` to `true` if you want to customize the callout request body with this field. Alternatively, you can use the `calloutParams` field.
- `description` (string, optional) — Description for the callout template.
- `hmacAlgorithm` (enum, optional) — The hash function Zuora uses to generate the signed data for HMAC authentication.
  - Allowed values: `MD5`, `SHA-1`, `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512`
- `hmacData` (string, optional) — The message to be authenticated for HMAC authentication. You can use merge fields in this value: * `{{Request.Headers.<header_name>}}`: Refers to the value of a particular request header. For example, `{{Request.Headers.Date}}` refers to the value of the request header called `Date`. * `{{Request.Body}}`: Refers to the request body. * Other merge fields: See Merge field syntax for email and callout templates.
- `hmacKey` (string, optional) — The header key that Zuora uses to send the header value for HMAC authentication. The header value is specified in the `hmacValue` field and typically contains the signed data.
- `hmacOutputFormat` (enum, optional) — The format of the signed data for HMAC authentication.
  - Allowed values: `BASE64`, `HEX`
- `hmacSecret` (string, optional) — The shared secret key that Zuora uses to generate the signed data for HMAC authentication.
- `hmacValue` (string, optional) — The header value for HMAC authentication. The header key is specified in the `hmacKey` field. You can use merge fields in this value: * `{{Request.HMAC.Signed}}`: Refers to the signed data. * Other merge fields: See Merge field syntax for email and callout templates. The following is a header value example: `The algorithm is SHA-256 and the signed data is {{Request.HMAC.Signed}}`.
- `httpMethod` (enum, optional) — The HTTP method of the callout.
  - Allowed values: `POST`, `GET`, `PUT`, `PATCH`, `DELETE`
- `name` (string, optional) — The name of the callout template. It must be unique across all callout templates.
- `useCustomRequestBody` (boolean, optional) — Indicates whether to enable the customized request body configured in the `customRequestBody` field.

### PUTPublicCalloutTemplateRequestBasicAuthentication

The Basic Authentication information for callout templates.

- `active` (boolean, optional, default: true) — The status of the callout.
- `calloutBaseurl` (string, optional) — The callout URL. It must start with `https://`. Zuora uses port 443 to send callout notifications by default. If you want to use other ports, submit a request at Zuora Global Support. You can add merge fields in the callout URL. For example, `https://mywebsite.com/zuora/{{DataSource.Account.Id}}`. For more information, see Merge field syntax for email and callout templates.
- `calloutHeaders` (map from string to string, optional) — Container for custom callout headers. Each custom callout header consists of a header name and a header value.
- `calloutParams` (map from string to string, optional) — Container for callout parameters sent in the request body. Each callout parameter consists of a parameter name and a parameter value.
- `calloutRetry` (boolean, optional, default: true) — Specified whether to retry the callout when the callout fails. The default value is `true`.
- `certificate` (string, optional) — The SSL certificate for the domain of the callout receiver server specified in `calloutBaseurl`. The value must be in PEM format, which typically starts with `-----BEGIN CERTIFICATE-----` and ends with `-----END CERTIFICATE-----`. Specifying the SSL certificate can eliminate SSL certificate errors (HTTP status code 495) for callout notifications.
- `confirmSuccessFromResponseContent` (boolean, optional, default: false) — Indicates how Zuora determines whether callout notifications to your system succeed or fail: * If `false`, Zuora determines the result based solely on the HTTP response status code. This is the default value. * If `true`, and the HTTP response status code is 200, Zuora evaluates the callout response and considers the notification successful only if the `Content-Type` header is set to `application/json`, and the response body contains a `success` field set to `true`.
- `customRequestBody` (string, optional) — Customized request body. This field is available only for callouts whose Content-Type in the request body is `application/json`. The value must be in JSON format and double quotes in the value must be escaped. You can add merge fields to the request body. For example, `{\"AccountNumber\": \"{{DataSource.Account.AccountNumber}}\",\"AccountId\": \"{{DataSource.Account.Id}}\"}`. For more information, see Merge field syntax for email and callout templates. You must set `useCustomRequestBody` to `true` if you want to customize the callout request body with this field. Alternatively, you can use the `calloutParams` field.
- `description` (string, optional) — Description for the callout template.
- `hmacAlgorithm` (enum, optional) — The hash function Zuora uses to generate the signed data for HMAC authentication.
  - Allowed values: `MD5`, `SHA-1`, `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512`
- `hmacData` (string, optional) — The message to be authenticated for HMAC authentication. You can use merge fields in this value: * `{{Request.Headers.<header_name>}}`: Refers to the value of a particular request header. For example, `{{Request.Headers.Date}}` refers to the value of the request header called `Date`. * `{{Request.Body}}`: Refers to the request body. * Other merge fields: See Merge field syntax for email and callout templates.
- `hmacKey` (string, optional) — The header key that Zuora uses to send the header value for HMAC authentication. The header value is specified in the `hmacValue` field and typically contains the signed data.
- `hmacOutputFormat` (enum, optional) — The format of the signed data for HMAC authentication.
  - Allowed values: `BASE64`, `HEX`
- `hmacSecret` (string, optional) — The shared secret key that Zuora uses to generate the signed data for HMAC authentication.
- `hmacValue` (string, optional) — The header value for HMAC authentication. The header key is specified in the `hmacKey` field. You can use merge fields in this value: * `{{Request.HMAC.Signed}}`: Refers to the signed data. * Other merge fields: See Merge field syntax for email and callout templates. The following is a header value example: `The algorithm is SHA-256 and the signed data is {{Request.HMAC.Signed}}`.
- `httpMethod` (enum, optional) — The HTTP method of the callout.
  - Allowed values: `POST`, `GET`, `PUT`, `PATCH`, `DELETE`
- `name` (string, optional) — The name of the callout template. It must be unique across all callout templates.
- `useCustomRequestBody` (boolean, optional) — Indicates whether to enable the customized request body configured in the `customRequestBody` field.
- `requiredAuth` (boolean, optional) — Indicates whether Basic authentication is enabled for the callout.
- `calloutAuth` (CalloutAuth, optional) — If `requiredAuth` is `true`, this object is required.

### PUTPublicCalloutTemplateRequestOauth2Authentication

The OAuth 2.0 Authentication information for callout templates.

- `active` (boolean, optional, default: true) — The status of the callout.
- `calloutBaseurl` (string, optional) — The callout URL. It must start with `https://`. Zuora uses port 443 to send callout notifications by default. If you want to use other ports, submit a request at Zuora Global Support. You can add merge fields in the callout URL. For example, `https://mywebsite.com/zuora/{{DataSource.Account.Id}}`. For more information, see Merge field syntax for email and callout templates.
- `calloutHeaders` (map from string to string, optional) — Container for custom callout headers. Each custom callout header consists of a header name and a header value.
- `calloutParams` (map from string to string, optional) — Container for callout parameters sent in the request body. Each callout parameter consists of a parameter name and a parameter value.
- `calloutRetry` (boolean, optional, default: true) — Specified whether to retry the callout when the callout fails. The default value is `true`.
- `certificate` (string, optional) — The SSL certificate for the domain of the callout receiver server specified in `calloutBaseurl`. The value must be in PEM format, which typically starts with `-----BEGIN CERTIFICATE-----` and ends with `-----END CERTIFICATE-----`. Specifying the SSL certificate can eliminate SSL certificate errors (HTTP status code 495) for callout notifications.
- `confirmSuccessFromResponseContent` (boolean, optional, default: false) — Indicates how Zuora determines whether callout notifications to your system succeed or fail: * If `false`, Zuora determines the result based solely on the HTTP response status code. This is the default value. * If `true`, and the HTTP response status code is 200, Zuora evaluates the callout response and considers the notification successful only if the `Content-Type` header is set to `application/json`, and the response body contains a `success` field set to `true`.
- `customRequestBody` (string, optional) — Customized request body. This field is available only for callouts whose Content-Type in the request body is `application/json`. The value must be in JSON format and double quotes in the value must be escaped. You can add merge fields to the request body. For example, `{\"AccountNumber\": \"{{DataSource.Account.AccountNumber}}\",\"AccountId\": \"{{DataSource.Account.Id}}\"}`. For more information, see Merge field syntax for email and callout templates. You must set `useCustomRequestBody` to `true` if you want to customize the callout request body with this field. Alternatively, you can use the `calloutParams` field.
- `description` (string, optional) — Description for the callout template.
- `hmacAlgorithm` (enum, optional) — The hash function Zuora uses to generate the signed data for HMAC authentication.
  - Allowed values: `MD5`, `SHA-1`, `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512`
- `hmacData` (string, optional) — The message to be authenticated for HMAC authentication. You can use merge fields in this value: * `{{Request.Headers.<header_name>}}`: Refers to the value of a particular request header. For example, `{{Request.Headers.Date}}` refers to the value of the request header called `Date`. * `{{Request.Body}}`: Refers to the request body. * Other merge fields: See Merge field syntax for email and callout templates.
- `hmacKey` (string, optional) — The header key that Zuora uses to send the header value for HMAC authentication. The header value is specified in the `hmacValue` field and typically contains the signed data.
- `hmacOutputFormat` (enum, optional) — The format of the signed data for HMAC authentication.
  - Allowed values: `BASE64`, `HEX`
- `hmacSecret` (string, optional) — The shared secret key that Zuora uses to generate the signed data for HMAC authentication.
- `hmacValue` (string, optional) — The header value for HMAC authentication. The header key is specified in the `hmacKey` field. You can use merge fields in this value: * `{{Request.HMAC.Signed}}`: Refers to the signed data. * Other merge fields: See Merge field syntax for email and callout templates. The following is a header value example: `The algorithm is SHA-256 and the signed data is {{Request.HMAC.Signed}}`.
- `httpMethod` (enum, optional) — The HTTP method of the callout.
  - Allowed values: `POST`, `GET`, `PUT`, `PATCH`, `DELETE`
- `name` (string, optional) — The name of the callout template. It must be unique across all callout templates.
- `useCustomRequestBody` (boolean, optional) — Indicates whether to enable the customized request body configured in the `customRequestBody` field.
- `requiredOauth2` (boolean, optional) — Indicates whether OAuth 2.0 authentication is enabled for the callout.
- `oauth2ProviderId` (any, optional) — The ID of the OAuth 2.0 provider in your tenant that provides access tokens for the callout. For more information about how to get the ID of an OAuth 2.0 provider, see Retrieve the ID of an OAuth 2.0 provider.

### CalloutAuth

If `requiredAuth` is `true`, this object is required.

- `domain` (string, optional) — The domain of the callout auth.
- `password` (string, optional) — The field is required when `requiredAuth` is `true`.
- `preemptive` (boolean, optional) — Set this field to `true` if you want to enable the preemptive authentication.
- `username` (string, optional) — The field is required when `requiredAuth` is `true`.

### ErrorResponseReasonsItems

- `code` (string, optional) — The error code of response.
- `message` (string, optional) — The detail information of the error response

## Examples

### response

**Response**

```json
{
  "active": true,
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "calloutHeaders": null,
  "calloutParams": null,
  "calloutRetry": true,
  "certificate": null,
  "confirmSuccessFromResponseContent": false,
  "contentType": "APPLICATION_JSON",
  "createdBy": "8a90e08282f4ed040182f67bab2902ff",
  "createdOn": "2024-06-17T04:07:13.000 UTC",
  "customRequestBody": null,
  "description": "Callout when an account is edited",
  "eventTypeName": "AccountEdit",
  "eventTypeNamespace": "user.notification",
  "hmacAlgorithm": null,
  "hmacData": null,
  "hmacKey": null,
  "hmacOutputFormat": null,
  "hmacSecret": null,
  "hmacValue": null,
  "httpMethod": "POST",
  "id": "dcc5a61ee76e496c984206131b5b83e7",
  "name": "Account Edit",
  "oauth2ProviderId": null,
  "requiredAuth": false,
  "requiredOauth2": false,
  "updatedBy": "8a90e08282f4ed040182f67bab2902ff",
  "updatedOn": "2024-06-17T04:07:13.000 UTC",
  "useCustomRequestBody": false
}
```

**SDK Code**

```python response
import requests

url = "https://rest.test.zuora.com/notifications/callout-templates/id"

headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript response
const url = 'https://rest.test.zuora.com/notifications/callout-templates/id';
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/notifications/callout-templates/id"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby response
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/notifications/callout-templates/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://rest.test.zuora.com/notifications/callout-templates/id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://rest.test.zuora.com/notifications/callout-templates/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp response
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/notifications/callout-templates/id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/notifications/callout-templates/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Callout - Without authentication

**Request**

```json
{
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit"
}
```

**Response**

```json
{
  "active": true,
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "calloutHeaders": null,
  "calloutParams": null,
  "calloutRetry": true,
  "certificate": null,
  "confirmSuccessFromResponseContent": false,
  "contentType": "APPLICATION_JSON",
  "createdBy": "8a90e08282f4ed040182f67bab2902ff",
  "createdOn": "2024-06-17T04:07:13.000 UTC",
  "customRequestBody": null,
  "description": "Callout when an account is edited",
  "eventTypeName": "AccountEdit",
  "eventTypeNamespace": "user.notification",
  "hmacAlgorithm": null,
  "hmacData": null,
  "hmacKey": null,
  "hmacOutputFormat": null,
  "hmacSecret": null,
  "hmacValue": null,
  "httpMethod": "POST",
  "id": "dcc5a61ee76e496c984206131b5b83e7",
  "name": "Account Edit",
  "oauth2ProviderId": null,
  "requiredAuth": false,
  "requiredOauth2": false,
  "updatedBy": "8a90e08282f4ed040182f67bab2902ff",
  "updatedOn": "2024-06-17T04:07:13.000 UTC",
  "useCustomRequestBody": false
}
```

**SDK Code**

```python Callout - Without authentication
import requests

url = "https://rest.test.zuora.com/notifications/callout-templates/id"

payload = {
    "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
    "httpMethod": "POST",
    "name": "Account Edit"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Callout - Without authentication
const url = 'https://rest.test.zuora.com/notifications/callout-templates/id';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"calloutBaseurl":"https://www.example.com/callout/AccountEdit","httpMethod":"POST","name":"Account Edit"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Callout - Without authentication
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/notifications/callout-templates/id"

	payload := strings.NewReader("{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Callout - Without authentication
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/notifications/callout-templates/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\"\n}"

response = http.request(request)
puts response.read_body
```

```java Callout - Without authentication
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://rest.test.zuora.com/notifications/callout-templates/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\"\n}")
  .asString();
```

```php Callout - Without authentication
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://rest.test.zuora.com/notifications/callout-templates/id', [
  'body' => '{
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Callout - Without authentication
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/notifications/callout-templates/id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Callout - Without authentication
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/notifications/callout-templates/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Callout - Base authentication

**Request**

```json
{
  "calloutAuth": {
    "password": "pw123",
    "username": "name"
  },
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "requiredAuth": true
}
```

**Response**

```json
{
  "active": true,
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "calloutHeaders": null,
  "calloutParams": null,
  "calloutRetry": true,
  "certificate": null,
  "confirmSuccessFromResponseContent": false,
  "contentType": "APPLICATION_JSON",
  "createdBy": "8a90e08282f4ed040182f67bab2902ff",
  "createdOn": "2024-06-17T04:07:13.000 UTC",
  "customRequestBody": null,
  "description": "Callout when an account is edited",
  "eventTypeName": "AccountEdit",
  "eventTypeNamespace": "user.notification",
  "hmacAlgorithm": null,
  "hmacData": null,
  "hmacKey": null,
  "hmacOutputFormat": null,
  "hmacSecret": null,
  "hmacValue": null,
  "httpMethod": "POST",
  "id": "dcc5a61ee76e496c984206131b5b83e7",
  "name": "Account Edit",
  "oauth2ProviderId": null,
  "requiredAuth": false,
  "requiredOauth2": false,
  "updatedBy": "8a90e08282f4ed040182f67bab2902ff",
  "updatedOn": "2024-06-17T04:07:13.000 UTC",
  "useCustomRequestBody": false
}
```

**SDK Code**

```python Callout - Base authentication
import requests

url = "https://rest.test.zuora.com/notifications/callout-templates/id"

payload = {
    "calloutAuth": {
        "password": "pw123",
        "username": "name"
    },
    "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
    "httpMethod": "POST",
    "name": "Account Edit",
    "requiredAuth": True
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Callout - Base authentication
const url = 'https://rest.test.zuora.com/notifications/callout-templates/id';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"calloutAuth":{"password":"pw123","username":"name"},"calloutBaseurl":"https://www.example.com/callout/AccountEdit","httpMethod":"POST","name":"Account Edit","requiredAuth":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Callout - Base authentication
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/notifications/callout-templates/id"

	payload := strings.NewReader("{\n  \"calloutAuth\": {\n    \"password\": \"pw123\",\n    \"username\": \"name\"\n  },\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"requiredAuth\": true\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Callout - Base authentication
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/notifications/callout-templates/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"calloutAuth\": {\n    \"password\": \"pw123\",\n    \"username\": \"name\"\n  },\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"requiredAuth\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Callout - Base authentication
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://rest.test.zuora.com/notifications/callout-templates/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"calloutAuth\": {\n    \"password\": \"pw123\",\n    \"username\": \"name\"\n  },\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"requiredAuth\": true\n}")
  .asString();
```

```php Callout - Base authentication
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://rest.test.zuora.com/notifications/callout-templates/id', [
  'body' => '{
  "calloutAuth": {
    "password": "pw123",
    "username": "name"
  },
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "requiredAuth": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Callout - Base authentication
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/notifications/callout-templates/id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"calloutAuth\": {\n    \"password\": \"pw123\",\n    \"username\": \"name\"\n  },\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"requiredAuth\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Callout - Base authentication
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "calloutAuth": [
    "password": "pw123",
    "username": "name"
  ],
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "requiredAuth": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/notifications/callout-templates/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Callout - OAuth 2.0 authentication

**Request**

```json
{
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "oauth2ProviderId": "8ad099a98b94d51e018ba3beb9ed6c29",
  "requiredOauth2": true
}
```

**Response**

```json
{
  "active": true,
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "calloutHeaders": null,
  "calloutParams": null,
  "calloutRetry": true,
  "certificate": null,
  "confirmSuccessFromResponseContent": false,
  "contentType": "APPLICATION_JSON",
  "createdBy": "8a90e08282f4ed040182f67bab2902ff",
  "createdOn": "2024-06-17T04:07:13.000 UTC",
  "customRequestBody": null,
  "description": "Callout when an account is edited",
  "eventTypeName": "AccountEdit",
  "eventTypeNamespace": "user.notification",
  "hmacAlgorithm": null,
  "hmacData": null,
  "hmacKey": null,
  "hmacOutputFormat": null,
  "hmacSecret": null,
  "hmacValue": null,
  "httpMethod": "POST",
  "id": "dcc5a61ee76e496c984206131b5b83e7",
  "name": "Account Edit",
  "oauth2ProviderId": null,
  "requiredAuth": false,
  "requiredOauth2": false,
  "updatedBy": "8a90e08282f4ed040182f67bab2902ff",
  "updatedOn": "2024-06-17T04:07:13.000 UTC",
  "useCustomRequestBody": false
}
```

**SDK Code**

```python Callout - OAuth 2.0 authentication
import requests

url = "https://rest.test.zuora.com/notifications/callout-templates/id"

payload = {
    "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
    "httpMethod": "POST",
    "name": "Account Edit",
    "oauth2ProviderId": "8ad099a98b94d51e018ba3beb9ed6c29",
    "requiredOauth2": True
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Callout - OAuth 2.0 authentication
const url = 'https://rest.test.zuora.com/notifications/callout-templates/id';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"calloutBaseurl":"https://www.example.com/callout/AccountEdit","httpMethod":"POST","name":"Account Edit","oauth2ProviderId":"8ad099a98b94d51e018ba3beb9ed6c29","requiredOauth2":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Callout - OAuth 2.0 authentication
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/notifications/callout-templates/id"

	payload := strings.NewReader("{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"oauth2ProviderId\": \"8ad099a98b94d51e018ba3beb9ed6c29\",\n  \"requiredOauth2\": true\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Callout - OAuth 2.0 authentication
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/notifications/callout-templates/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"oauth2ProviderId\": \"8ad099a98b94d51e018ba3beb9ed6c29\",\n  \"requiredOauth2\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Callout - OAuth 2.0 authentication
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://rest.test.zuora.com/notifications/callout-templates/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"oauth2ProviderId\": \"8ad099a98b94d51e018ba3beb9ed6c29\",\n  \"requiredOauth2\": true\n}")
  .asString();
```

```php Callout - OAuth 2.0 authentication
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://rest.test.zuora.com/notifications/callout-templates/id', [
  'body' => '{
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "oauth2ProviderId": "8ad099a98b94d51e018ba3beb9ed6c29",
  "requiredOauth2": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Callout - OAuth 2.0 authentication
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/notifications/callout-templates/id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"calloutBaseurl\": \"https://www.example.com/callout/AccountEdit\",\n  \"httpMethod\": \"POST\",\n  \"name\": \"Account Edit\",\n  \"oauth2ProviderId\": \"8ad099a98b94d51e018ba3beb9ed6c29\",\n  \"requiredOauth2\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Callout - OAuth 2.0 authentication
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "calloutBaseurl": "https://www.example.com/callout/AccountEdit",
  "httpMethod": "POST",
  "name": "Account Edit",
  "oauth2ProviderId": "8ad099a98b94d51e018ba3beb9ed6c29",
  "requiredOauth2": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/notifications/callout-templates/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```