Skip to main content
PUT
Create or replace a routing policy

Authorizations

Authorization
string
header
required

A management key (mgmt-eden...) to manage the organization's routing policies, or your own API key (sk-eden...) or session token to manage your personal ones, sent as Authorization: Bearer <key>.

Path Parameters

name
string
required

The policy's handle, as called with @edenai/{name}.

Query Parameters

scope
enum<string>

Optional, and only ever the scope your credential writes: organization with a management key, user with your own API key or session token. Naming the other one is refused (403) rather than silently written elsewhere.

Available options:
organization,
user

Body

The body of a PUT on a routing policy: what the policy tries and how, its defaults, its locked fields and its last-resort fallbacks.

description
string
default:""
Maximum string length: 500
enabled
boolean
default:true
strategy
  • fallback - Fallback
  • load_balance - Load balance
  • cheapest - Cheapest
  • fastest - Fastest
Available options:
fallback,
load_balance,
cheapest,
fastest
targets
object[] | null
Required array length: 1 - 32 elements
defaults
object

Settings applied to every target unless the target overrides them.

lock
enum<string>[]
  • sort - sort
  • sticky - sticky
  • allow_fallbacks - allow_fallbacks
  • allowed_providers - allowed_providers
  • ignored_providers - ignored_providers
  • order - order
  • max_price - max_price
  • zero_data_retention - zero_data_retention
  • region - region
Available options:
sort,
sticky,
allow_fallbacks,
allowed_providers,
ignored_providers,
order,
max_price,
zero_data_retention,
region
fallbacks
string[]
Maximum array length: 7
Minimum string length: 1

Response

A routing policy as the management API returns it.

name
string
required
read-only
scope
enum<string>
required

organization for a shared policy, user for a personal one.

  • organization - Organization
  • user - User
Available options:
organization,
user
description
string
required
read-only
enabled
boolean
required
read-only
strategy
required
  • fallback - Fallback
  • load_balance - Load balance
  • cheapest - Cheapest
  • fastest - Fastest
Available options:
fallback,
load_balance,
cheapest,
fastest
targets
object[] | null
required
read-only
defaults
object
required

Settings applied to every target unless the target overrides them.

lock
enum<string>[]
required
read-only
  • sort - sort
  • sticky - sticky
  • allow_fallbacks - allow_fallbacks
  • allowed_providers - allowed_providers
  • ignored_providers - ignored_providers
  • order - order
  • max_price - max_price
  • zero_data_retention - zero_data_retention
  • region - region
Available options:
sort,
sticky,
allow_fallbacks,
allowed_providers,
ignored_providers,
order,
max_price,
zero_data_retention,
region
fallbacks
string[]
required
read-only
version
integer
required
read-only
etag
string
required
read-only

The version, as the If-Match header expects it.

created_at
string<date-time>
required
read-only
updated_at
string<date-time>
required
read-only
created_by
string<email> | null
required
read-only

Email of the creator, or null for an API write.

updated_by
string<email> | null
required
read-only

Email of the last editor, or null for an API write.