Create a Service version from Git

POST https://{controlplane_path}/api/2/{org_snode_id}/api_service/git/version      
Important: This API applies to APIM 3.0, not Classic APIM.

Overview

Create an APIM 3.0 Service version from a Git repository.

Prerequisites

You must be an Org admin or a user with appropriate asset permissions.

Request

 POST https://{controlplane_path}/api/1/rest/public/api_service/git/version

Example

This example uses basic authentication. For a JWT example, refer to Authentication.

curl -X 'POST' \
  'https://elastic.snaplogic.com/api/2/5bb4aacdee5edcccc7b9aa70/api_service/git/version' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json' \
  -d '{
  "caller": "ci-pipeline",
  "service_snid": "65b124ad2c22dd5a9d774dff",
  "version_name": "1.0",
  "version_metadata": {},
  "create_new_version": true,
  "handle_external_dependencies": false
}'

Path parameters

Key Description
controlplane_path Required. The path to the SnapLogic control plane: elastic.snaplogic.com
For the UAT or EMEA control plane, substitute the name for elastic. For example:
  • uat.elastic.snaplogic.com
  • emea.snaplogic.com
org_snode_id The snode ID of the environment (Org).

Query parameters

None.

Request header

Use the application/json content type with basic authentication (email and password) or a JWT. For examples, refer to Authentication.

Request body

 {
  "caller" : "...",
  "service_snid" : "...",
  "version_name" : "...",
  "version_metadata" : { ... },
  "create_new_version" : true,
  "handle_external_dependencies" : false
}
Key Type Description
caller string Required. The identifier of the calling application or user.
service_snid string Required. The snode ID of the target Service.
version_name string Required. The name for the new Service version.
version_metadata object Required. The Git metadata to use when creating the Service version.
create_new_version boolean Required. If true, creates a new Service version. If false, updates an existing version.
handle_external_dependencies boolean Optional. If true, resolves external dependencies during version creation. Default: false.

Response

Response body

On success, the API returns HTTP 200 with the created or updated Service version instance in response_map.

When handle_external_dependencies is true, the response contains:

{
    "response_map": {
        "updated": true
    },
    "http_status_code": 200
}

Error handling

HTTP status codes Message Resolution
401 Unauthorized Verify your credentials and that you have appropriate permissions on the Org.
404 Not Found When updating an existing version (create_new_version is false), verify the version exists.