Ana içeriğe geç

Deploy API Proxy Group

Endpoint

POST /apiops/projects/{projectName}/apiProxyGroups/{apiProxyGroupName}/environments/{environmentName}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyGroupNamestringYesAPI Proxy Group name
environmentNamestringYesEnvironment name to deploy to

Query Parameters

None.

Request Body

Optional JSON body. When omitted, defaults are applied.

FieldTypeRequiredDescription
descriptionstringNoDescription/notes for the deploy history record. Defaults to "Deployed by APIOPS Api" if not provided.
persistentbooleanNoIf true, this deploy history record will not be auto-deleted when the retention limit is reached. Defaults to false.

Example

{
"description": "v2.1 release",
"persistent": true
}

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"responseTime": 150,
"detailList": [
{
"envName": "production",
"podName": "worker-abc123",
"podIp": "10.0.0.1",
"success": true,
"responseTime": 150
}
]
}
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
deploymentResultobjectDeployment result. See Deployment Result Object

Deployment Result Object

FieldTypeDescription
successbooleanOverall deployment success status
responseTimeintegerTotal deployment time in milliseconds
detailListarray[object]Per-pod deployment results

Detail List Item

FieldTypeDescription
envNamestringEnvironment name
podNamestringWorker pod name
podIpstringWorker pod IP address
successbooleanDeployment success for this pod
responseTimeintegerDeployment time for this pod in milliseconds

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "API Proxy Group (PaymentAPIGroup) is not found or user does not have privilege to access it!"
}

or

{
"status": "FAILURE",
"resultMessage": "Environment (production) is not found or user does not have privilege to access it!"
}

cURL Example

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxyGroups/PaymentAPIGroup/environments/production/" \
-H "Authorization: Bearer YOUR_TOKEN"

With Description and Persistent Flag

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxyGroups/PaymentAPIGroup/environments/production/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"description": "v2.1 release", "persistent": true}'

Notes and Warnings

  • Group Deployment:

    • All API Proxies in the group are deployed together
    • Group-level settings (CORS, cache, etc.) are also deployed
  • Environment Must Exist:

    • Environment must exist and be accessible

Permissions

  • User must have API_MANAGEMENT + MANAGE and API_MANAGEMENT + DEPLOY_UNDEPLOY permissions in the project