# Update an object cache

Update an object cache's name, tags, cache settings, `public_access` or billing term. We apply the change in the background, and `config_applied_at` says when we last applied it.

[endpoint]
method = "PATCH"
base_url = "https://{availability_zone}.betterstackcloud.com"
path = "/v1/object-proxies/{id}"

[[path_param]]
name = "id"
required = true
type = "string"
description = "The ID of the object cache to update."

[[body_param]]
name = "name"
type = "string"
description = "The object cache's name, at most 255 characters."

[[body_param]]
name = "eviction_policy"
type = "string"
description = "Which cached objects we remove first when the cache is full.<br/>Valid values:<br/>`least_frequently_used`: Removes the objects read least often, so a frequently read object survives a flood of one-off reads.<br/>`least_recently_used`: Removes the objects read longest ago, which suits workloads that scan through data."

[[body_param]]
name = "max_capacity_gb"
type = "integer"
description = "The cache space to use, in GB, from 10 to `usable_cache_gb`. Defaults to `usable_cache_gb` on create."

[[body_param]]
name = "cache_ttl_seconds"
type = "integer"
description = "How long we keep an object in the cache, in seconds, from 60 to 2592000."

[[body_param]]
name = "listing_cache_ttl_seconds"
type = "integer"
description = "How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. `0` turns listing caching off."

[[body_param]]
name = "fsync"
type = "boolean"
description = "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."

[[body_param]]
name = "public_access"
type = "boolean"
description = "Whether the object cache also has a public HTTPS endpoint. We apply a change in the background."

[[body_param]]
name = "term"
type = "string"
description = "The billing term. Defaults to `monthly`. A change applies at once, from `monthly` to `annual` or back. Billing ends the current term and starts the new one. Sending the current term changes nothing.<br/>Valid values:<br/>`monthly`: Billed every month.<br/>`annual`: Paid for a year."

[[body_param]]
name = "metadata"
type = "object"
description = "Your tags, as an object of string keys and values. An update replaces every tag. Accepts any keys."

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[[header]]
name = "Content-Type"
description = "application/json"
required = false
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = "Returns the updated object cache."
body = '''
{
  "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"
  }
}
'''

[[response]]
status = 202
description = "Returns the updated object cache. Returned when the request changes `public_access`."
body = '''
{
  "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"
  }
}
'''

[[response]]
status = 400
description = "The body isn't valid JSON."
body = '''
{
  "error": {
    "message": "Malformed JSON body.",
    "code": "bad_request"
  }
}
'''

[[response]]
status = 401
description = "The API token is missing or invalid."
body = '''
{
  "error": {
    "message": "Missing or invalid token.",
    "code": "unauthorized"
  }
}
'''

[[response]]
status = 402
description = "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."
body = '''
{
  "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"
  }
}
'''

[[response]]
status = 403
description = "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."
body = '''
{
  "error": {
    "message": "This token is read-only and cannot be used for write operations.",
    "code": "read_only_token"
  }
}
'''

[[response]]
status = 404
description = "The resource doesn't exist, it's in another zone, or your token can't access it."
body = '''
{
  "error": {
    "message": "Resource not found.",
    "code": "not_found"
  }
}
'''

[[response]]
status = 409
description = "The resource's state doesn't allow the request, such as starting a running server or removing a placement group that still has servers."

[[response]]
status = 422
description = "A value isn't valid, with the code `validation_failed`. The error's `details` list the messages for each field. A create or rescale that names a deprecated type with a replacement returns the code `type_deprecated`. The error's `details` then name the field, the deprecated type and its `replacement`."

[[response]]
status = 423
description = "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."

[[response]]
status = 429
description = "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."

[[response]]
status = 500
description = "An unexpected, temporary error on our side, with the code `internal_error`. Try again."
body = '''
{
  "error": {
    "message": "The request could not be completed right now. Please try again in a few moments.",
    "code": "internal_error"
  }
}
'''

[[response]]
status = 503
description = "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."
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The object cache's ID, a UUID."

[[param]]
name = "name"
type = "string"
description = "The object cache's name, at most 255 characters."

[[param]]
name = "type"
type = "string"
description = "The object cache's type, such as `OP100`."

[[param]]
name = "usable_cache_gb"
type = "integer"
description = "The cache space of the object cache's type, in GB."

[[param]]
name = "status"
type = "string"
description = "The object cache's state.<br/>Valid values:<br/>`provisioning`: We're starting the object cache.<br/>`running`: The object cache is ready.<br/>`degraded`: Part of the object cache isn't working. `status_message` says why. An original bucket that is down leaves the object cache `running`.<br/>`rescaling`: We're changing the object cache's type.<br/>`failed`: We couldn't create the object cache. `status_message` says why. Create a new one instead.<br/>`destroyed`: The object cache is destroyed."

[[param]]
name = "status_message"
type = "string or null"
description = "Why the object cache failed or is `degraded`, or `null` when there's nothing to report."

[[param]]
name = "eviction_policy"
type = "string"
description = "Which cached objects we remove first when the cache is full.<br/>Valid values:<br/>`least_frequently_used`: Removes the objects read least often, so a frequently read object survives a flood of one-off reads.<br/>`least_recently_used`: Removes the objects read longest ago, which suits workloads that scan through data."

[[param]]
name = "max_capacity_gb"
type = "integer"
description = "The cache space to use, in GB, from 10 to `usable_cache_gb`."

[[param]]
name = "cache_ttl_seconds"
type = "integer"
description = "How long we keep an object in the cache, in seconds, from 60 to 2592000."

[[param]]
name = "listing_cache_ttl_seconds"
type = "integer"
description = "How long we keep a bucket listing in the cache, in seconds, from 0 to 86400. `0` turns listing caching off."

[[param]]
name = "fsync"
type = "boolean"
description = "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."

[[param]]
name = "public_access"
type = "boolean"
description = "Whether the object cache also has a public HTTPS endpoint."

[[param]]
name = "public_ipv4"
type = "boolean"
description = "Whether the object cache has a public IPv4 address."

[[param]]
name = "placement_group_id"
type = "string or null"
description = "The ID of your placement group the object cache was created in, or `null` when the object cache is in none."

[[param]]
name = "cache_used_gb"
type = "number"
description = "The cache space in use, in GB."

[[param]]
name = "config_applied_at"
type = "datetime or null"
description = "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`."

[[param]]
name = "endpoints"
type = "object"
description = "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."

[[param]]
name = "endpoints.private"
type = "array of objects"
description = "The private."

[[param]]
name = "endpoints.private[].network_id"
type = "string"
description = "The network id."

[[param]]
name = "endpoints.private[].ip_address"
type = "string"
description = "The ip address."

[[param]]
name = "endpoints.private[].url"
type = "string"
description = "The url."

[[param]]
name = "endpoints.public"
type = "object or null"
description = "The public."

[[param]]
name = "endpoints.public.hostname"
type = "string"
description = "The hostname."

[[param]]
name = "endpoints.public.url"
type = "string"
description = "The url."

[[param]]
name = "endpoints.public.records"
type = "array of strings"
description = "The records."

[[param]]
name = "buckets"
type = "array of objects"
description = "The buckets the object cache serves, each mapped to a bucket at your storage provider. We never return the provider's keys."

[[param]]
name = "buckets[].id"
type = "string"
description = "The id."

[[param]]
name = "buckets[].name"
type = "string"
description = "The name."

[[param]]
name = "buckets[].origin_endpoint"
type = "string"
description = "The origin endpoint."

[[param]]
name = "buckets[].origin_bucket"
type = "string"
description = "The origin bucket."

[[param]]
name = "buckets[].origin_prefix"
type = "string"
description = "The origin prefix."

[[param]]
name = "buckets[].origin_region"
type = "string"
description = "The origin region."

[[param]]
name = "buckets[].origin_force_path_style"
type = "boolean"
description = "The origin force path style."

[[param]]
name = "buckets[].origin_creation_date"
type = "datetime or null"
description = "In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "buckets[].scoped_credentials"
type = "boolean"
description = "The scoped credentials."

[[param]]
name = "buckets[].created_at"
type = "datetime"
description = "In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "network_ids"
type = "array of strings"
description = "The IDs of the networks attached to the object cache. Order doesn't matter."

[[param]]
name = "term"
type = "string"
description = "The billing term. Defaults to `monthly`.<br/>Valid values:<br/>`monthly`: Billed every month.<br/>`annual`: Paid for a year."

[[param]]
name = "created_at"
type = "datetime"
description = "When the object cache was created. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "updated_at"
type = "datetime"
description = "When the object cache was last updated. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "team_id"
type = "string"
description = "The ID of the team that owns the object cache."

[[param]]
name = "metadata"
type = "object"
description = "Your tags, as an object of string keys and values."
[/params]
