> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/en/autify-university/integrations/integrate-with-api.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Integrate with API

## Autify API

{% hint style="info" %}
**See** [**our OpenAPI definition**](https://autifyhq.github.io/autify-api/#/) **for API specifications.**

**However, for CI/CD integrations, we highly recommend to use our official integrations. See** [**CI/CD with Autify**](https://help.autify.com/nocode-web/en/autify-university/integrations/cicd-with-autify.md)**.**
{% endhint %}

Autify provides an API.

By using the API, you can integrate with CI/CD tools such as CircleCI and Jenkins, and it can be included in the development flow, such as executing a specific test plan automatically when the source code is merged.\
Access tokens are generated for each user. If you would like to share them, we recommend creating a user specifically for the API!

## Issue a personal access token <a href="#issue-a-personal-access-token" id="issue-a-personal-access-token"></a>

You will need a personal access token to use APIs, so make sure you generate one in advance. Access tokens are generated for each user. If you would like to share them, we recommend creating a user specifically for the API!

To generate a personal access token, go to ***\[Settings]*** in the side menu, open ***\[User settings]***, and click create button on ***\[Generate Personal Access Token]***.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-fd1fee608746b4b72d9d65b305c381b0a800fbcc%2Fzndsk-Screen_Shot_2021-09-14_at_17.13.51.png?alt=media)

## Using Autify API

### With Autify CLI

[Autify Command Line Interface (CLI)](https://help.autify.com/nocode-web/en/autify-university/integrations/autify-command-line-interface.md) provides low level commands for each Autify API so that you can create any solutions by shell script or equivalent easily.

{% hint style="info" %}
Autify CLI has several high level commands such as `autify web test run` to give you streamlined experiences for complex use cases. **Please consider to use these commands first** before crafting your solutions by calling Autify API directly.
{% endhint %}

A few examples with Autify CLI:

#### Run a test with the specified Scenario IDs and execution environments (capabilities)

```sh-session
$ autify web api execute-scenarios --project-id 0 --execute-scenarios-request '{
  "scenarios": [{"id": 111}],
  "capabilities": [{"os": "Linux", "browser": "Chrome"}]
}'

{
  "result_id": 222
}
```

#### Get a detailed test result for a given Test Result ID

```
$ autify web api describe-result --project-id 0 --result-id 222
{
  "id": 222,
  "status": "passed",
  "review_needed": false,
  "test_plan_capability_results": [
    {
      "id": 333,
      "capability": {
        "os": "Linux",
        "browser": "Chrome",
        ...
      },
      "test_case_results": [
        {
          "id": 444,
          "status": "passed",
          "project_url": "https://app.autify.com/...",
          "review_needed": 0,
          ...
        }
      ]
    }
  ],
  ...
}
```

See [GitHub readme](https://github.com/autifyhq/autify-cli#commands) for `autify web api` commands for more details.

### Your HTTP client

{% hint style="warning" %}
If Autify CLI is available for your environment, we highly recommend to use Autify CLI version above.

If you need SDK or official support for your environment, feel free to open a request on [GitHub Issues](https://github.com/autifyhq/autify-cli/issues)
{% endhint %}

If you want to integrate with Autify API and your own HTTP client e.g. `curl`, you can configure your client to send an HTTP request like below:

#### Run a test with the specified Scenario IDs and execution environments (capabilities)

```
POST /projects/0/execute_scenarios HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json
Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN
Content-Length: 77
Host: app.autify.com

{"scenarios":[{"id":111}],"capabilities":[{"os":"Linux","browser":"Chrome"}]}
```

#### Get a detailed test result for a given Test Result ID

```
GET /projects/0/results/222 HTTP/1.1
Accept: application/json, text/plain, */*
Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN
Host: app.autify.com
```

See [our OpenAPI definition](https://autifyhq.github.io/autify-api/#/) for API specifications.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/en/autify-university/integrations/integrate-with-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
