Attach an Endpoint

POST /v1/applications/{uuid}/endpoints

Makes one of your account's free endpoints serve this application, instead of creating a new one. GET /v1/applications/{uuid}/endpoint-candidates lists the free ones. Your endpoint count doesn't change, so this works at your plan's endpoint limit too.

The endpoint stops being a tunnel endpoint. While it serves the app, agents can't connect to it: an agent started for its hostname is refused with you don't have such an endpoint in your account. It keeps its hostname, its custom domain and certificate, its sign-in, its traffic policies and its other settings. If the app has no primary endpoint yet, this one becomes the primary. Attaching an endpoint to a WordPress app restarts the site so it picks up its address.

The endpoint keeps its own sign-in. If the app's other endpoints require sign-in and this one doesn't, check auth_protected in the answer and set it with PUT /v1/endpoints/{uuid}/settings, or set one mode on all of them with POST /v1/endpoints/bulk-settings.

Requires the caller's account to have Endpoints write permission and the plan's application hosting. Attaching an endpoint that already serves this app succeeds and changes nothing. To give the endpoint back, detach it.

Path parameters

uuid string (uuid) Req
The application.

Request body

endpoint_uuid string (uuid) Req
A free endpoint of your account, from free in the endpoint candidates.

Response (200 OK)

The endpoint as GET /v1/applications/{uuid} lists it in endpoints, plus application_uuid. Its serving_mode comes from the app's type: managed for an app with a backend, agentless otherwise.

Errors

400
The body is not JSON (invalid request body), endpoint_uuid is missing (endpoint_uuid is required), or the body names the endpoint by a number or as endpoint_id (integer_id_unsupported: send its uuid as endpoint_uuid).
403
Your role lacks Endpoints write, or the plan has no application hosting.
404
application not found or Endpoint not found: no such app or endpoint in the active account (another account's reads the same).
409
The endpoint isn't free. code says why, and error says what to do first:
endpoint_has_agent: an agent is connected. Stop the agent first.
endpoint_serves_app: it serves an application. Detach it there first.
endpoint_paused: it is paused over your plan's limits.
endpoint_suspended: the ngris team suspended it.
endpoint_has_dedicated_ip: it uses a dedicated IP. Detach the IP first.
endpoint_has_dedicated_port: it uses a dedicated TCP or UDP port. Release the port first.
endpoint_has_routing_rules: it has routing rules. Remove them first.
endpoint_ephemeral: it is a per-device endpoint. Promote it to a permanent endpoint first.
quota_paused: the app itself is paused over your plan's limits and is read-only until the account has room again.
Request
curl -X POST \ "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/endpoints" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "endpoint_uuid": "019c0a41-5b2e-7f3a-8c1d-4e6f7a8b9c0d" }'
Response — 200 OK
{ "uuid": "019c0a41-5b2e-7f3a-8c1d-4e6f7a8b9c0d", "hostname": "shop.example.com", "url": "https://shop.example.com", "primary": false, "serving_mode": "agentless", "status": "active", "tls_status": "issued", "tls_source": "domain", "tls_expires_at": "2027-01-05T10:00:00Z", "quota_paused": false, "auth_mode": "basic", "auth_protected": true, "created_at": "2026-10-28T08:15:00Z", "application_uuid": "019be838-d261-7d9b-9499-71995a3a91c6" }
Response — 409 Conflict
{ "error": "An agent is connected to this endpoint. Stop the agent first, then attach the endpoint.", "code": "endpoint_has_agent", "reason": "agent_online" }
Was this helpful?
On this page
Attach an Endpoint
Was this helpful?