curl --request POST \
--url https://api.context.dev/v1/utility/prefetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"domain": "<string>"
},
"timeoutMS": 150500,
"tags": [
"production",
"team-alpha"
]
}
'import requests
url = "https://api.context.dev/v1/utility/prefetch"
payload = {
"identifier": { "domain": "<string>" },
"timeoutMS": 150500,
"tags": ["production", "team-alpha"]
}
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({
identifier: {domain: '<string>'},
timeoutMS: 150500,
tags: ['production', 'team-alpha']
})
};
fetch('https://api.context.dev/v1/utility/prefetch', 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://api.context.dev/v1/utility/prefetch",
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([
'identifier' => [
'domain' => '<string>'
],
'timeoutMS' => 150500,
'tags' => [
'production',
'team-alpha'
]
]),
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://api.context.dev/v1/utility/prefetch"
payload := strings.NewReader("{\n \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\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://api.context.dev/v1/utility/prefetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/utility/prefetch")
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 \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"status": "<string>",
"message": "<string>",
"type": "brand",
"domain": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"status": "<string>",
"error_code": "FORBIDDEN",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "REQUEST_TIMEOUT",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"status": "<string>",
"error_code": "FREE_EMAIL_DETECTED",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "RATE_LIMITED",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Prefetch Brand Data
Warm the brand cache before users need it so onboarding and enrichment flows return faster.
curl --request POST \
--url https://api.context.dev/v1/utility/prefetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"domain": "<string>"
},
"timeoutMS": 150500,
"tags": [
"production",
"team-alpha"
]
}
'import requests
url = "https://api.context.dev/v1/utility/prefetch"
payload = {
"identifier": { "domain": "<string>" },
"timeoutMS": 150500,
"tags": ["production", "team-alpha"]
}
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({
identifier: {domain: '<string>'},
timeoutMS: 150500,
tags: ['production', 'team-alpha']
})
};
fetch('https://api.context.dev/v1/utility/prefetch', 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://api.context.dev/v1/utility/prefetch",
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([
'identifier' => [
'domain' => '<string>'
],
'timeoutMS' => 150500,
'tags' => [
'production',
'team-alpha'
]
]),
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://api.context.dev/v1/utility/prefetch"
payload := strings.NewReader("{\n \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\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://api.context.dev/v1/utility/prefetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/utility/prefetch")
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 \"identifier\": {\n \"domain\": \"<string>\"\n },\n \"timeoutMS\": 150500,\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"status": "<string>",
"message": "<string>",
"type": "brand",
"domain": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"status": "<string>",
"error_code": "FORBIDDEN",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "REQUEST_TIMEOUT",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"status": "<string>",
"error_code": "FREE_EMAIL_DETECTED",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "RATE_LIMITED",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Authorizations
Bearer authentication header of the form Bearer <API_KEY>, where <API_KEY> is your api key.
Body
What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the styleguide cache.
brand, styleguide Identifier of the target to prefetch. Provide exactly one of domain or email.
- By domain
- By email
Show child attributes
Show child attributes
Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
1000 <= x <= 300000Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
201 - 50["production", "team-alpha"]
Response
Successful response
Unique id of this API call, also sent in the X-Request-Id response header. Quote it when contacting support about a failed request.
"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
Status of the response, e.g., 'ok'
Success message
The type of prefetch that was queued, echoed from the request
brand, styleguide The domain that was queued for prefetching
Credit usage, included whenever a valid API key is provided.
Show child attributes
Show child attributes
Was this page helpful?