Ana içeriğe atla

Documentation Index

Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/environments/{environmentName}/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name (must exist)
environmentNamestringYesEnvironment name (must exist)

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)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployment successful"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
deploymentResultobjectDeployment result
deploymentResult.successbooleanOverall deployment success
deploymentResult.deploymentResultsarrayIndividual environment deployment results
deploymentResult.deploymentResults[].environmentNamestringEnvironment name
deploymentResult.deploymentResults[].successbooleanDeployment success for this environment
deploymentResult.deploymentResults[].messagestringDeployment message

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "ApiProxy with name (petstore-api) can not be deployed to Environment(production) because it is not exist!"
}

Common Causes

  • API Proxy name does not exist
  • Environment name does not exist
  • User does not have access to the environment
  • Deployment failed (check deploymentResult for details)

Error Response (401 Unauthorized)

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

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "Project (MyProject) is not found or user does not have privilege to access it!"
}

cURL Example

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

With Description and Persistent Flag

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

Notes and Warnings

  • API Proxy Must Exist: The API proxy must exist before deployment
  • Environment Access: User must have access to the target environment

Permissions

User must have API_MANAGEMENT + DEPLOY_UNDEPLOY permission in the project.
  • Deployment Status: Check the deploymentResult in the response to verify deployment success
  • Redeployment: If the API proxy is already deployed, this operation redeploys it
  • Deployment History: Deployment history is automatically recorded