---
title: "Add application endpoint"
method: POST
path: "/apps/{appId}/containers/{containerId}/endpoints"
tags: ["Endpoints"]
---

# Add application endpoint

`POST /apps/{appId}/containers/{containerId}/endpoints`

## Request

- Base URL: `https://api.bunny.net/mc`
- URL: `https://api.bunny.net/mc/apps/{appId}/containers/{containerId}/endpoints`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/magic-containers-api/docs/apps/:appId/containers/:containerId/endpoints/post.ts> (a function with typed inputs; its response is checked against the schema)

Add CDN or Anycast endpoint to a container of given application.

## Path parameters

- `appId` string, required
- `containerId` string, required

## Request body

- EndpointRequest
  - `displayName` string, required
  - `cdn` CdnEndpointRequest
    - `isSslEnabled` boolean
    - `stickySessions` StickySessionSettings
      - `enabled` boolean
      - `sessionHeaders` string[], required
      - `cookieName` string
    - `pullZoneId` integer, nullable
    - `portMappings` ContainerPortMappingRequest[]
      - `containerPort` integer, required
      - `exposedPort` integer, nullable
      - `protocols` Protocol[]
  - `anycast` AnycastEndpointRequest
    - `type` 'iPv4', required
    - `portMappings` ContainerPortMappingRequest[], required
      - `containerPort` integer, required
      - `exposedPort` integer, nullable
      - `protocols` Protocol[]

## Response `201`

Endpoint was successfully created.

- SaveEndpointResponse
  - `id` string

## Other responses

- `400`: Invalid input or endpoint name already exists.
- `401`: User is unauthorized.
- `403`: User has invalid card or suspended.
- `404`: Application or container not found.
- `422`: Unprocessable entity.
- `500`: Unexpected server error.

## Changes

- **2026-04-26** `62fb48c758fb`: 21 breaking, 31 info
  - removed the enum value `IPv4` of the request property `anycast/type` (media type: application/json)
  - removed the enum value `IPv4` of the request property `anycast/type` (media type: text/json)
  - removed the enum value `IPv4` of the request property `anycast/type` (media type: application/*+json)
  - removed the enum value `Sctp` of the request property `anycast/portMappings/items/protocols/items/` (media type: application/json)
  - …48 more

[Operation history](https://skmtc.dev/bunny/apis/magic-containers-api/changes/apps/:appId/containers/:containerId/endpoints/post.md)

---

[API](https://skmtc.dev/bunny/apis/magic-containers-api.md) - [All operations](https://skmtc.dev/bunny/apis/magic-containers-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/magic-containers-api/revisions/7bb58a0591b0?raw)
