Automation Sources

The automation/sources namespace provides API methods to retrieve all or specific automation sources for a project. This page covers the following API methods:

GET /projects/{project_id}/automation/sources

Returns all automation sources for a project.

This method uses pagination so you might need to request additional pages to retrieve all automation sources.

Request

This method supports the following expands so you can automatically include additional information for referenced objects:

  • users

Response

GET /api/v1/projects/1/automation/sources
200 OK
{
    "page": 1,
    "prev_page": null,
    "next_page": 2,
    "last_page": 2,
    "per_page": 100,
    "total": 150,
    "result": [
        {
            "id": 1,
            "project_id": 1,
            "name": "backend",
            "status": 2,
            ..
            "is_retired": false,
            "run_count": 100,
            "test_count_average": 2000,
            "elapsed_average": 1000000,
            "ran_at": "..",
            "created_at": "..",
            "created_by": 2,
            "updated_at": null,
            "updated_by": null,
            "retired_at": null,
            "retired_by": null
        },
        {
            "id": 2,
            "project_id": 1,
            "name": "frontend",
            "status": 3,
            ..
            "is_retired": true,
            "run_count": 200,
            "test_count_average": 3000,
            "elapsed_average": 1500000,
            "ran_at": "..",
            "created_at": "..",
            "created_by": 2,
            "updated_at": null,
            "updated_by": null,
            "retired_at": "..",
            "retired_by": 1

        },
        ..
    ],
    "expands": {
        ..
    }
}

Examples

// Get latest 100 automation sources for project with ID 5
GET /api/v1/projects/5/automation/sources

// Get second result page (pagination)
GET /api/v1/projects/5/automation/sources?page=2

// Get latest 100 active automation sources
GET /api/v1/projects/5/automation/sources?is_retired=0

// Get latest 100 retired automation sources, ordered by retire date
GET /api/v1/projects/5/automation/sources?is_retired=1&sort=automation_sources:retired_at

// Get automation sources and include user details
GET /api/v1/projects/5/automation/sources?expands=users

Status codes

200 400 401 403 422 (details)

GET /automation/sources/{automation_source_id}

Returns a single automation source.

Request

This method supports the following expands so you can automatically include additional information for referenced objects:

  • users

Response

GET /api/v1/automation/sources/1
200 OK
{
    "result": {
        "id": 1,
        "project_id": 1,
        "name": "backend",
        "status": 2,
        ..
        "is_retired": false,
        "run_count": 100,
        "test_count_average": 2000,
        "elapsed_average": 1000000,
        "ran_at": "..",
        "created_at": "..",
        "created_by": 2,
        "updated_at": null,
        "updated_by": null,
        "retired_at": null,
        "retired_by": null
    },
    "expands": {
        ..
    }
}

Examples

// Get the automation source with ID 5
GET /api/v1/automation/sources/5

// Get a automation source and include user details
GET /api/v1/automation/sources/1?expands=users

Status codes

200 400 401 403 404 422 (details)

Last updated