Fastly Backend API

Operations for managing backends (origin servers) that a Fastly service routes requests to.

GitHub OpenAPI

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /service/{service_id}/version/{version_id}/backend List backends on a service version · List backends #
Ask an LLM
“Which origin servers are configured for my service version?”
“Can I see all backends defined for a Fastly version?”
Tell an agent
List the backends on service {service_id} version {version_id}.
Show every backend configured for service {service_id} at version {version_id}.
POST /service/{service_id}/version/{version_id}/backend Add a backend to a service version · Create a backend #
Ask an LLM
“How do I add an origin server to a Fastly service version?”
“Can I set SSL and timeouts when creating a backend?”
Tell an agent
Create backend {name} on service {service_id} version {version_id} pointing at {address}.
Add backend {name} to service {service_id} at version {version_id} on port {port}, using SSL {use_ssl}.
GET /service/{service_id}/version/{version_id}/backend/{backend_name} Get a backend on a service version · Get a backend #
Ask an LLM
“What address and port does a particular backend use?”
“Can I look up one backend's settings on a service version?”
Tell an agent
Get backend {backend_name} on service {service_id} version {version_id}.
Show the settings of backend {backend_name} in service {service_id} at version {version_id}.
PUT /service/{service_id}/version/{version_id}/backend/{backend_name} Update a backend on a service version · Update a backend #
Ask an LLM
“How do I change the address or port of an existing backend?”
“Can I point an existing backend at a different origin server?”
Tell an agent
Update backend {backend_name} on service {service_id} version {version_id} to address {address}.
Change the port of existing backend {backend_name} in service {service_id} at version {version_id} to {port}.
DELETE /service/{service_id}/version/{version_id}/backend/{backend_name} Delete a backend from a service version · Delete a backend #
Ask an LLM
“How do I remove an origin server from a service version?”
“Can I delete a backend I no longer use?”
Tell an agent destructive · confirm first
Delete backend {backend_name} from service {service_id} version {version_id}.
Remove the origin server {backend_name} from service {service_id} at version {version_id}.

Documentation

📖
Documentation
https://www.fastly.com/documentation/reference/api/services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/purging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/logging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/metrics-stats/
📖
Documentation
https://www.fastly.com/documentation/reference/api/tls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/vcl-services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/account/
📖
Documentation
https://www.fastly.com/documentation/reference/api/auth-tokens/
📖
Documentation
https://www.fastly.com/documentation/reference/api/acls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/dictionaries/
📖
Documentation
https://www.fastly.com/documentation/guides/compute/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ngwaf/
📖
Documentation
https://www.fastly.com/documentation/reference/api/domain-management/
📖
Documentation
https://www.fastly.com/documentation/reference/api/products/
📖
Documentation
https://www.fastly.com/documentation/reference/api/observability/
📖
Documentation
https://www.fastly.com/documentation/reference/api/api-security/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ddos-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/client-side-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/publishing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/load-balancing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/utils/
📖
Documentation
https://www.fastly.com/products/ai
📖
Documentation
https://www.fastly.com/products/object-storage

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/fastly:fastly-backend-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

fastly-backend-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Fastly VCL Services Backend API
  description: The Fastly VCL Services API provides programmatic access to configure Varnish Configuration Language (VCL) objects that power most Fastly services. Developers can upload custom VCL code or use the API to generate VCL through configuration objects including backends, conditions, cache settings, request settings, response objects, headers, and VCL snippets. This API is central to defining how Fastly processes, routes, and caches HTTP requests at the edge.
  version: '1.0'
  contact:
    name: Fastly Support
    url: https://support.fastly.com
  termsOfService: https://www.fastly.com/terms
servers:
- url: https://api.fastly.com
  description: Fastly API Production Server
security:
- apiKeyAuth: []
tags:
- name: Backend
  description: Operations for managing backends (origin servers) that a Fastly service routes requests to.
paths:
  /service/{service_id}/version/{version_id}/backend:
    get:
      operationId: listBackends
      summary: List backends
      description: Retrieves a list of all backends configured for a specific version of a Fastly service.
      tags:
      - Backend
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - $ref: '#/components/parameters/versionId'
      responses:
        '200':
          description: Successfully retrieved the list of backends.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Backend'
        '401':
          description: Unauthorized. The API token is missing or invalid.
    post:
      operationId: createBackend
      summary: Create a backend
      description: Creates a new backend for a specific version of a Fastly service. Backends define the origin servers that Fastly routes requests to.
      tags:
      - Backend
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - $ref: '#/components/parameters/versionId'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Backend'
      responses:
        '200':
          description: Successfully created the backend.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Backend'
        '400':
          description: Bad request. Missing or invalid parameters.
        '401':
          description: Unauthorized. The API token is missing or invalid.
  /service/{service_id}/version/{version_id}/backend/{backend_name}:
    get:
      operationId: getBackend
      summary: Get a backend
      description: Retrieves the details of a specific backend for a version of a Fastly service.
      tags:
      - Backend
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - $ref: '#/components/parameters/versionId'
      - $ref: '#/components/parameters/backendName'
      responses:
        '200':
          description: Successfully retrieved the backend.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Backend'
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Backend not found.
    put:
      operationId: updateBackend
      summary: Update a backend
      description: Updates a specific backend for a version of a Fastly service.
      tags:
      - Backend
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - $ref: '#/components/parameters/versionId'
      - $ref: '#/components/parameters/backendName'
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Backend'
      responses:
        '200':
          description: Successfully updated the backend.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Backend'
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Backend not found.
    delete:
      operationId: deleteBackend
      summary: Delete a backend
      description: Deletes a specific backend from a version of a Fastly service.
      tags:
      - Backend
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - $ref: '#/components/parameters/versionId'
      - $ref: '#/components/parameters/backendName'
      responses:
        '200':
          description: Successfully deleted the backend.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Confirmation status of the deletion.
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Backend not found.
components:
  parameters:
    backendName:
      name: backend_name
      in: path
      required: true
      description: The name of the backend.
      schema:
        type: string
    serviceId:
      name: service_id
      in: path
      required: true
      description: The alphanumeric string identifying the Fastly service.
      schema:
        type: string
    versionId:
      name: version_id
      in: path
      required: true
      description: The integer identifying the service version.
      schema:
        type: integer
  schemas:
    Backend:
      type: object
      description: A backend represents an origin server that a Fastly service routes requests to for content that is not cached at the edge.
      properties:
        name:
          type: string
          description: The name of the backend.
        address:
          type: string
          description: The hostname or IPv4 address of the backend.
        port:
          type: integer
          description: The port number on the backend.
          default: 80
        use_ssl:
          type: boolean
          description: Whether to use SSL/TLS to connect to the backend.
        ssl_hostname:
          type: string
          description: The hostname to verify for SSL certificate validation.
        ssl_cert_hostname:
          type: string
          description: The hostname to use when checking the backend certificate.
        ssl_sni_hostname:
          type: string
          description: The SNI hostname to use for the backend connection.
        shield:
          type: string
          description: The data center to use as a shield POP.
        weight:
          type: integer
          description: The weight assigned to this backend for load balancing.
          minimum: 1
          maximum: 100
        connect_timeout:
          type: integer
          description: Maximum duration in milliseconds to wait for a connection.
        first_byte_timeout:
          type: integer
          description: Maximum duration in milliseconds to wait for the first byte.
        between_bytes_timeout:
          type: integer
          description: Maximum duration in milliseconds to wait between bytes.
        max_conn:
          type: integer
          description: Maximum number of connections to the backend.
        healthcheck:
          type: string
          description: The name of the healthcheck to use with the backend.
        auto_loadbalance:
          type: boolean
          description: Whether to auto-load-balance this backend.
        request_condition:
          type: string
          description: The name of a condition to apply to route requests to this backend.
        comment:
          type: string
          description: A freeform descriptive note about the backend.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Fastly-Key
      description: API token used to authenticate requests to the Fastly API.
externalDocs:
  description: Fastly VCL Services API Documentation
  url: https://www.fastly.com/documentation/reference/api/vcl-services/