Ana içeriğe atla

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/trace/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name

Request Body

Full JSON Body Example

{
  "enableTraceLog": true,
  "startTime": "2025-01-01T00:00:00Z",
  "stopTime": "2025-01-02T00:00:00Z",
  "environmentName": "production"
}

Request Body Fields

FieldTypeRequiredDefaultDescription
enableTraceLogbooleanNofalseEnable or disable trace logging
startTimestringNo-Start time for trace logging in ISO 8601 format (e.g., 2025-01-01T00:00:00Z)
stopTimestringNo-Stop time for trace logging in ISO 8601 format (e.g., 2025-01-02T00:00:00Z)
environmentNamestringNo-Target environment name for trace logging
Note: All fields are optional. Only provided fields are updated. Omitted fields retain their current values.

Response

Success Response (200 OK)

{
  "success": true
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}

cURL Example

Example 1: Enable Trace Logging with Time Window

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/trace/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enableTraceLog": true,
    "startTime": "2025-01-01T00:00:00Z",
    "stopTime": "2025-01-02T00:00:00Z",
    "environmentName": "production"
  }'

Example 2: Disable Trace Logging

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/trace/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enableTraceLog": false
  }'

Example 3: Update Only Environment

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/trace/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "environmentName": "staging"
  }'

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.

Notes and Warnings

  • Partial Update: Only provided fields are updated. You can send just the fields you want to change
  • Time Format: startTime and stopTime must be in ISO 8601 format with timezone (e.g., 2025-01-01T00:00:00Z)
  • Time Window: Trace logging is active only between startTime and stopTime. Outside this window, trace logging is automatically inactive
  • Environment-Specific: Trace logging is scoped to a specific environment. Set environmentName to target the desired environment
  • Performance Impact: Trace logging captures detailed request/response data and may impact performance. Use time-bounded windows for production environments