Update Endpoint Status
Overview
Enables or disables an endpoint (API method) in an API proxy. When disabled, the endpoint is not accessible.
Endpoint
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/endpoints/status/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Request Body
Full JSON Body Example
{
"identifierName": "/api/users",
"identifierHttpMethod": "GET",
"active": false
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| identifierName | string | Yes | - | Endpoint path/name (used to identify the endpoint) |
| identifierHttpMethod | string | Yes | - | HTTP method for the endpoint (used to identify the endpoint). See EnumHttpRequestMethod |
| active | boolean | Yes | - | Whether endpoint is active/enabled (true = enabled, false = disabled) |
EnumHttpRequestMethod
GET,POST,PUT,DELETE,PATCH,OPTIONS,HEAD,TRACE,ALL
Response
Success Response (200 OK)
{
"success": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the request was successful |
Error Response (400 Bad Request)
{
"error": "bad_request",
"error_description": "Endpoint identifier (name and httpMethod) must be provided in request body!"
}
or
{
"error": "bad_request",
"error_description": "Endpoint with name (/api/users) and HTTP method (GET) is not found!"
}
Common Causes
- Missing
identifierNameoridentifierHttpMethodfields - Missing
activefield - Endpoint with specified name and httpMethod does not exist
Error Response (401 Unauthorized)
{
"error": "unauthorized_client",
"error_description": "Invalid token"
}
Error Response (404 Not Found)
{
"error": "not_found",
"error_description": "ApiProxy (name: MyAPI) was not found!"
}
cURL Example
Example 1: Disable Endpoint
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/endpoints/status/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identifierName": "/api/users",
"identifierHttpMethod": "GET",
"active": false
}'
Example 2: Enable Endpoint
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/endpoints/status/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identifierName": "/api/users",
"identifierHttpMethod": "GET",
"active": true
}'
Notes and Warnings
- Endpoint Identifier: Endpoint is identified by
identifierNameandidentifierHttpMethodcombination (not by ID) - Disabled Endpoints: Disabled endpoints return 404 Not Found when accessed
- Policies: Policies remain associated with the endpoint even when disabled
- Permissions: Requires
ROLE_MANAGE_PROXIESpermission
Related Documentation
- List Endpoints - List all endpoints
- Get Endpoint - Get endpoint details
- Update Endpoint - Update endpoint configuration
- Delete Endpoint - Delete an endpoint