---
title: "Replace Gateway Endpoint Providers"
method: PUT
path: "/v1/gateway/endpoints/{endpoint_id}/providers/"
tags: ["Gateway"]
---

# Replace Gateway Endpoint Providers

`PUT /v1/gateway/endpoints/{endpoint_id}/providers/`

## Request

- Base URL: `https://logfire-api.pydantic.dev/api`
- URL: `https://logfire-api.pydantic.dev/api/v1/gateway/endpoints/{endpoint_id}/providers/`
- Auth: OAuth 2
  - Authorization code: `api/oauth/authorize`
  - Token URL: `/api/oauth/token` scopes: `organization:write_gateway`
- TypeScript: <https://skmtc.dev/pydantic/apis/pydantic-logfire-api/docs/v1/gateway/endpoints/:endpoint_id/providers/put.ts> (a function with typed inputs; its response is checked against the schema)

Atomically replace an Endpoint's complete Provider configuration.

## Path parameters

- `endpoint_id` string, uuid, required

## Request body

- GatewayEndpointProvidersReplace
  - `providers` GatewayEndpointProviderInput[], required
    - `provider_id` string, uuid, required
    - `priority` integer: The Gateway tries Providers with a higher priority first. Providers with the same priority are tried in a random order that follows their weights.
    - `weight` number
    - `active` boolean

## Response `200`

Successful Response

- PublicGatewayEndpointRead
  - `id` string, uuid, required
  - `slug` string, required
  - `description` string, nullable, required
  - `providers` PublicGatewayEndpointProviderRead[], required
    - `provider_id` string, uuid, required
    - `priority` integer, required
    - `weight` number, required
    - `active` boolean, required
  - `created_at` string, date-time, required

## Other responses

- `403`: The organization plan does not include Gateway provider management
- `404`: Mutable organization-owned Endpoint not found
- `409`: Endpoint configuration is not supported by this API, or the replacement removes or pauses a Provider that a routing policy uses
- `422`: A Provider is not owned by this organization
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/pydantic/apis/pydantic-logfire-api.md) - [All operations](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/revisions/7996e45256f4?raw)
