Create an object cache
Create an object cache. We first check that we can reach every original bucket with the keys you send.
Bearer $TOKEN
application/json
The ID of the team to create the object cache in. betterstack team list shows it.
The object cache's name, at most 255 characters.
The object cache's type, such as OP100. List the types with betterstack object-cache-type list.
The IDs of your networks to attach. The networks must be in the object cache's team.
The ID of the firewall to attach. An object cache can have one firewall, and it must be in the object cache's team.
The ID of your placement group to create the object cache in. Must be in the object cache's team.
Whether the object cache also gets a public HTTPS endpoint.
Whether the object cache gets a public IPv4 address. Can't be changed later.
The cache space to use, in GB, from 10 to the type's usable_cache_gb. Defaults to the type's usable_cache_gb.
Which cached objects we remove first when the cache is full.
Valid values:least_frequently_used: Removes the objects read least often, so a frequently read object survives a flood of one-off reads.least_recently_used: Removes the objects read longest ago, which suits workloads that scan through data.
How long we keep an object in the cache, in seconds, from 60 to 2592000.
How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. 0 turns listing caching off.
Whether a write waits for the origin. With true, we confirm a write once the origin stored it. With false, we confirm it once it's in the object cache's journal and upload it to the origin later.
The billing term. Defaults to monthly. Possible values: monthly, annual.
Your tags, as an object of string keys and values. Accepts any keys.
The buckets to serve, from 1 to 20. Each maps a bucket name to a bucket at your storage provider and its keys. We never return the keys.
The bucket name clients use with the object cache, 3–63 lowercase letters, digits, dots or hyphens. Defaults to origin_bucket.
The URL of your storage provider's S3 endpoint, such as https://s3.eu-central-1.amazonaws.com. The URL must start with https:// and use a hostname, not an IP address. The URL can't have a path, a query or a username.
The origin bucket.
The key prefix in the original bucket that the bucket serves. Leave it out to serve the whole bucket.
The origin region.
The origin force path style.
The origin access key id.
The origin secret access key.
{
"id": "example",
"name": "Example object cache",
"type": "OP100",
"usable_cache_gb": 1,
"status": "provisioning",
"status_message": "example",
"eviction_policy": "least_frequently_used",
"max_capacity_gb": 1,
"cache_ttl_seconds": 86400,
"listing_cache_ttl_seconds": 0,
"fsync": true,
"public_access": false,
"public_ipv4": false,
"placement_group_id": "123456789",
"cache_used_gb": 1.5,
"config_applied_at": "2026-07-01T12:00:00.000Z",
"endpoints": {
"private": [
{
"network_id": "123456789",
"ip_address": "example",
"url": "https://example.com"
}
],
"public": {
"hostname": "proxy.example.com",
"url": "https://example.com",
"records": [
"example"
]
}
},
"buckets": [
{
"id": "example",
"name": "Example",
"origin_endpoint": "example",
"origin_bucket": "example",
"origin_prefix": "example",
"origin_region": "us",
"origin_force_path_style": false,
"origin_creation_date": "2026-07-01T12:00:00.000Z",
"scoped_credentials": false,
"created_at": "2026-07-01T12:00:00.000Z"
}
],
"network_ids": [
"123456789"
],
"term": "monthly",
"created_at": "2026-07-01T12:00:00.000Z",
"updated_at": "2026-07-01T12:00:00.000Z",
"team_id": "t123",
"metadata": {
"example": "value"
}
}
{
"error": {
"message": "Malformed JSON body.",
"code": "bad_request"
}
}
{
"error": {
"message": "Missing or invalid token.",
"code": "unauthorized"
}
}
{
"error": {
"message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
"code": "payment_required"
}
}
{
"error": {
"message": "This token is read-only and cannot be used for write operations.",
"code": "read_only_token"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Returns the newly created object cache.
The body isn't valid JSON.
The API token is missing or invalid.
The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is payment_required. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return first_purchase. The url in first_purchase opens a page where you make the payment. The resource is created after the payment. The page works until expires_at, 24 hours after the response.
The request would go over a quota, with the code quota_exceeded. Or a read-only token tried to make a change, with the code read_only_token. Or a rule of the resource forbids it.
The resource's state doesn't allow the request, such as starting a running server or removing a placement group that still has servers.
A value isn't valid. The error code is validation_failed.
We couldn't reach an original bucket with its keys. The message names the bucket. The error code is origin_check_failed.
We've locked the resource, with the code locked. Every change to a locked resource is refused, and so is a change that involves one.
Too many requests, with the code rate_limited. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the Retry-After header says.
An unexpected, temporary error on our side, with the code internal_error. Try again.
The zone has no capacity, with the code no_capacity. Or we couldn't set up or change the resource, with the code orchestration_failed. Or the organization is creating too many resources at the same time, with the code concurrent_create_limit. Try again after a short wait.
The object cache's ID, a UUID.
The object cache's name, at most 255 characters.
The object cache's type, such as OP100.
The cache space of the object cache's type, in GB.
The object cache's state.
Valid values:provisioning: We're starting the object cache.running: The object cache is ready.degraded: Part of the object cache isn't working. status_message says why. An original bucket that is down leaves the object cache running.rescaling: We're changing the object cache's type.failed: We couldn't create the object cache. status_message says why. Create a new one instead.destroyed: The object cache is destroyed.
Why the object cache failed or is degraded, or null when there's nothing to report.
Which cached objects we remove first when the cache is full.
Valid values:least_frequently_used: Removes the objects read least often, so a frequently read object survives a flood of one-off reads.least_recently_used: Removes the objects read longest ago, which suits workloads that scan through data.
The cache space to use, in GB, from 10 to usable_cache_gb.
How long we keep an object in the cache, in seconds, from 60 to 2592000.
How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. 0 turns listing caching off.
Whether a write waits for the origin. With true, we confirm a write once the origin stored it. With false, we confirm it once it's in the object cache's journal and upload it to the origin later.
Whether the object cache also has a public HTTPS endpoint.
Whether the object cache has a public IPv4 address.
The ID of your placement group the object cache was created in, or null when the object cache is in none.
The cache space in use, in GB.
When we last applied the configuration to the object cache. Once config_applied_at is later than your update, the update is in effect. Stays null until we first apply the configuration. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
Where S3 clients connect, an HTTP endpoint in each attached network and the public HTTPS endpoint when public_access is on. Clients must use path-style addressing and sign requests with SigV4.
The private.
The network id.
The ip address.
The url.
The public.
The hostname.
The url.
The records.
The buckets the object cache serves, each mapped to a bucket at your storage provider. We never return the provider's keys.
The id.
The name.
The origin endpoint.
The origin bucket.
The origin prefix.
The origin region.
The origin force path style.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The scoped credentials.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The IDs of the networks attached to the object cache. Order doesn't matter.
The billing term. Defaults to monthly.
Valid values:monthly: Billed every month.annual: Paid for a year.
When the object cache was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the object cache was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The ID of the team that owns the object cache.
Your tags, as an object of string keys and values.