Reset cache
curl --request POST \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resetAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}"
payload = { "resetAt": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({resetAt: '2023-11-07T05:31:56Z'})
};
fetch('https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}",
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([
'resetAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}"
payload := strings.NewReader("{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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(string(body))
}HttpResponse<String> response = Unirest.post("https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"cache_reset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"reset_at": "2023-11-07T05:31:56Z"
},
"success": true
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}Models
Reset cache
Resets the cache for the specified cache policy.
cachePolicyName values are not validated against existing policies. Verify that the values you provide are exact matches to policies in the model.
POST
/
v1
/
models
/
{modelId}
/
cache_reset
/
{cachePolicyName}
Reset cache
curl --request POST \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resetAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}"
payload = { "resetAt": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({resetAt: '2023-11-07T05:31:56Z'})
};
fetch('https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}",
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([
'resetAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}"
payload := strings.NewReader("{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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(string(body))
}HttpResponse<String> response = Unirest.post("https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/models/{modelId}/cache_reset/{cachePolicyName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resetAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"cache_reset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"reset_at": "2023-11-07T05:31:56Z"
},
"success": true
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Path Parameters
The ID of the model associated with the cache policy.
The name of the cache policy to reset.
Body
application/json
An ISO-8601 date string that sets the time the cache should be reset (invalidated). When set, cache entries created between this value and the current time will still be considered valid. Cannot be a future date. Defaults to now.
Was this page helpful?
⌘I

