NAV Navbar
Home Functional Performance Mock Services API Monitoring
cURL
  • Introduction
  • Basics
  • Authentication Process
  • API Resources
  • Tests
  • Steps
  • Environments
  • Schedules
  • Results
  • Metrics
  • Regions
  • Account
  • Buckets
  • Teams
  • Integrations
  • Agents
  • Role Based Access Control
  • Usage
  • Introduction

    Welcome to the API Monitoring section of the BlazeMeter API reference! This section will cover the APIs used for creating, updating, and running API monitoring tests and environments, as well as getting the test results, handling test schedules, and handling administration on your account.

    The Runscope API provides access to data in your Runscope account. This document describes how to authenticate to the API and the resources available. If you have any problems using the Runscope API contact us at support@blazemeter.com

    This API reference uses the following conventions for your convenience:

    Basics

    Request Format

    All requests to the API are sent over HTTPS and use the following base URL:

    https://api.runscope.com

    Response Format

    Responses are returned as JSON data in the following format (see the right for example).

    {
         "data": { ... } or [ ... ],
         "meta": { ... },
         "error": { ... } or null
    } 
    

    Response Attributes

    Attribute Description
    data Contains the actual response information for the resource you are accessing. It will either be a JSON object or JSON array depending on what the resource returns.
    meta Contains other extra information about the response. This could include paging information for lists, warnings/errors information, links to other resources, etc.
    error Contains information if the there was an error with your request. This includes a longer description, error codes, and links to more information in our docs. If the request was successful, the error attribute's value will be set to null.

    Authentication

    All requests to the API require a valid OAuth 2 access token. You can generate an access token using the Web Authorization Flow or use the one that is automatically created for your account when creating a new application. Read the full Authentication docs for details.

    To make request an authenticated request to the Runscope API send the Authorization header with the access token value:

    Authorization: Bearer <access_token>

    Content-Type Header

    For API resources where JSON object data is sent in the request body, the 'Content-Type' header is required.

    When sending data in the request body, send the data type in the 'Content-Type' header:

    Content-Type: application/json

    Resources

    Check out the Resource Guide to learn more about each API resource.

    Authentication Process

    The Runscope API uses OAuth 2.0 for authentication. OAuth2 is a protocol that lets applications ask for authorization to a Runscope account without getting their password. Access tokens can be limited to specific types of data, and can be revoked by the user at any time.

    Applications

    To use the API, you must first create an Application.

    Applications must have a name, website URL, and callback URL. Once you create an application you'll be given a Client ID and a Client Secret to use in the authorization flow.

    When you create the application, we automatically authorize your own account for it and generate an access_token for your own use. This makes it easy to start using the API for personal use without building a web flow.

    To build applications that access data on other Runscope Accounts, you will need to send users through the Web Application Flow.

    Web Application Flow

    Step 1: Redirect to Authorization Dialog

    Authorize URL

    curl 'https://www.runscope.com/signin/oauth/authorize'
    

    Response 302 Found

    Location: https://www.runscope.com/signin/oauth/authorize?client_id=XXXXXX
                                                             &redirect_uri=https://example.com
                                                             &response_type=code
                                                             &scope=api:read%20messsage:write
                                                             &state=random_value
    

    To begin the OAuth flow, redirect a user to the Authorize URL.

    Authorize URL Parameters

    Attributes

    Available Scopes

    Scopes

    The user will be presented with the following confirmation screen:

    After clicking Authorize, they will be redirected to you Callback URL.

    Step 2: We Request Your Callback URL

    Sample Callback URL Request (Authorization Granted)

    curl 'https://example.com/oauth_callback?code=38a6c89f-7c15-4c95-ab48-8b733849958b'
    

    Once the app has been authorized, Runscope will redirect the user back to your Callback URL with an authorizaton code included in a code URL parameter. If the user declines to authorize your app, a redirect to your Callback URL will be issued with a error=access_denied URL parameter.

    Authorization Codes are only valid for a short time, you must exhange the code for an access token with 60 seconds or you will have to send the user through the authorization flow again.

    Step 3: Exchange Code for Access Token

    Access Token URL

    curl 'https://www.runscope.com/signin/oauth/access_token?client_id=1aa59acb-b1a2-4cfe-beaa-aa105fbf8bb9&client_secret=51d8caf2-d990-4e28-aa27-9dd2c745a1cf&code=38a6c89f-7c15-4c95-ab48-8b733849958b&grant_type=authorization_code&redirect_uri=https://my.domain.com' \
        -X POST
        -H 'Content-Type: application/json'
    

    Response 200 OK

    {
        "access_token":"43541d4a-c4b0-43b1-bd26-33231e06b71d",
        "token_type":"bearer"
    }
    

    You may now use this code to retrieve an Access Token from the Access Token URL.

    We will return a response with an access_token. This access token may be stored and used until the user revokes access to your application.

    Access Token Parameters

    Parameters

    API Resources

    Root

    Root URL

    curl 'https://api.runscope.com/'
    

    Response 200 OK

    {
        "data": {
            "bucket_list_url": "https://api.runscope.com/buckets",
            "current_account_url": "https://api.runscope.com/account"
        },
        "meta": {
            "status": "success"
        }
    }
    

    The root resource returns an object with links to other resources.

    Root Response Attributes

    Attributes

    Other Resources

    Resources

    Tests

    Create and view the details for tests within a bucket.

    Test List

    Test List

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests'
    

    Response 200 OK

    {
        "data": [
            {
                "created_at": 1438828991,
                "created_by": {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                },
                "default_environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
                "description": "An internal API!",
                "name": "My Service",
                "id": "9b47981a-98fd-4dac-8f32-c05aa60b8caf"
            }
        ],
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    A list of all the tests for this bucket.

    Test List Request Parameters

    Parameters

    Creating Tests

    Creating Tests Single Test

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"name": "Sample Name","description": "My test description"}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Creating Tests Sample POST Body(JSON) for Single Test

    { 
        "name": "Sample Name",
        "description": "My test description"
    }
    

    Creating Tests Multiple Tests

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '[{"name": "Sample Name #1","description": "My test description #1"},{"name": "Sample Name #2","description": "My test description #2"}]'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Creating Tests Sample POST Body(JSON) for Multiple Tests

    [
        { 
            "name": "Sample Name #1",
            "description": "My test description #1"
        },
        {
            "name": "Sample Name #2",
            "description": "My test description #2"
        }
    ]
    

    Create one or more tests in this bucket.

    Creating Tests Data Attributes

    Response 201 CREATED

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "assertions": [
                        {
                            "comparison": "is_equal",
                            "source": "response_status",
                            "value": 200
                        }
                    ],
                    "auth": {},
                    "body": "",
                    "form": {},
                    "headers": {},
                    "method": "GET",
                    "note": "",
                    "step_type": "request",
                    "url": "https://yourapihere.com/",
                    "id": "53f8e1fd-0989-491a-9f15-cc055f27d097",
                    "variables": []
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Test Detail

    Test Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the details of a given test by ID.

    Test Detail Response Attributes

    Response 200 OK

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "assertions": [
                        {
                            "comparison": "is_equal",
                            "source": "response_status",
                            "value": 200
                        }
                    ],
                    "auth": {},
                    "body": "",
                    "form": {},
                    "headers": {},
                    "method": "GET",
                    "note": "",
                    "step_type": "request",
                    "url": "https://yourapihere.com/",
                    "id": "53f8e1fd-0989-491a-9f15-cc055f27d097",
                    "variables": []
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Starting a Test Run

    To programmatically initiate a test run, use a Trigger URL.

    Modifying Tests

    Modifying Tests

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"name": "Sample Name","description": "My test description"}'
    

    Modify a test's name, description, default environment and its steps. To modify other individual properties of a test, make requests to the steps, environments, and schedules subresources of the test.

    Modifying Tests Data Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example. The PUT body for the request must be a JSON-encoded object with following parameters, parameters omitted will not be modified.

    Modifying Tests Sample PUT Body(JSON)

    { 
        "name": "Sample Name",
        "description": "My test description"
    }
    

    Response 200 OK

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "assertions": [
                        {
                            "comparison": "is_equal",
                            "source": "response_status",
                            "value": 200
                        }
                    ],
                    "auth": {},
                    "body": "",
                    "form": {},
                    "headers": {},
                    "method": "GET",
                    "note": "",
                    "step_type": "request",
                    "url": "https://yourapihere.com/",
                    "id": "53f8e1fd-0989-491a-9f15-cc055f27d097",
                    "variables": []
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Deleting Tests

    Deleting Tests

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete a test, including all steps, schedules, test-specific environments and results.

    Steps

    Modify the steps for a given test.

    Adding Test Steps

    Add steps to a test by POSTing a type-specific payload to the Test Steps resource. There are several types of test steps available:

    Request Step

    Adding Request Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"step_type":"request","method":"POST","url":"https://yourapihere.com/example/path","body":"{ \"hello\": \"world\" }",assertions": [{"source":"response_status","comparison":"equal_number","value": 200}],"variables":[{"name":"source_ip","property":"origin","source":"response_json"}],"auth": {"username":"authBasicUsername","auth_type":"basic","password":"authBasicPassword"},"headers": {"Content-Type": ["application/json"],"Accept": [*/*"]},"scripts": ["log(\"This is a sample post-response script\");","log(\"This is a second sample post-response script\");"],"before_scripts": ["log(\"This is a sample pre-request script\");","log(\"This is a second sample pre-request script\");"],"note":"get example data"}'
    

    The POST body must be a JSON object.

    Adding Request Steps Request Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Adding Request Step Sample POST Body(JSON) for Request Step

    { 
        "step_type": "request",
        "method": "POST",
        "url": "https://yourapihere.com/example/path",
        "body": "{ \"hello\": \"world\" }",
        "assertions": [
            {
                "source": "response_status", 
                "comparison": "equal_number", 
                "value": 200
            }
        ],
        "variables": [
            {
                "name": "source_ip",
                "property": "origin",
                "source": "response_json"
            }    
        ],
        "auth": {
            "username": "authBasicUsername",
            "auth_type": "basic",
            "password": "authBasicPassword"
        },
        "headers": {
            "Content-Type": [
                "application/json"
            ],
            "Accept": [
                "*/*"
            ]
        },
        "scripts": [
            "log(\"This is a sample post-response script\");",
            "log(\"This is a second sample post-response script\");"
        ],
        "before_scripts": [
            "log(\"This is a sample pre-request script\");",
            "log(\"This is a second sample pre-request script\");"
        ],
        "note": "get example data"
    }
    

    Response 201 CREATED

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "assertions": [
                        {
                            "comparison": "is_equal",
                            "source": "response_status",
                            "value": 200
                        }
                    ],
                    "auth": {},
                    "body": "",
                    "form": {},
                    "headers": {},
                    "method": "GET",
                    "note": "",
                    "step_type": "request",
                    "url": "https://yourapihere.com/",
                    "id": "53f8e1fd-0989-491a-9f15-cc055f27d097",
                    "variables": []
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    The following parameters can be set on the request step, and these are formatted the same as the test detail response output.

    Attributes

    Pause Step

    Adding Pause Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"step_type": "pause","duration": 5}'
    

    The POST body must be a JSON object.

    Adding Pause Steps Request Attributes

    The following parameters can be set on the pause step, and these are formatted the same as the test detail response output.

    Attributes

    Condition Step

    Adding Condition Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"step_type":"condition","left_value":"{{user_id}}","comparison":"equal","right_value":"12345","steps": [{"assertions": [{"comparison":"equal_number","source":"response_status","value": 200}],"method":"GET","step_type":"request","url":"https://yourapihere.com/"}]}'
    

    The POST body must be a JSON object.

    Adding Condition Steps Request Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Adding Condition Step Sample POST Body(JSON) for Condition Step

    {
        "step_type": "condition",
        "left_value": "{{user_id}}",
        "comparison": "equal",
        "right_value": "12345",
        "steps": [
            {
                "assertions": [
                    {
                        "comparison": "equal_number",
                        "source": "response_status",
                        "value": 200
                    }
                ],
                "method": "GET",
                "step_type": "request",
                "url": "https://yourapihere.com/"
            }
        ]
    }
    

    Response 201 CREATED

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "assertions": [
                        {
                            "comparison": "equal_number",
                            "source": "response_status",
                            "value": 200
                        }
                    ],
                    "method": "GET",
                    "step_type": "request",
                    "url": "https://yourapihere.com/"
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    The following parameters can be set on the condition step, and these are formatted the same as the test detail response output.

    Attributes

    Ghost Inspector Step

    Adding Ghost Inspector Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"step_type":"ghost-inspector","integration_id":"c6f2aa66-ed7e-4faf-a05d-5da7416da3ee","suite_id":"55c3b3b3fdac93101d808ca5","test_id":"55c3b3dbfdac93101d808ca6","is_custom_start_url": false,"start_url":"http://example.com","assertions": [{"comparison":"equal","property":"data.passing","source":"response_json","value":"true"}],"variables": [{"name":"screenshot_url","property":"data.screenshot.small.defaultUrl","source":"response_json"}]}'
    

    The POST body must be a JSON object.

    Adding Ghost Inspector Steps Data Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Adding Ghost Inspector Step Sample POST Body(JSON) for Ghost Inspector Step

    {
        "step_type": "ghost-inspector",
        "integration_id": "c6f2aa66-ed7e-4faf-a05d-5da7416da3ee",
        "suite_id": "55c3b3b3fdac93101d808ca5",
        "test_id": "55c3b3dbfdac93101d808ca6",
        "is_custom_start_url": false,
        "start_url": "http://example.com",
        "assertions": [
            {
                "comparison": "equal",
                "property": "data.passing",
                "source": "response_json",
                "value": "true"
            }
        ],
        "variables": [
            {
                "name": "screenshot_url",
                "property": "data.screenshot.small.defaultUrl",
                "source": "response_json"
            }
        ]
    }
    

    Response 201 CREATED

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "step_type": "ghost-inspector",
                    "integration_id": "c6f2aa66-ed7e-4faf-a05d-5da7416da3ee",
                    "suite_id": "55c3b3b3fdac93101d808ca5",
                    "test_id": "55c3b3dbfdac93101d808ca6",
                    "is_custom_start_url": false,
                    "start_url": "http://example.com",
                    "assertions": [
                        {
                            "comparison": "equal",
                            "property": "data.passing",
                            "source": "response_json",
                            "value": "true"
                        }
                    ],
                    "variables": [
                        {
                            "name": "screenshot_url",
                            "property": "data.screenshot.small.defaultUrl",
                            "source": "response_json"
                        }
                    ]
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    The following parameters can be set on the ghost inspector step, and these are formatted the same as the test detail response output.

    Attributes

    Subtest Step

    Adding Subtest Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"step_type":"request","method":"POST","url":"https://yourapihere.com/example/path","body":"{ \"hello\": \"world\" }",assertions": [{"source":"response_status","comparison":"equal_number","value": 200}],"variables":[{"name":"source_ip","property":"origin","source":"response_json"}],"auth": {"username":"authBasicUsername","auth_type":"basic","password":"authBasicPassword"},"headers": {"Content-Type": ["application/json"],"Accept": [*/*"]},"scripts": ["log(\"This is a sample post-response script\");","log(\"This is a second sample post-response script\");"],"before_scripts": ["log(\"This is a sample pre-request script\");","log(\"This is a second sample pre-request script\");"],"note":"get example data"}'
    

    The POST body must be a JSON object.

    Adding Subtest Steps Data Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Adding Subtest Step Sample POST Body(JSON) for Subtest Step

    {
        "step_type": "subtest",
        "test_uuid": "c6f2aa66-ed7e-4faf-a05d-5da7416da3ee",
        "environment_uuid": "d6f2aa66-ed7e-4faf-a05d-5da7416da3ef",
        "bucket_key": "fd1qy7w2l7ka",
        "assertions": [
            {
                "source": "response_status",
                "comparison": "equal_number",
                "value": 200
            }
        ],
        "variables": [
            {
                "name": "regionRunFrom",
                "property": "region",
                "source": "response_json"
            }    
        ],
        "params": [
            {
                "name": "foo",
                "value": "{{bar}}"
            }
        ]
    }
    

    Response 201 CREATED

    {
        "data": {
            "created_at": 1438832081,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
            "description": null,
            "environments": [
                {
                    "emails": {
                        "notify_all": false,
                        "notify_on": "all",
                        "notify_threshold": 1,
                        "recipients": []
                    },
                    "initial_variables": {
                        "base_url": "https://api.example.com"
                    },
                    "integrations": [
                        {
                            "description": "Pagerduty Account",
                            "integration_type": "pagerduty",
                            "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                        }
                    ],
                    "name": "Test Settings",
                    "parent_environment_id": null,
                    "preserve_cookies": false,
                    "regions": [
                        "us1"
                    ],
                    "remote_agents": [],
                    "script": "",
                    "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                    "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                    "verify_ssl": true,
                    "webhooks": null
                }
            ],
            "last_run": null,
            "name": "Sample Name",
            "schedules": [],
            "steps": [
                {
                    "step_type": "subtest",
                    "test_uuid": "c6f2aa66-ed7e-4faf-a05d-5da7416da3ee",
                    "environment_uuid": "d6f2aa66-ed7e-4faf-a05d-5da7416da3ef",
                    "bucket_key": "fd1qy7w2l7ka",
                    "assertions": [
                        {
                            "source": "response_status",
                            "comparison": "equal_number",
                            "value": 200,
                        }
                    ],
                    "variables": [
                        {
                            "name": "regionRunFrom",
                            "property": "region",
                            "source": "response_json",
                        }    
                    ],
                    "params": [
                        {
                            "name": "foo",
                            "value": "{{bar}}",
                        }
                    ]
                }
            ],
            "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
            "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    The following parameters can be set on the subtest step, and these are formatted the same as the test detail response output.

    Attributes

    Defining Assertions

    Defining Assertions for Status Code

    Defining Assertion for Status Code Sample POST Body(JSON) for Status Code == 200

    "assertions": [
        {
            "source": "response_status", 
            "comparison": "equal_number", 
            "value": 200
        }
    ]
    

    Defining Assertions for Element Contains Text

    Defining Assertion for Element Contians Text Sample POST Body(JSON) for JSON element 'address' contains the text "avenue"

    "assertions": [
        {
            "source": "response_json", 
            "property": "address", 
            "comparison": "contains", 
            "value": "avenue"
        }
    ]
    

    Defining Assertions for Response Time

    Defining Assertions for Response Time Sample POST Body(JSON) for Response Time is faster than 1 second.

    "assertions": [
        {
            "source": "response_time", 
            "comparison": "is_less_than", 
            "value": 1000
        }
    ]
    

    Assertions allow you to specify success criteria for a given request, Ghost Inspector, subtest, or condition step. Each assertion is defined by a source, property, comparison, and value.

    Assertion Sources List

    Sources

    Assertion Comparisons List

    Comparisons

    Defining Variables

    Defining Variables

    Defining Variables Sample POST Body(JSON) to set {{myUserId}} to the value of JSON element 'user_id'

    "variables": [
        {
            "source": "response_json", 
            "property": "user_id", 
            "name": "myUserId"
        }
    ]
    

    Variables allow you to extract data from request, subtest, and Ghost Inspector steps for use in subsequent steps in the test. Similar to Assertions, each variable is defined by a name, source, and property.

    Variable Sources List

    Sources

    Defining Authentication

    Defining Authentication with Basic Auth

    Defining Authentication with Basic Auth Sample POST Body(JSON) with Basic Auth

    "auth": {
            "auth_type": "basic",
            "username": "authBasicUsername",
            "password": "authBasicPassword"
    }
    

    Defining Authentication with OAuth 1.0

    Defining Authentication with OAuth 1.0 Sample POST Body(JSON) with OAuth 1.0 with signature type set to Authorization header. Other accepted values for signature_type are: body and query

    "auth": {
            "auth_type": "oauth_1",
            "access_token": "accessToken",
            "consumer_secret": "consumerSecret",
            "signature_type": "auth_header",
            "consumer_key": "consumerKey",
            "token_secret": "tokenSecret"
    }
    

    Defining Authentication with Client Certificate

    Defining Authentication with Client Certificate Sample POST Body(JSON) to set {{myUserId}} with Client Certificate auth

    "auth": {
            "auth_type": "client_certificate"
    }
    

    The authentication property allows you to define the authentication method for your requests. We currently support Basic, OAuth 1.0a, and Client Certificate. If you want to use OAuth2, we recommend using subtest steps, and you can find more information about it in this blog post. The type of authentication is defined in the auth_type property, and each method requires different properties. You can find them in these following examples.

    Changing Step Order

    Changing Step Order

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X PUT
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '["f6b09ca8-0803-478f-9919-d4ddc66db006","839a5dff-dad3-4693-90a3-dcaba462514a"]'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Changing Step Order Sample POST Body(JSON) for Changing Step Order

    [
        "f6b09ca8-0803-478f-9919-d4ddc66db006",
        "839a5dff-dad3-4693-90a3-dcaba462514a"
    ]
    
    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps' \
        -X PUT
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '["f6b09ca8-0803-478f-9919-d4ddc66db006",{"id":"c6f2aa66-ed7e-4faf-a05d-5da7416da3ee","steps":["53f8e1fd-0989-491a-9f15-cc055f27d097","626a024c-f75e-4f57-82d4-104fe443c0f3"]},"839a5dff-dad3-4693-90a3-dcaba462514a"]'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Changing Step Order with Condition Sample PUT Body(JSON) for Changing Step Order with Condition

    [
        "f6b09ca8-0803-478f-9919-d4ddc66db006",
        {
            "id": "c6f2aa66-ed7e-4faf-a05d-5da7416da3ee",
            "steps": [
                "53f8e1fd-0989-491a-9f15-cc055f27d097",
                "626a024c-f75e-4f57-82d4-104fe443c0f3"
            ]
        },
        "839a5dff-dad3-4693-90a3-dcaba462514a"
    ]
    

    The body of the PUT request should contain an ordered list of id's of the test step for the test. If any id's are omitted the request will fail. If the test contains a Condition, you must provide the step and its embedded steps in the form of an object like:
    { "id": "your_condition_id", "steps": ["your_embeded_step_id_1",...]}

    Test Step Detail

    Changing Step Order

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps/<step_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "data": {
            "assertions": [
                {
                    "comparison": "is_null",
                    "source": "response_json"
                }
            ],
            "auth": {},
            "body": "",
            "form": {},
            "headers": {},
            "method": "GET",
            "note": "this is step 1",
            "step_type": "request",
            "url": "https://yourapihere.com/",
            "id": "f6b09ca8-0803-478f-9919-d4ddc66db006",
            "variables": []
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Get the details of a single test step for a given API test.

    Modifying Test Steps

    Modifying Test Steps

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps/<step_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"method":"GET","url":"https://yourapihere.com/example/path","assertions": [{"source":"response_status","comparison":"equal_number","value": 200}],"variables": [{"name":"source_ip","property":"origin","source":"response_json"}],"note":"get example data"}'
    

    The same JSON Body for adding a Test Step can be used to modify an existing step.

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Modifying Test Steps Sample POST Body(JSON) for Modifying Test Steps

    { 
        "method": "GET",
        "url": "https://yourapihere.com/example/path",
        "assertions": [
            {
                "source": "response_status", 
                "comparison": "equal_number", 
                "value": 200
            }
        ],
        "variables": [
            {
                "name": "source_ip",
                "property": "origin",
                "source": "response_json"
            }    
        ],
        "note": "get example data"
    }
    

    Update the details of a single test step for a given API test.

    Delete Test Step

    Delete Test Step

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/steps/<step_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete a step from a test.

    Environments

    Retrieve details for shared and test-specific environments.

    Test Envrionment List

    Test Environment List

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/environments' \
        -H 'Authorization: Bearer <access_token>'
    

    Get the details of the environments for a test.

    Test Environment List Response Attributes

    Response 200 OK

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Attributes

    Create Test Environment

    Create Test Environment

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/environments' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"emails": {"notify_all": false,"notify_on":"all","notify_threshold": null,"recipients": [{"email":"grace@example.com","name":"Grace Hopper","id":"4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"}]},"initial_variables": {"my_variable":"some value","one more":"values"},"integrations": [],"name":"Remote Settings","parent_environment_id": null,"preserve_cookies": false,"regions": ["us1","jp1"],"retry_on_failure": false,"stop_on_failure": false,"remote_agents": [{"name":"my-local-machine.runscope.com","uuid":"141d4dbc-1e41-401e-8067-6df18501e9ed"}],"script":"var a = \"asdf\";\nlog(\"OK\");","verify_ssl": true,"client_certificate":"","webhooks": ["http://api.example.com/webhook_reciever","https://yourapihere.com/post"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Create Test Environment Sample POST Body(JSON) for Create Test Environment

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Response 201 CREATED

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Create a new test environment by POSTing a JSON body with the environment details.

    Shared Environment List

    Test Environment List

    curl 'https://api.runscope.com/buckets/<bucket_key>/environments' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Get the details of the shared environments for a bucket.

    Create Shared Environment

    Create Test Environment

    curl 'https://api.runscope.com/buckets/<bucket_key>/environments' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"emails": {"notify_all": false,"notify_on":"all","notify_threshold": null,"recipients": [{"email":"grace@example.com","name":"Grace Hopper","id":"4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"}]},"initial_variables": {"my_variable":"some value","one more":"values"},"integrations": [],"name":"Remote Settings","parent_environment_id": null,"preserve_cookies": false,"regions": ["us1","jp1"],"retry_on_failure": false,"stop_on_failure": false,"remote_agents": [{"name":"my-local-machine.runscope.com","uuid":"141d4dbc-1e41-401e-8067-6df18501e9ed"}],"script":"var a = \"asdf\";\nlog(\"OK\");","verify_ssl": true,"client_certificate":"","webhooks": ["http://api.example.com/webhook_reciever","https://yourapihere.com/post"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example. See the example POST body for creating a Test Environment.

    Create Test Environment Sample POST Body(JSON) for Create Test Environment

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Response 201 CREATED

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Create a new test environment.

    Environment Detail

    Test Environment Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/test/<test_id>/environments/<environment_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Shared Environment Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/environments/<environment_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Get the details of a single test environment or shared envionment.

    Modify Environment

    Modify Environment

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/environments/<environment_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"emails": {"notify_all": false,"notify_on":"all","notify_threshold": null,"recipients": [{"email":"grace@example.com","name":"Grace Hopper","id":"4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"}]},"initial_variables": {"my_variable":"some value","one more":"values" },"integrations": [],"name":"Remote Settings","parent_environment_id": null,"preserve_cookies": false,"regions": ["us1","jp1"],"retry_on_failure": false,"stop_on_failure": false,"remote_agents": [{"name":"my-local-machine.runscope.com","uuid":"141d4dbc-1e41-401e-8067-6df18501e9ed"}],"script":"var a = \"asdf\";\nlog(\"OK\");","script_library": ["1a3eb343-4666-4056-bf3d-5e9693be86cd"],"verify_ssl": true,"client_certificate":"","webhooks": ["http://api.example.com/webhook_reciever","https://yourapihere.com/post"]}'
    

    Modify Shared Environment

    curl 'https://api.runscope.com/buckets/<bucket_key>/environments/<environment_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"emails": {"notify_all": false,"notify_on":"all","notify_threshold": null,"recipients": [{"email":"grace@example.com","name":"Grace Hopper","id":"4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"}]},"initial_variables": {"my_variable":"some value","one more":"values" },"integrations": [],"name":"Remote Settings","parent_environment_id": null,"preserve_cookies": false,"regions": ["us1","jp1"],"retry_on_failure": false,"stop_on_failure": false,"remote_agents": [{"name":"my-local-machine.runscope.com","uuid":"141d4dbc-1e41-401e-8067-6df18501e9ed"}],"script":"var a = \"asdf\";\nlog(\"OK\");","script_library": ["1a3eb343-4666-4056-bf3d-5e9693be86cd"],"verify_ssl": true,"client_certificate":"","webhooks": ["http://api.example.com/webhook_reciever","https://yourapihere.com/post"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example. See the example POST body for creating a Test Environment.

    Modify Environment Sample PUT Body(JSON) for Modify Test Environment

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "script_library": [
            "1a3eb343-4666-4056-bf3d-5e9693be86cd"
        ],
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Response 200 OK

    {
        "emails": {
            "notify_all": false,
            "notify_on": "all",
            "notify_threshold": null,
            "recipients": [
                {
                    "email": "grace@example.com",
                    "name": "Grace Hopper",
                    "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
                }
            ]
        },
        "initial_variables": {
            "my_variable": "some value",
            "one more": "values"
        },
        "integrations": [],
        "name": "Remote Settings",
        "parent_environment_id": null,
        "preserve_cookies": false,
        "regions": [
            "us1",
            "jp1"
        ],
        "retry_on_failure": false,
        "stop_on_failure": false,
        "remote_agents": [
            {
                "name": "my-local-machine.runscope.com",
                "uuid": "141d4dbc-1e41-401e-8067-6df18501e9ed"
            }
        ],
        "script": "var a = \"asdf\";\nlog(\"OK\");",
        "test_id": null,
        "id": "f8007150-0052-482c-9d52-c3ea4042e0f5",
        "verify_ssl": true,
        "client_certificate": "",
        "webhooks": [
            "http://api.example.com/webhook_reciever",
            "https://yourapihere.com/post"
        ]
    }
    

    Update the details of an test environment by making a PUT request with a JSON body of the environment details. The full environment details will need to be provided, not just the updated configuration.

    Delete an Environment

    Delete Environment

    curl 'https://api.runscope.com/buckets/<bucket_key>/environment/<environment_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete an environment.

    Schedules

    Retrieve and modify a test's schedules.

    Test Schedule List

    Test Schedule List

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/schedules' \
        -H 'Authorization: Bearer <access_token>'
    

    Get the list of schedules for a test.

    Test Schedule List Response Attributes

    Response 200 OK

    {
        "data": [
            {
                "environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
                "interval": "1h",
                "note": "Staging Environment",
                "id": "084e6df7-9165-46d2-9e1c-b87ccfc53d18"
            },
            {
                "environment_id": "5e70db57-7485-4ca9-bb4d-482416993ddd",
                "interval": "5m",
                "note": "Production Monitoring",
                "id": "c60e5a78-0dbd-493a-9e99-9a8282935d0c"
            }
        ],
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Schedule Details

    Schedule Details

    curl 'https://api.runscope.com/buckets/<bucket_key>/test/<test_id>/schedules/<schedule_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Get the details of a single test schedule.

    Schedule Details Response Attributes

    Response 200 OK

    {
        "data": {
                "environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
                "interval": "1h",
                "note": "Staging Environment",
                "id": "084e6df7-9165-46d2-9e1c-b87ccfc53d18"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Create Schedule

    Create Schedule

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/schedules' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"environment_id": "951b681e-0a16-44ab-acfb-505a0a8564e9","interval": "1d","note": "Once a day schedule"}'
    

    Create one or more tests in this bucket.

    Create Schedule Request Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Create Schedule Sample POST Body(JSON) for Create Schedule

    {
        "environment_id": "951b681e-0a16-44ab-acfb-505a0a8564e9",
        "interval": "1d",
        "note": "Once a day schedule"
    }
    

    Response 201 CREATED

    {
        "data": {
                "environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
                "interval": "1h",
                "note": "Staging Environment",
                "id": "084e6df7-9165-46d2-9e1c-b87ccfc53d18"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Modify Schedule

    Modify Schedule

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/environments/<environment_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba","interval": "5m","note": "Production Monitoring Schedule"}'
    

    Update the details of a single schedule by making a PUT request with a JSON body to the schedule details resource. Updating a schedule will cause the test to execute starting at the time of the request on the given interval.

    Modify Schedule Data Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Modify Schedule Sample PUT Body(JSON) for Modify Schedule

    {
        "environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
        "interval": "5m",
        "note": "Production Monitoring Schedule"
    }
    

    Response 200 OK

    {
        "data": {
                "environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
                "interval": "1h",
                "note": "Staging Environment",
                "id": "084e6df7-9165-46d2-9e1c-b87ccfc53d18"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Delete Test Schedule

    Delete Test Schedule

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/schedules/<schedule_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete (or stop) a schedule.

    Results

    Retrieve details for API Tests and results in a given bucket.

    Test Result List

    Test Result List

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/results' \
        -H 'Authorization: Bearer <access_token>'
    

    A list of all results for a given test, including results and those currently in progress.

    Test Result List Request Parameters

    Response 200 OK

    {
        "data": [
            {
                "agent": null,
                "assertions_defined": 2,
                "assertions_failed": 0,
                "assertions_passed": 2,
                "bucket_key": "6knqwmwvqpzr",
                "finished_at": 1406061608.506811,
                "region": "us1",
                "requests_executed": 1,
                "result": "pass",
                "scripts_defined": 2,
                "scripts_failed": 0,
                "scripts_passed": 2,
                "started_at": 1406036406.68105,
                "test_run_id": "0aa48464-f89e-4596-8d60-79bc678d313f",
                "test_run_url": "https://api.runscope.com/buckets/6knqwmwvqpzr/tests/db4cc896-2804-4520-ad06-0caf3bf216a8/results/0aa48464-f89e-4596-8d60-79bc678d313f",
                "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
                "variables_defined": 2,
                "variables_failed": 0,
                "variables_passed": 2,
                "environment_id": "abcdc896-2804-4520-ad06-0caf3bf216a8",
                "environment_name": "My Test Environment"
            },
            {
                "agent": null,
                "assertions_defined": 2,
                "assertions_failed": 1,
                "assertions_passed": 1,
                "bucket_key": "6knqwmwvqpzr",
                "finished_at": 1406058767.591204,
                "region": "us1",
                "requests_executed": 1,
                "result": "fail",
                "scripts_defined": 2,
                "scripts_failed": 1,
                "scripts_passed": 1,
                "started_at": 1406033565.139315,
                "test_run_id": "53a99b33-88ac-4890-8e07-112c86cdbf91",
                "test_run_url": "https://api.runscope.com/buckets/6knqwmwvqpzr/tests/db4cc896-2804-4520-ad06-0caf3bf216a8/results/53a99b33-88ac-4890-8e07-112c86cdbf91",
                "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
                "variables_defined": 2,
                "variables_failed": 1,
                "variables_passed": 1,
                "environment_id": "abcdc896-2804-4520-ad06-0caf3bf216a8",
                "environment_name": "My Test Environment"
            }
        ],
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Test Result Detail

    Test Result Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/results/<test_run_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Latest Test Result Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/results/latest' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the details of a given test run by ID.

    Test Result Detail Response Attributes

    Response 200 OK

    {
        "data": {
            "agent": null,
            "assertions_defined": 2,
            "assertions_failed": 1,
            "assertions_passed": 1,
            "bucket_key": "6knqwmwvqpzr",
            "finished_at": 1406061608.969942,
            "region": "us1",
            "requests": [
                {
                    "uuid": "570e2a5b-15c0-4b6c-8c30-f807b520396e",
                    "result": "fail",
                    "url": "https://yourapihere.com/",
                    "method": "GET",
                    "assertions_defined": 2,
                    "assertions_failed": 1,
                    "assertions_passed": 1,
                    "scripts_defined": 2,
                    "scripts_failed": 1,
                    "scripts_passed": 1,
                    "variables_defined": 2,
                    "variables_failed": 1,
                    "variables_passed": 1,
                    "assertions": [
                        {
                            "result": "pass",
                            "source": "json",
                            "property": "id",
                            "comparison": "equals_number",
                            "target_value": "123",
                            "actual_value": "123",
                            "error": null
                        },
                        {
                            "result": "fail",
                            "source": "response_time_ms",
                            "property": null,
                            "comparison": "less_than",
                            "target_value": "500",
                            "actual_value": "725",
                            "error": null
                        }
                    ],
                    "scripts": [
                        {
                            "result": "pass",
                            "output": "script output",
                            "error": null
                        },
                        {
                            "result": "fail",
                            "output": "script output",
                            "error": "Variable undefined."
                        }
                    ],
                    "timings": {
                        "dns_lookup_ms": 0.4811286926269531,
                        "dial_ms": 0.7872581481933594,
                        "send_headers_ms": 7.442474365234375,
                        "send_body_ms": 0.0016689300537109375,
                        "wait_for_response_ms": 107.25116729736328,
                        "receive_response_ms": 0.034332275390625
                    },
                    "variables": [
                        {
                            "result": "pass",
                            "source": "json",
                            "property": "id",
                            "name": "customer_id",
                            "value": 123,
                            "error": null
                        },
                        {
                            "result": "fail",
                            "source": "json",
                            "property": "name",
                            "name": "name",
                            "value": null,
                            "error": "Attribute not found."
                        }
                    ]
                }
            ],
            "requests_executed": 1,
            "result": "fail",
            "scripts_defined": 2,
            "scripts_failed": 1,
            "scripts_passed": 1,
            "started_at": 1406036406.531371,
            "test_run_id": "0aa48464-f89e-4596-8d60-79bc678d313f",
            "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
            "variables_defined": 2,
            "variables_failed": 1,
            "variables_passed": 1
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Test Result Step Detail

    Test Result Step Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/results/<test_run_id>/steps/<step_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the HTTP request and response details of a given test step within a test run by ID. Supported step types are request and incoming request (pauses, Ghost Inspector and conditional steps are not supported).

    Test Step Result Detail Response Attributes

    Response 200 OK

    {
        "data": {
            "bucket_key": "vnms9d3tgg4u",
            "uuid": "7a8daf40-60ea-44d8-9b4c-4695b76f3a1d",
            "request": {
                "body": "",
                "body_encoding": "plaintext",
                "headers": {
                    "Accept": [
                        "*/*"
                    ],
                    "Accept-Encoding": [
                        "gzip, deflate, compress"
                    ],
                    "Host": [
                        "api-twilio-com-vnms9d3tgg4u.runscope.net"
                    ],
                    "User-Agent": [
                        "runscope/1.0"
                    ]
                },
                "host": "api.twilio.com",
                "method": "GET",
                "params": {},
                "path": "/",
                "scheme": "https",
                "timestamp": 1368828807.918586
            },
            "response": {
                "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<TwilioResponse><Versions page=\"0\" numpages=\"1\" pagesize=\"50\" total=\"2\" start=\"0\" end=\"1\" uri=\"/\" firstpageuri=\"\" previouspageuri=\"\" nextpageuri=\"\" lastpageuri=\"\"><Version><Name>2008-08-01</Name><Uri>/2008-08-01</Uri><SubresourceUris><Accounts>/2008-08-01/Accounts</Accounts></SubresourceUris></Version><Version><Name>2010-04-01</Name><Uri>/2010-04-01</Uri><SubresourceUris><Accounts>/2010-04-01/Accounts</Accounts></SubresourceUris></Version></Versions></TwilioResponse>\n",
                "body_encoding": "plaintext",
                "headers": {
                    "Content-Length": [
                        "511"
                    ],
                    "Content-Type": [
                        "application/xml"
                    ]
                },
                "reason": "OK",
                "size_bytes": 511,
                "status": 200,
                "timestamp": 1368828808.555258
            }
        },
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Metrics

    Retrieve the metrics shown on the Runscope dashboard of a given test by ID.

    Test Metrics

    A list of metrics for a given test, including average response time, success ratio, and overall changes in performance compared to the previous time period.

    Test Metrics

    curl 'https://api.runscope.com/buckets/<bucket_key>/tests/<test_id>/metrics' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "response_times":[
            {
                "success_ratio":0.3333333333333333,
                "timestamp":1494964800,
                "avg_response_time_ms":44
            },
            {
                "success_ratio":1.0,
                "timestamp":1494968400,
                "avg_response_time_ms":35
            },
            {
                "success_ratio":0.4,
                "timestamp":1494972000,
                "avg_response_time_ms":40
            },
            {
                "success_ratio":0.5517241379310345,
                "timestamp":1494975600,
                "avg_response_time_ms":39
            },
            {
                "success_ratio":1.0,
                "timestamp":1494979200,
                "avg_response_time_ms":41
            },
            {
                "success_ratio":0.956081081081081,
                "timestamp":1494982800,
                "avg_response_time_ms":68
            },
            {
                "success_ratio":1.0,
                "timestamp":1494986400,
                "avg_response_time_ms":105
            },
            {
                "success_ratio":1.0,
                "timestamp":1494990000,
                "avg_response_time_ms":38
            },
            {
                "success_ratio":1.0,
                "timestamp":1494993600,
                "avg_response_time_ms":37
            },
            {
                "success_ratio":1.0,
                "timestamp":1494997200,
                "avg_response_time_ms":44
            },
            {
                "success_ratio":1.0,
                "timestamp":1495000800,
                "avg_response_time_ms":36
            },
            {
                "success_ratio":1.0,
                "timestamp":1495004400,
                "avg_response_time_ms":36
            },
            {
                "success_ratio":1.0,
                "timestamp":1495008000,
                "avg_response_time_ms":48
            },
            {
                "success_ratio":0.9965397923875432,
                "timestamp":1495011600,
                "avg_response_time_ms":46
            },
            {
                "success_ratio":1.0,
                "timestamp":1495015200,
                "avg_response_time_ms":45
            },
            {
                "success_ratio":1.0,
                "timestamp":1495018800,
                "avg_response_time_ms":52
            },
            {
                "success_ratio":1.0,
                "timestamp":1495022400,
                "avg_response_time_ms":90
            },
            {
                "success_ratio":1.0,
                "timestamp":1495026000,
                "avg_response_time_ms":83
            },
            {
                "success_ratio":1.0,
                "timestamp":1495029600,
                "avg_response_time_ms":47
            },
            {
                "success_ratio":1.0,
                "timestamp":1495033200,
                "avg_response_time_ms":44
            },
            {
                "success_ratio":1.0,
                "timestamp":1495036800,
                "avg_response_time_ms":43
            },
            {
                "success_ratio":1.0,
                "timestamp":1495040400,
                "avg_response_time_ms":44
            },
            {
                "success_ratio":1.0,
                "timestamp":1495044000,
                "avg_response_time_ms":37
            },
            {
                "success_ratio":0.5714285714285714,
                "timestamp":1495047600,
                "avg_response_time_ms":29
            }
        ],
        "change_from_last_period":{
            "response_time_50th_percentile":0.05284147557328004,
            "response_time_99th_percentile":-0.03965577026132455,
            "total_test_runs":0.0313588850174216,
            "response_time_95th_percentile":0.2567257314416911
        },
        "environment_uuid":"all",
        "region":"all",
        "timeframe":"day",
        "this_time_period":{
            "response_time_50th_percentile":44.0,
            "response_time_99th_percentile":101.54999999999998,
            "total_test_runs":296,
            "response_time_95th_percentile":88.94999999999997
        }
    }
    

    This API returns an array of test response times with an interval of minutes/hours/days, depending on the timeframe filter you use when making the request. Each response time object contains the success_ratio (between 0.0, all fails, to 1.0, all passes), timestamp in Unix format, and avg_response_time_ms properties.

    The response also includes two objects: this_time_period, which includes the average response time in milliseconds of all the data points that fall within the 50th, 95th, and 99th percentile, and change_from_last_period, which includes the difference in response time for the same percentiles. For example, if you have the property response_time_99th_percentile: 43.91291 in this_time_period, that means that the average response time of 99% of your tests fall at or under 43.9ms, and 1% fall above.

    You can use those values to have a better idea if your tests have been getting slower, consistent, or faster, as time progresses.

    Test Metrics Request Parameters

    Attributes

    Regions

    Regions List

    curl 'https://api.runscope.com/regions' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "data": {
            "regions": [
                {
                    "region_code": "us1",
                    "location": "US East (Northern Virginia)",
                    "service_provider": "Amazon Web Services",
                    "hostname": "us1.runscope.net"
                }
            ]
        },
        "meta": {
            "status": "success"
        }
    }
    

    Information about the available service regions that you can use to send requests through Runscope.

    Account

    Account

    curl 'https://api.runscope.com/account'
    

    Information about the authorized account.

    Account Response Attributes

    Response 200 OK

    {
        "data": {
            "name": "Grace Hopper", 
            "uuid": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9", 
            "email": "grace@example.com", 
            "teams": [
                {
                    "uuid": "1234abcd-7fe1-43cb-aa12-ef50420f2cf9",
                    "name": "Amazing Grace"
                }
            ]
        }, 
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Buckets

    Retrieve details for the buckets available to the authorized account. If the account belongs to multiple teams, buckets for all the teams the belong to are accessible.

    Bucket List

    Bucket List

    curl 'https://api.runscope.com/buckets' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "data": [
            {
                "auth_token": null,
                "default": false,
                "key": "z20co0kgljjk",
                "name": "Lucky Notebook",
                "team": {
                    "name": "Personal Team",
                    "uuid": "7a7a0917-91d7-43ef-b8f4-fe31762167e0"
                },
                "verify_ssl": true
            },
            {
                "auth_token": null,
                "default": false,
                "key": "ov2f2tqifoov",
                "auth_token": "7n7n0917-91q7-43rs-o8s4-sr31762167r0",
                "name": "Mobile Apps",
                "team": {
                    "name": "Mobile Team",
                    "uuid": "7a7a0917-91d7-43ef-b8f4-fe31762167e0"
                },
                "verify_ssl": true
            },
        ],
        "meta": {
            "status": "success"
        }
    }
    

    These bucket keys may be used to make requests through Runscope to capture API data on behalf of the authorized account. Authenticated buckets are only returned if you are authorized with the bucket:auth_token scope.

    Bucket Detail

    Test Result Detail

    curl 'https://api.runscope.com/buckets/<bucket_key>' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the details of a given bucket by key.

    Bucket Detail Response Attributes

    Response 200 OK

    {
        "data": {
            "auth_token": null,
            "default": false,
            "key": "ov2f2tq1floq",
            "name": "Mobile Apps",
            "team": {
                "name": "Mobile Team",
                "uuid": "7a7a0917-91d7-43ef-b8f4-fe31762167e0"
            },
            "verify_ssl": true
        },
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Creating a Bucket

    Creating a Bucket

    curl 'https://api.runscope.com/buckets?name=Mobile%20Team&team_uuid=7a7a0917-91d7-43ef-b8f4-fe31762167e0' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>'
    

    Create a new test environment by POSTing a JSON body with the environment details.

    Creating a Bucket Request Parameters

    Parameters

    Creating a Bucket Response Attributes

    Response 201 CREATED

    {
        "data": {
            "auth_token": null,
            "default": false,
            "key": "ov2f2tq1floq",
            "name": "Mobile Apps",
            "team": {
                "name": "Mobile Team",
                "uuid": "7a7a0917-91d7-43ef-b8f4-fe31762167e0"
            },
            "verify_ssl": true
        },
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Deleting a Bucket

    Deleting a Bucket

    curl 'https://api.runscope.com/buckets/<bucket_key>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete a bucket by key. You cannot delete the default bucket on an account.

    Teams

    List people and integrations associated with a given team.

    Team Members List

    Team Members List

    curl 'https://api.runscope.com/teams/<team_id>/people' \
        -H 'Authorization: Bearer <access_token>'
    

    Teams Response Attributes

    Response 200 OK

    [
        {
            "name": "Grace Hopper",
            "created_at": "Wed, 14 Aug 2019 19:53:48 -0000",
            "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9",
            "last_login_at": "Thu, 21 Nov 2019 15:22:00 -0000",
            "role_name": "User Group",
            "email": "grace@example.com",
            "uuid": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9",
        },
        {
            "name": "Ada Lovelace",
            "created_at": "Sun, 14 Apr 2019 13:07:23 -0000",
            "id": "84fa0764-ba80-4f0e-8e33-1ad12280f3f1",
            "last_login_at": "Tue, 04 Feb 2020 09:47:32 -0000",
            "role_name": "User Group",
            "email": "ada@example.com",
            "uuid": "84fa0764-ba80-4f0e-8e33-1ad12280f3f1"
        },
    ]
    

    Attributes

    Integrations

    List 3rd-party connected services associated with a given team.

    Team Integrations List

    Team Integrations List

    curl 'https://api.runscope.com/teams/<team_id>/integrations' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    [
        {
            "description": "PagerDuty: Production Alerts",
            "type": "pagerduty",
            "uuid": "cf95026e-8951-4ae1-83a7-699243678490"
        },
        {
            "description": "Slack: #api-tests channel, send message on failed test runs",
            "type": "slack",
            "uuid": "12014ba3-f5d7-448f-8740-f5ca2f498674"
        }
    ]
    

    Integrations Response Attributes

    Attributes

    Agents

    List currently connected agents associated with a given team.

    Team Agents List

    Team Agents List

    curl 'https://api.runscope.com/teams/<team_id>/agents'
    

    Agents Response Attributes

    Response 200 OK

    {
        "meta": {
            "status": "success"
        },
        "data": [
            {
                "version": "go-radar-agent v0.27",
                "agent_id": "79f50f9a-dc4b-403b-8006-fb198356eb95",
                "name": "Grace-Hopper-Macbook.local"
            }
        ],
        "error": null
    }
    

    Attributes

    Role Based Access Control

    Assign, modify, or un-assign a built-in or custom role to/from a user or team group.

    Available Permissions

    Permissions

    List Roles

    Test Environment List

    curl 'https://api.runscope.com/teams/<team_id>/roles' \
        -H 'Authorization: Bearer <access_token>'
    

    Response 200 OK

    {
        "name": "Read-only Members",
        "permissions": [
            "team:people:view",
            "bucket:alerts:view",
            "bucket:tests:view",
            "bucket:traffic:view",
            "team:secrets:view"
        ],
        "uuid": "6c591177-a19d-41d8-a74e-05ad350c472f"
    }
    

    Get the list of the roles in a team.

    Returns the details of the roles in a given team.

    Create Role

    Create Role

    curl 'https://api.runscope.com/teams/<team_id>/roles' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"name": "Viewer","permissions": ["team:people:view"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Create Role Sample POST Body(JSON) for Create Role

    {
        "name": "Viewer",
        "permissions": [
            "team:people:view"
        ]
    }
    

    Response 201 CREATED

    {
        "data": {
            "name": "Viewer",
            "permissions": [
                "team:people:view"
            ],
            "uuid": "f8ad39e1-053b-4bce-b0f1-1564df7b5c9f"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Create a new role by POSTing a JSON body with the role details.

    Returns the details of the new role.

    Create Role Request Attributes

    Attributes

    Role Details

    Role Details

    curl 'https://api.runscope.com/teams/<team_uuid>/roles/<role_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the details of a given role by ID.

    Returns a single role resource.

    Role Details Response Attributes

    Response 200 OK

    {
        "data": {
            "name": "Viewer",
            "permissions": [
                "team:people:view"
            ],
            "uuid": "f8ad39e1-053b-4bce-b0f1-1564df7b5c9f"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Modify Role

    Modify Role

    curl 'https://api.runscope.com/teams/<team_id>/roles/<role_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"permissions":["team:people:view","team:usage:view","bucket:tests:view","team:secrets:view"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example. See the example POST body for creating a role.

    Modify Role Sample PUT Body(JSON) for Modify Role

    {
        "permissions": [
            "team:people:view",
            "team:usage:view",
            "bucket:tests:view",
            "team:secrets:view"
        ]
    }
    

    Response 200 OK

    {
        "data": {
            "name": "Viewer",
            "permissions": [
                "team:people:view",
                "team:usage:view",
                "bucket:tests:view",
                "team:secrets:view"
            ],
            "uuid": "f8ad39e1-053b-4bce-b0f1-1564df7b5c9f"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Update the permissions of a role by making a PUT request with a JSON body of the environment details.

    Returns the updated details of the role.

    Delete a Role

    Delete Role

    curl 'https://api.runscope.com/teams/<team_id>/roles/<role_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete a role.

    Returns a 204 if the role is successfully deleted.

    Assign Role

    Assign Role

    curl 'https://api.runscope.com/teams/<team_id>/people' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"role_uuid":"5d5435cf-5f9f-47a8-bbd3-2de7bc213758","user_uuids":["9512d659-32c3-4c21-9128-55168fa4e306","a3f5fdc2-049a-451a-8934-b20fd82733af"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example. See the example POST body for creating a role.

    Assign Role Sample PUT Body(JSON) for Assign Role

    {
        "role_uuid": "5d5435cf-5f9f-47a8-bbd3-2de7bc213758",
        "user_uuids": [
            "9512d659-32c3-4c21-9128-55168fa4e306",
            "a3f5fdc2-049a-451a-8934-b20fd82733af"
        ]
    }
    

    Response 200 OK

    Assign a role to a list of team members (by ID) by making a PUT request with a JSON body of the environment details.

    Returns a 200 in case of success.

    Create a Group

    Create a Group

    curl 'https://api.runscope.com/teams/<team_id>/groups' \
        -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"name": "My New Team Group"}'
    

    Create a new group by POSTing a JSON body with the role details.

    Returns the details of the new group.

    Create Group Request Attributes

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Create a Group Sample POST Body(JSON) for Create a Group

    {
        "name": "My New Team Group"
    }
    

    Response 201 CREATED

    {
        "data": {
            "bucket_keys": null,
            "name": "My New Team Group",
            "user_count": 0,
            "users": null,
            "uuid": "5011528b-4a90-47ba-ab13-9437c8f828b8"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Group Details

    Group Details

    curl 'https://api.runscope.com/teams/<team_id>/groups/<group_id>' \
        -H 'Authorization: Bearer <access_token>'
    

    Retrieve the details of a given group by ID.

    Returns a single group resource.

    Group Details Response Attributes

    Response 200 OK

    {
        "data": {
            "bucket_keys": [
                "clnhxhzt78zv"
            ],
            "name": "My New Team Group",
            "user_count": 1,
            "users": [
                {
                    "email": "hyunji@runscope.com",
                    "name": "Hyunji Kim",
                    "uuid": "c146cfcc-686a-42b6-97e9-3d4f3c3a3493"
                }
            ],
            "uuid": "5011528b-4a90-47ba-ab13-9437c8f828b8"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Attributes

    Modify Group

    Modify Group

    curl 'https://api.runscope.com/teams/<team_id>/groups/<group_id>' \
        -X PUT \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer <access_token>' \
        -d '{"bucket_keys":["rtedbn4shvno","clnhxhzt78zv"],"user_uuids":["9512d659-32c3-4c21-9128-55168fa4e306","a3f5fdc2-049a-451a-8934-b20fd82733af"]}'
    

    The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

    Modify Group Sample PUT Body (JSON) for Modify Group

    {
        "bucket_keys": [
            "rtedbn4shvno",
            "clnhxhzt78zv"
        ],
        "user_uuids": [
            "9512d659-32c3-4c21-9128-55168fa4e306",
            "a3f5fdc2-049a-451a-8934-b20fd82733af"
        ]
    }
    

    Response 200 OK

    {
        "data": {
            "bucket_keys": [
                "clnhxhzt78zv"
            ],
            "name": "My New Team Group",
            "user_count": 1,
            "users": [
                {
                    "email": "hyunji@runscope.com",
                    "name": "Hyunji Kim",
                    "uuid": "c146cfcc-686a-42b6-97e9-3d4f3c3a3493"
                }
            ],
            "uuid": "5011528b-4a90-47ba-ab13-9437c8f828b8"
        },
        "error": null,
        "meta": {
            "status": "success"
        }
    }
    

    Update the bucket keys and/or users in a team group by making a PUT request with a JSON body of the group details.

    Returns the updated details of the group.

    Delete a Group

    Delete Group

    curl 'https://api.runscope.com/teams/<team_id>/groups/<group_id>' \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>'
    

    Response 204 NO CONTENT

    Delete a group.

    Returns a 204 if the group is successfully deleted.

    Usage

    Get the usage for a specific bucket or team.

    Bucket Request Count

    Bucket Request Count

    curl 'https://api.runscope.com/buckets/<bucket_key>/requests' \
        -H 'Authorization: Bearer <access_token>'
    

    This endpoint will fetch the request usage metrics that were executed by all the tests of the given bucket by key for the last day, by default.

    Bucket Request Count Query Parameters

    Parameters

    Bucket Request Count Response Attributes

    Response 200 OK

    {
        "meta": {
            "status": "success"
        },
        "data": {
            "requests_count": 3063237,
            "bucket_key": "61ti2ptvktsg",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
        },
        "error": null
    }
    

    Attributes

    Team Request Count

    Team Request Count

    curl 'https://api.runscope.com/team/<team_id>/requests' \
        -H 'Authorization: Bearer <access_token>'
    

    This endpoint will fetch the request usage metrics that were executed by all the tests of the given team for the last day, by default.

    Team Request Count Query Parameters

    Parameters

    Team Request Count Response Attributes

    Response 200 OK

    {
      "meta": {
        "status": "success"
      },
      "data": {
        "team_uuid": "3c7112ad-ff92-4d54-83c5-2d088706116e",
        "requests_count": 1817949,
        "from_date": "2019-11-14",
        "to_date": "2019-11-15",
        "creator_name": "Sam Aybar",
        "creator_email": "sam@runscope.com",
        "creator_id": "5d859a7d-8a97-4c8a-b4b8-b2125ea0fb00",
        "buckets": [
          {
            "requests_count": 1622360,
            "bucket_key": "61ti2ptvktsg",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 181307,
            "bucket_key": "bobnzrp9z8ub",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 12796,
            "bucket_key": "zqcah3ebn1ku",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 928,
            "bucket_key": "h0op5nyvkt91",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 547,
            "bucket_key": "b0vjn2xjjkol",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 10,
            "bucket_key": "iqt75w0wd989",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 1,
            "bucket_key": "x28c0km6c21g",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          },
          {
            "requests_count": 0,
            "bucket_key": "ljwc8zc1aeda",
            "from_date": "2019-11-14",
            "to_date": "2019-11-15"
          }
        ]
      },
      "error": null
    }
    

    Attributes