> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ruach.ng/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Template

> Update an existing message template

## Update Template

Update the content or name of an existing message template.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://app.notify.ng/api/v2/Template?id=138" \
    -H "Content-Type: application/json" \
    -d '{
      "TemplateName": "Updated Welcome Message",
      "MessageTemplate": "Welcome to ##CompanyName##! Your account ID is ##AccountId##. We are excited to have you on board.",
      "ApiKey": "YOUR_API_KEY",
      "ClientId": "YOUR_CLIENT_ID"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.notify.ng/api/v2/Template?id=138', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      TemplateName: 'Updated Welcome Message',
      MessageTemplate: 'Welcome to ##CompanyName##! Your account ID is ##AccountId##. We are excited to have you on board.',
      ApiKey: 'YOUR_API_KEY',
      ClientId: 'YOUR_CLIENT_ID'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.notify.ng/api/v2/Template?id=138"
  data = {
      "TemplateName": "Updated Welcome Message",
      "MessageTemplate": "Welcome to ##CompanyName##! Your account ID is ##AccountId##. We are excited to have you on board.",
      "ApiKey": "YOUR_API_KEY",
      "ClientId": "YOUR_CLIENT_ID"
  }

  response = requests.put(url, json=data)
  result = response.json()
  print(result)
  ```
</CodeGroup>

## Parameters

<ParamField query="id" type="number" required>
  ID of the template to update
</ParamField>

## Request Body

<ParamField body="TemplateName" type="string" required>
  Updated name of the template
</ParamField>

<ParamField body="MessageTemplate" type="string" required>
  Updated template content with placeholders
</ParamField>

<ParamField body="ApiKey" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField body="ClientId" type="string" required>
  Your client identifier for authentication
</ParamField>

## Response

<ResponseField name="ErrorCode" type="number">
  Error code (0 for success)
</ResponseField>

<ResponseField name="ErrorDescription" type="string">
  Description of the result
</ResponseField>

<ResponseField name="Data" type="string">
  Success message
</ResponseField>

### Success Response

```json theme={null}
{
  "ErrorCode": 0,
  "ErrorDescription": "Success",
  "Data": "Template updated Successfully."
}
```

## Use Cases

* **Content updates**: Modify template content for better messaging
* **Brand changes**: Update templates to reflect new branding
* **Compliance**: Update templates to meet new regulatory requirements
* **A/B testing**: Create variations of existing templates
