Create an object cache

Create an object cache. We first check that we can reach every original bucket with the keys you send.

POST https://{availability_zone}.betterstackcloud.com/v1/object-proxies
Authorization string required

Bearer $TOKEN

Content-Type string

application/json

team_id string required

The ID of the team to create the object cache in. betterstack team list shows it.

name string required

The object cache's name, at most 255 characters.

type string required

The object cache's type, such as OP100. List the types with betterstack object-cache-type list.

network_ids array of strings

The IDs of your networks to attach. The networks must be in the object cache's team.

firewall_ids array of strings

The ID of the firewall to attach. An object cache can have one firewall, and it must be in the object cache's team.

placement_group_id string

The ID of your placement group to create the object cache in. Must be in the object cache's team.

public_access boolean default: false

Whether the object cache also gets a public HTTPS endpoint.

public_ipv4 boolean default: false

Whether the object cache gets a public IPv4 address. Can't be changed later.

max_capacity_gb integer

The cache space to use, in GB, from 10 to the type's usable_cache_gb. Defaults to the type's usable_cache_gb.

eviction_policy string default: least_frequently_used

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.

cache_ttl_seconds integer default: 86400

How long we keep an object in the cache, in seconds, from 60 to 2592000.

listing_cache_ttl_seconds integer default: 0

How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. 0 turns listing caching off.

fsync boolean default: true

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.

term string default: monthly

The billing term. Defaults to monthly. Possible values: monthly, annual.

metadata object

Your tags, as an object of string keys and values. Accepts any keys.

buckets array of objects required

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.

buckets[].name string

The bucket name clients use with the object cache, 3–63 lowercase letters, digits, dots or hyphens. Defaults to origin_bucket.

buckets[].origin_endpoint string required

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.

buckets[].origin_bucket string required

The origin bucket.

buckets[].origin_prefix string

The key prefix in the original bucket that the bucket serves. Leave it out to serve the whole bucket.

buckets[].origin_region string default: us-east-1

The origin region.

buckets[].origin_force_path_style boolean default: true

The origin force path style.

buckets[].origin_access_key_id string required

The origin access key id.

buckets[].origin_secret_access_key string required

The origin secret access key.

202 Accepted
{
  "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"
  }
}

Returns the newly created object cache.

id string

The object cache's ID, a UUID.

name string

The object cache's name, at most 255 characters.

type string

The object cache's type, such as OP100.

usable_cache_gb integer

The cache space of the object cache's type, in GB.

status string

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.

status_message string or null

Why the object cache failed or is degraded, or null when there's nothing to report.

eviction_policy string

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.

max_capacity_gb integer

The cache space to use, in GB, from 10 to usable_cache_gb.

cache_ttl_seconds integer

How long we keep an object in the cache, in seconds, from 60 to 2592000.

listing_cache_ttl_seconds integer

How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. 0 turns listing caching off.

fsync boolean

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.

public_access boolean

Whether the object cache also has a public HTTPS endpoint.

public_ipv4 boolean

Whether the object cache has a public IPv4 address.

placement_group_id string or null

The ID of your placement group the object cache was created in, or null when the object cache is in none.

cache_used_gb number

The cache space in use, in GB.

config_applied_at datetime or null

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.

endpoints object

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.

endpoints.private array of objects

The private.

endpoints.private[].network_id string

The network id.

endpoints.private[].ip_address string

The ip address.

endpoints.private[].url string

The url.

endpoints.public object or null

The public.

endpoints.public.hostname string

The hostname.

endpoints.public.url string

The url.

endpoints.public.records array of strings

The records.

buckets array of objects

The buckets the object cache serves, each mapped to a bucket at your storage provider. We never return the provider's keys.

buckets[].id string

The id.

buckets[].name string

The name.

buckets[].origin_endpoint string

The origin endpoint.

buckets[].origin_bucket string

The origin bucket.

buckets[].origin_prefix string

The origin prefix.

buckets[].origin_region string

The origin region.

buckets[].origin_force_path_style boolean

The origin force path style.

buckets[].origin_creation_date datetime or null

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

buckets[].scoped_credentials boolean

The scoped credentials.

buckets[].created_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

network_ids array of strings

The IDs of the networks attached to the object cache. Order doesn't matter.

term string

The billing term. Defaults to monthly.
Valid values:
monthly: Billed every month.
annual: Paid for a year.

created_at datetime

When the object cache was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the object cache was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

The ID of the team that owns the object cache.

metadata object

Your tags, as an object of string keys and values.