DevOps API
-
- UpdatedJan 30, 2025
- 68 minutes to read
- Yokohama
- API reference
The DevOps API provides endpoints that enable the interaction with external DevOps tools.
This REST API enables integrators to:
- Retrieve the available DevOps tools associated with an instance.
- Retrieve the schema object for a code resource, plan, or orchestration resource.
- Check if an orchestration task is under change control and check its change control status.
- Create callbacks to associate with task executions under change control.
- Send various event payloads, which are transformed into normalized objects and stored as code, orchestration, and plan objects.
- Search a commit, branch, or repository using encoded queries and specific search/sort criteria.
- Register artifact versions and packages along with their associated pipeline execution and commits.
- Create and manage onboarding application and tool events.
For additional information, see DevOps Config.
Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token>
.If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties.
DevOps - GET /devops/code/schema
Returns the schema object for a specified code resource: commit, repository, or branch.
Once you have the required schema object, use it to create the request body for your corresponding POST call; POST /code/commit, POST /code/repository, or POST /code/branch.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/code/schema
Default URL: /api/sn_devops/devops/code/schema
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
resource | Required. Type of resource schema to return. Valid values (not case-sensitive):
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Request completed successfully. |
401 | Invalid or missing authentication. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: Sample cURL request for resource=branch
Example: Sample cURL request for resource=commit
Example: Sample cURL request for resource=repository
DevOps - GET /devops/onboarding/status
Returns the current status of the specified onboarding event which is processed or being processed asynchronously by the DevOps service.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/onboarding/status
Default URL: /api/sn_devops/devops/onboarding/status
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
id | Unique identifier of the onboarding event whose status to return. This value is
provided in the return results of the endpoint that invoked the event request, such
as /devops/onboarding/app or
/devops/onboarding/tool. Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: cURL request
The following example shows the status request of a tool onboarding.
Example: cURL request
The following example shows the status request of an application onboarding.
DevOps - GET /devops/orchestration/changeControl
Checks if the orchestration task is under change control.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/changeControl
Default URL: /api/sn_devops/devops/orchestration/changeControl
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
401 | Invalid or missing authentication. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
changeControl | Flag that indicates whether the orchestration task is under change control. Possible values:
Data type: Boolean |
Example: Under change control and using API v2
Response body.
Example: Not under change control and using API v1
Response body.
DevOps - GET /devops/orchestration/changeInfo
Retrieves change request details for a specified orchestration pipeline execution.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/changeInfo
Default URL: /api/sn_devops/devops/orchestration/changeInfo
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
404 | Not found. The requested item wasn't found. |
Response body parameters (JSON or XML)
Example: cURL request
DevOps - GET /devops/orchestration/schema
Returns the schema object for a specified orchestration resource.
Once you have the required schema object, use it to create the request body for your corresponding POST call; /orchestration/orchestrationTask or /orchestration/taskExecution.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/schema
Default URL: /api/sn_devops/devops/orchestration/schema
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
resource | Type of resource schema to return. Valid values (not case-sensitive):
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Request completed successfully. |
401 | Invalid or missing authentication. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: Sample cURL request with resource=task_execution
Example: Sample cURL request with resource=orchestration_task
Example: Sample cURL request with resource=callback
DevOps - GET /devops/orchestration/stepMapping
Verifies that the information being passed is valid for the creation of an orchestration task and is valid for association to a previously created step.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/stepMapping
Default URL: /api/sn_devops/devops/orchestration/stepMapping
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
401 | Unauthorized. The user credentials are incorrect or have not been passed. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Element | Description |
---|---|
status | Flag that indicates whether the verification was successful. Valid values:
Data type: Boolean |
stepValid | Flag that indicates whether the information sent is valid. Valid values:
Data type: Boolean |
Example: Sample cURL request
Results if information is valid.
Example: Sample cURL request
Results if information is invalid.
DevOps - GET /devops/plan/schema
Returns the schema object for a specific plan: app, version, or work item.
Once you have the required schema object, use it to create the request body for your corresponding POST call; POST /plan/app, POST /plan/version, or POST /plan/workitem.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/plan/schema
Default URL: /api/sn_devops/devops/plan/schema
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
resource | Type of resource schema to return. Valid values (not case-sensitive):
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: Sample cURL request for resource=app
Example: Sample cURL request for resource=version
Example: Sample cURL request for resource=work_item
DevOps - POST /devops/artifact/registration
Enables orchestration tools to register artifacts into a ServiceNow instance.
- If the toolId is passed in the request, the endpoint validates that the tool exists within the instance. It also checks if the artifact repository specified in artifacts.repositoryName exists, and if not, creates it under the associated artifact tool.
- If the toolId is not passed in the request, a repository is created but it is not linked to any artifact tool.
- It then checks if the artifact specified in artifacts.name already exists, and if not, creates it under the associated repository.
- If the artifact.version is passed in the request:
- If it does not exist, a new artifact version record is created in the associated Artifact Version [sn_devops_artifact_version] table.
- The endpoint then looks for associated task executions based on the provided build details (pipelineName or projectName, taskExecutionNumber, branchName, and stageName) and the orchestrationToolId parameter.
- If a task execution is found, and its post-processing is complete, the artifact version is linked to the task execution and stored in the Artifact to TaskExecution [sn_devops_m2m_artifact_execution] table. Commits linked to these task executions are also associated to the artifact version and stored in the Artifact Version to Commit [sn_devops_m2m_artifact_version_commit] table. Any commits that are linked to previous task executions that did not create an artifact, are also associated with the artifact version.
- If a task execution is found, and its post-processing is not complete, then the request is persisted in the Artifact Staged Request [sn_devops_artifact_staging] table. The staged request contains a reference to the task execution.
- If a task execution is not found, the request is persisted in the staging table. The staged request contains the build details.
- If the artifact.version is not passed in, then depending on the tool configuration, the artifact version is either retrieved by calling the /devops/tool/artifact endpoint if your artifact tool supports webhooks or through a custom subflow that retrieves the artifact version from the artifact tool.
For additional information on artifacts, see Using DevOps change acceleration for releases.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/artifact/registration
Default URL: /api/sn_devops/devops/artifact/registration
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
orchestrationToolId | Required. Sys_id of the orchestration tool associated with the artifact. The endpoint uses this information to locate task execution information. Data type: String Table: Orchestration Tool [sn_devops_orchestration_tool] |
toolId | Sys_id of the artifact tool associated with the artifact. Data type: String Table: Artifact Tool [sn_devops_artifact_tool] |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: Sample cURL request
DevOps - POST /devops/onboarding/app
Creates an onboarding app event that is asynchronously processed by the DevOps service.
- Create applications.
- Associate DevOps objects such as, plan, repository, and pipeline, to an application.
- Create a change step record and associate a change approval process to a pipeline.
All of these actions are tool and capability specific. The following table outlines the actions available for each supported tool.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/onboarding/app
Default URL: /api/sn_devops/devops/onboarding/app
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
202 | Onboarding request was successfully created. |
Response body parameters
Example: cURL request
This example creates the application Bike Rental Service and associates it with the Jenkins pipeline Bike Rentals, the GitHub repository nowDevops01/CorpSite, and the Azure plan testPlan_Bike_Rental.
Output:
DevOps - POST /devops/onboarding/tool
Creates an onboarding tool event that is asynchronously processed by the DevOps service.
- Creates the tool within the associated ServiceNow instance
- Connects to the tool
- Tries to configure the tool (only if the connection is successful)
- Discovers the tool (only if the connection is successful)
The return results for this endpoint only indicate whether the request was posted, it does not indicate whether the associated tools were created. The actual tool creation is processed asynchronously. To obtain the status of the tool creation and all other actions, you must call the /devops/onboarding/status endpoint and pass in the onboardingRequestID parameter that is returned by this endpoint.
Before you are able to access this endpoint, your admin must have configured the DevOps connection and credential alias (CreateDevOpsTool) to setup tools in the instance. For details, see Install DevOps Change Velocity. In addition, the calling entity must have the devops.integration.user role.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/onboarding/tool
Default URL: /api/sn_devops/devops/onboarding/tool
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
202 | Onboarding request was successfully created. |
Response body parameters
Example: cURL request
The following example shows how to onboard GitHub.
DevOps - POST /devops/orchestration/changeControl
Registers a callback with a ServiceNow instance for an orchestration task under change control, which can be called once a decision has been made on the change request.
Before you call this endpoint, you must have an orchestration task created in your ServiceNow instance. You can create this task either through Discovery or by calling the DevOps - POST /devops/orchestration/stepMapping endpoint. You must also ensure that the orchestration task is associated to a previously defined pipeline step and that change control is enabled (by selecting the Change control option on the App Stage form.) For details, see Accelerating DevOps change.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/changeControl
Default URL: /api/sn_devops/devops/orchestration/changeControl
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
toolId | Required. Sys_id of the DevOps tool for which to place the specified task under change control. Data type: String Table: Orchestration Tool [sn_devops_orchestration_tool] |
toolType | Type of tool. Valid value: Any value that identifies the tool, such as "jenkins". Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Name | Description |
---|---|
changeControl | Flag that indicates whether the orchestration task is under change control. Possible values:
Data type: Boolean |
Example: cURL request
Response body.
Example: cURL request
This example shows how to pass fields in the changeRequestDetails object when closing a change request.
Response body.
DevOps - POST /devops/orchestration/stepMapping
Verifies that the information being passed is valid for the creation of an orchestration task and is valid for association to a previously created step. If both are valid, it creates the orchestration task and makes the association.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/stepMapping
Default URL: /api/sn_devops/devops/orchestration/stepMapping
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
toolId | Required. Sys_id of the orchestration tool. Located in
the Orchestration Tool [sn_devops_orchestration_tool] table. Data type: String |
toolType | Required. Type of tool. Valid values: jenkins Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Element | Description |
---|---|
status | Flag that indicates whether the verification was successful. Valid values:
Data type: Boolean |
stepValid | Flag that indicates whether the information sent is valid. Valid values:
Data type: Boolean |
Example: Sample cURL request
Results if information is valid.
Results if information is invalid.
DevOps - POST /devops/package/registration
Enables orchestration tools to create new artifact packages that contain specified artifact versions.
Artifact packages are used to display commits to change approvers when they view a change request. For commits to show in change requests, the package must be created in the stage prior to the stage containing the change approval.
Any artifact versions included in the package registration request should already be registered with DevOps. For details on registering artifact versions, see DevOps - POST /devops/artifact/registration.
- artifacts.pipelineName or artifacts.projectName
- artifacts.taskExecutionNumber
- artifacts.stageName
- artifacts.branchName
For additional information on artifact packages, see Using DevOps change acceleration for releases.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/package/registration
Default URL: /api/sn_devops/devops/package/registration
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
orchestrationToolId | Required. Sys_id of the orchestration tool associated with the artifact package. The endpoint uses this information to locate task execution information. Data type: String Table: Orchestration Tool [sn_devops_orchestration_tool] |
toolId | Sys_id of the artifact tool associated with the artifact package. Data type: String Table: Artifact Tool [sn_devops_artifact_tool] |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: Sample cURL request
Response - package created:
Example: Sample cURL request
Response - request created a staged package:
DevOps - POST /devops/tool/{capability}
Posts the passed in payload to the Inbound Event [sn_devops_inbound] table for processing by a custom DevOps subflow.
Call this endpoint from the associated webhook in your tool, specified by the passed in capability parameter. A custom subflow, to process the passed in payload, must already be defined in your ServiceNow instance. Based on a predefined schedule, the DevOps Master Flow picks up the webhook event information from the Inbound Event table and passes it to the custom subflow, which then process the payload. For more information on creating a custom subflow, see Creating DevOps subflows.
For additional information on test tool integration, see DevOps test tool integration.
Before calling this endpoint for a custom DevOps tool, you must implement the handleTool() and getNativeIdForOrchestrationTask() methods from sn_devops.DevOpsOrchestrationToolIntegrationHandler. For more information, see DevOpsOrchestrationToolIntegrationHandler - Scoped.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/tool/{capability}
Default URL: /api/sn_devops/devops/tool/{capability}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
capability | Type of tool passing in the payload to store in the Inbound Event table. Valid values (not case-sensitive):
Data type: String |
Name | Description |
---|---|
orchestrationToolId | Optional. Sys_id of the orchestration tool to which the related pipeline belongs. orchestrationToolId is required if the capability request parameter is set to
test or softwarequality .The value in the toolId parameter is the default orchestration tool if the orchestrationToolId parameter isn't passed. Data type: String |
testType | Required if capability is set to test . Type of test being run. Data type: String Table: The valid values for this parameter are those in the Test type column of the Test Types [sn_devops_test_type] table. |
toolId | Required. Sys_id of the tool for which the endpoint is being called. Data type: String |
Name | Description |
---|---|
Tool dependant | The tool determines the content of the payload. |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: Sample cURL request for artifact
Success response:
Example: Sample cURL request for artifact
Error response:
Example: Sample cURL request for code
Success response:
Example: Sample cURL request for orchestration
Success response:
Example: Sample cURL request for plan
Success response:
Example: Sample cURL request for test
Success response:
DevOps - POST /devops/tool/event/{sn_tool_id}
Posts the passed in payload from GitHub, Jira, or Bitbucket to the Events [sn_devops_event] table for processing by a pre-built subflow.
To process events from any other tool besides GitHub, Jira, or Bitbucket, use the DevOps - POST /devops/tool/{capability} endpoint instead.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/tool/event/{sn_tool_id}
Default URL: /api/sn_devops/devops/tool/event/{sn_tool_id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
sn_tool_id | Sys_id of the tool to use for the request. Data type: String Table: Devops Tools [sn_devops_tool] |
Name | Description |
---|---|
None |
Name | Description |
---|---|
Tool dependant | The tool determines the content of the payload. The payload can be located in the tool under the webhook information. |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Name | Description |
---|---|
result | Response status. Possible values:
Data type: String |
Example: cURL request
GitHub
Success response:
Example: cURL request
Jira
Success response:
Example: cURL request
Bitbucket
Success response:
DevOps - PUT /devops/orchestration/changeControl/{changeControlId}
Updates the change control information for the specified orchestration task.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/changeControl/{changeControlId}
Default URL: /api/sn_devops/devops/orchestration/changeControl/{changeControlId}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
changeControlId | Sys_id of the change control task.
Located in the Callback [sn_devops_callback] table.
Data type: String |
Name | Description |
---|---|
toolId | Required. Sys_id of the DevOps tool associated with the change control task. Data type: String Table: Orchestration Tool [sn_devops_orchestration_tool] |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Example: Sample cURL request
Response:
DevOps - PUT /devops/orchestration/changeInfo/{changeInfo}
Updates fields in a specified change request.
URL format
Versioned URL: /api/sn_devops/{api_version}/devops/orchestration/changeInfo/{changeInfo}
Default URL: /api/sn_devops/devops/orchestration/changeInfo/{changeInfo}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
changeRequestNumber | Required. Change request number associated with the orchestration task to update. Data type: String Table: Change Request [change_request] |
Name | Description |
---|---|
data | Required. Name-value pairs for the field(s) to update in the associated change
request. For example, to update the short description file, enter a name-value
pair similar to the
following: For
the state parameter, only the following transitions are supported:
Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Authorization | Starting with v2, this API supports token-based authentication. Tokens can be acquired by clicking the Copy token button on the tool record, located in the Tool
[sn_devops_tool] table. The token can then be used in an authorization header in the format Authorization: sn_devops.DevOpsToken <tool_sys_id>:<tool_token> .Note: If Basic Auth details (user name and password) are provided in addition to an authorization header with token, Basic Auth takes precedence. If the devops.system user is not available in your instance, use the Switch to this user after token based authentication is successful property. This property enables setting any user that has the sn_devops.integration role, which is needed to complete the token authentication. For information, see DevOps Change Velocity properties. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
404 | Not found. The requested item wasn't found. |
Response body parameters
Name | Description |
---|---|
message | Description of the results of the update. Data type: String |
status | Status of the request. Possible values:
Data type: String |
updateStatus | Status of the update. Possible values:
Data type: String |
Example: cURL request
The following code example shows how to update various fields in the CHG0030023 change request.
Response:
On this page
- DevOps - GET /devops/code/schema
- DevOps - GET /devops/onboarding/status
- DevOps - GET /devops/orchestration/changeControl
- DevOps - GET /devops/orchestration/changeInfo
- DevOps - GET /devops/orchestration/schema
- DevOps - GET /devops/orchestration/stepMapping
- DevOps - GET /devops/plan/schema
- DevOps - POST /devops/artifact/registration
- DevOps - POST /devops/onboarding/app
- DevOps - POST /devops/onboarding/tool
- DevOps - POST /devops/orchestration/changeControl
- DevOps - POST /devops/orchestration/stepMapping
- DevOps - POST /devops/package/registration
- DevOps - POST /devops/tool/{capability}
- URL format
- Supported request parameters
- Headers
- Status codes
- Response body parameters
- Example: Sample cURL request for artifact
- Example: Sample cURL request for artifact
- Example: Sample cURL request for code
- Example: Sample cURL request for orchestration
- Example: Sample cURL request for plan
- Example: Sample cURL request for test
- URL format
- DevOps - POST /devops/tool/event/{sn_tool_id}
- DevOps - PUT /devops/orchestration/changeControl/{changeControlId}
- DevOps - PUT /devops/orchestration/changeInfo/{changeInfo}