## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

Use this file to discover all available pages before exploring further.

### Create a System Message

### Request

**POST /management/v2.0/system/createsystemmessage**

**Try it**

### Example cURL Request

```bash
curl --request POST \
  --url https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '\n{\n  "until": 1694518620,\n  "message": "Next great Update will be released next Monday.",\n  "showOnLogin": true\n}\n'\n```

### Example Python Request

```python
import requests

url = "https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage"

payload = {    
    "until": 1694518620,  
    "message": "Next great Update will be released next Monday.",  
    "showOnLogin": True
}  
headers = {  
    "Authorization": "Basic <encoded-value>",  
    "Content-Type": "application/json"  
}

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

print(response.text)
```

### Example JavaScript Fetch Request

```javascript
const options = {  
  method: 'POST',  
  headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},  
  body: JSON.stringify({  
    until: 1694518620,  
    message: 'Next great Update will be released next Monday.',  
    showOnLogin: true  
  })  
};

fetch('https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage', options)  
  .then(res => res.json())  
  .then(res => console.log(res))  
  .catch(err => console.error(err));
```

### Example PHP Request

```php
$curl = curl_init();

curl_setopt_array($curl, [\
  CURLOPT_URL => "https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage",\
  CURLOPT_RETURNTRANSFER => true,\
  CURLOPT_ENCODING => "",\
  CURLOPT_MAXREDIRS => 10,\
  CURLOPT_TIMEOUT => 30,\
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
  CURLOPT_CUSTOMREQUEST => "POST",\
  CURLOPT_POSTFIELDS => json_encode([\
    'until' => 1694518620,\
    'message' => 'Next great Update will be released next Monday.',\
    'showOnLogin' => true\
  ]),\
  CURLOPT_HTTPHEADER => [\
    "Authorization: Basic <encoded-value>",\
    "Content-Type: application/json"\
  ],\
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {  
  echo "cURL Error #:" . $err;  
} else {  
  echo $response;  
}
```

### Example Go Request

```go
package main

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

func main() {

url := "https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage"

payload := strings.NewReader("{\n  \"until\": 1694518620,\n  \"message\": \"Next great Update will be released next Monday.\",\n  \"showOnLogin\": true\n}")

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

req.Header.Add("Authorization", "Basic <encoded-value>")
	req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))
}
```

### Example Java Request

```java
HttpResponse<String> response = Unirest.post("https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage")
  .header("Authorization", "Basic <encoded-value>")
  .header("Content-Type", "application/json")
  .body("{\n  \"until\": 1694518620,\n  \"message\": \"Next great Update will be released next Monday.\",\n  \"showOnLogin\": true\n}")
  .asString();
```

### Example Ruby Request

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

url = URI("https://api-trial.cognigy.ai/new/management/v2.0/system/createsystemmessage")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"until\": 1694518620,\n  \"message\": \"Next great Update will be released next Monday.\",\n  \"showOnLogin\": true\n}"

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

### Responses

**201 Created**: The system message was created.

**Error Responses**:

- **400 Bad Request**: Validation failed. Missing payload.
- **401 Unauthorized**: <string>
- **402 Payment Required**: Validation failed. Missing payload.
- **403 Forbidden**: <string>
- **404 Not Found**: <string>
- **405 Method Not Allowed**: <string>
- **409 Conflict**: <string>
- **413 Payload Too Large**: <string>
- **500 Internal Server Error**: <string>
- **501 Not Implemented**: <string>
- **502 Bad Gateway**: <string>
- **503 Service Unavailable**: <string>
- **504 Gateway Timeout**: <string>

### Body Parameters

- **until** (integer, required): Unix-timestamp (Example: `1694518620`)
- **message** (string, required): The message to display (Example: "Next great Update will be released next Monday.")
- **showOnLogin** (boolean): Whether to show the message on login.
