NAV Navbar
Home 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
  • 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

    Parameter Description
    client_id The Client ID of your application

    required

    redirect_uri The Callback URL of your application. After authorizing your application a redirect will be made to this URL with an authorization code.

    required

    response_type The desired grant type, as per the OAuth 2.0 spec. The only current valid value is response_type=code

    required

    scope A space separated list of scopes. Valid scopes are listed below.
    state An unguessable random string. This state will be sent back to your application's Callback URL. It should be used to protect against cross-site request forgery attacks on your application.

    Available Scopes

    Scope Description
    api:read The Client ID of your application

    required

    bucket:auth_token Default read access. Allows you to see most of the user's account information including message streams and buckets. Authenticated buckets are not included and require the bucket:auth_token scope.

    Since a bucket key is all you need to make requests, this permission allows you to create messages in the user's account by creating a Gateway URL from their bucket key. To create messages via the API directly, request the message:write scope.
    bucket:write Allows you to read all bucket information, including Authenticated Buckets.
    message:write Allows you to create new buckets on behalf of the user (up to their plan limit).
    account:email Allows you to read the email addresses of user accounts.
    team:read Allows you to read team details such as lists of team members and external service integrations.
    test:read Allows you to read the details of API tests.
    test:write Allows you to update and delete details of API tests.

    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

    Parameter Description
    client_id The Client ID of your application

    required

    client_secret The Client Secret of the application.

    required

    code The code you received in your Callback URL.

    required

    grant_type The only valid value is authorization_code.

    required

    redirect_uri The Callback URL specified for this application.

    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

    Attribute Description
    bucket_list_url

    string

    The URL for this account's list of buckets. See Bucket List.
    current_account_url

    string

    The URL for this account's detail resource. See Account.

    Other Resources

    Steps

    string

    Create, reorder and modify test steps.
    Environments

    string

    Create and modify test and shared environments.
    Schedules

    string

    Create and modify the scheduling of tests.
    Results

    string

    View the results of test runs.
    Account Information about the authorized account.
    Buckets Details for the buckets available to the authorized account.
    Integrations Details for the 3rd-party connected services.
    Regions Information about the available Service Regions.
    Teams Information about the members of a team.

    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

    Parameter Description
    count

    integer

    Maximum number of tests to return. Defaults to 10 if not specified.
    offset

    integer

    Number of tests to skip when retrieving tests.

    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"
        }
    ]
    

    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"
        }
    }
    

    Create one or more tests in this bucket.

    Creating Tests Data Attributes

    Attribute Description
    name

    string

    Name of this test.
    description

    string

    Human-readable description of the new test.

    Test Detail

    Test Detail

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

    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"
        }
    }
    

    Retrieve the details of a given test by ID.

    Test Detail Response Attributes

    Attribute Description
    id

    string

    The unique identifier for the test.
    name

    string

    The name of the test.
    description

    string

    Long-form description of the test.
    default_envrionment_id

    string

    The default environment for the test.
    steps

    array

    An ordered list of the steps for the test.
    environments

    array

    A list of environments for the test.
    schedules

    array

    A list of schedules for the test.

    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"}'
    

    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"
        }
    }
    

    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

    Attribute Description
    name

    string

    The name of the test.
    description

    string

    Long-form description of the test.
    default_environment_id

    string

    The default environment for the test.
    steps

    array

    An ordered list of the steps for the test.

    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 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 POST body must be a JSON object.

    Adding Request Steps Request Attributes

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

    Attribute Description
    step_type

    string

    Always set to request.
    url

    string

    The URL to make a request to for this step. This may contain both query string parameters and variables.
    method

    string

    The HTTP method for this request step.
    note

    string

    A description or note for this request step.
    auth

    object

    An authentication object with either basic, oauth1, or client_certificate credentials for authenticating this request.
    headers

    object

    An object with keys as header names matched to their values. Values can either be a single string or an array of strings.
    form

    object

    An object with keys as form post parameter names matched to their values. Values can either be a single string or an array of strings.
    body

    string

    A string to use as the body of the request.
    assertions

    array

    A list of assertions to apply to the HTTP response from this request.
    variables

    array

    A list of variables to extract out of the HTTP response from this request.
    scripts

    array

    A list of post-response scripts to run after this request.
    before_scripts

    array

    A list of pre-request scripts to run before this request.

    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 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 Pause Step Sample POST Body(JSON) for Pause Step

    {
        "step_type": "pause",
        "duration": 5
    }
    

    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": "pause",
                    "duration": 5
                }
            ],
            "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 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.

    Attribute Description
    step_type

    string

    Always set to pause.
    duration

    integer

    This is the duration of the pause step in seconds. It must be an integer between 1 and 120.

    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 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 POST body must be a JSON object.

    Adding Condition Steps Request Attributes

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

    Attribute Description
    id

    string

    The unique ID for this test.
    step_type

    string

    Always set to condition.
    comparison

    string

    An assertion comparison to determine whether or not to execute the embedded steps.
    left_value

    string

    The left hand value of the assertion.
    right_value

    string

    The right-hand side value of the assertion, if one is required.
    steps

    array

    An array of test steps to execute if the comparison evaluates successfully.

    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 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 POST body must be a JSON object.

    Adding Ghost Inspector Steps Data Attributes

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

    Attribute Description
    step_type

    string

    Always set to ghost-inspector.
    integration_id

    string

    The id of an account integration with Ghost Inspector as found in the team integrations list.
    suite_id

    string

    The Ghost Inspector suite id of the test to run. You can find this in the Ghost Inspector API.
    test_id

    string

    The Ghost Inspector test id of the test to run. You can find this in the Ghost Inspector API.
    start_url

    string

    A custom Start URL for the Ghost Inspector test to execute with.
    assertions

    array

    A list of assertions to apply to the incoming webhook result from Ghost Inspector.
    variables

    array

    A list of variables to extract out of the incoming webhook result from Ghost Inspector.

    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 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 POST body must be a JSON object.

    Adding Subtest Steps Data Attributes

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

    Attribute Description
    test_uuid

    string

    The embedded test's unique id.
    step_type

    string

    Always set to subtest.
    environment_uuid

    string

    The environment uuid to run with the subtest.
    bucket_key

    string

    The bucket key to which the subtest belongs.
    assertions

    array

    A list of assertions to apply to the incoming subtest result.
    variables

    array

    A list of variables to extract out of the incoming subtest result.
    params

    array

    A list of key value pairs to pass to the subtest at runtime. This is a way to pass variables extracted in the parent test to the subtest.

    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

    Source Description
    response_status Assert on the value of the HTTP status code from the Response.
    response_headers Assert on the value of a Response Header. You must include a Property with the header name to assert on.
    response_json Parse the response body as JSON. You must include a Property with the JSON path to assert on.
    response_xml Parse the response body as XML. You must include a Property with the XPath to assert on.
    response_text Parse the response body as plain text. This source does not specify a Property.
    response_time Assert on the execution time of the response in milliseconds.
    response_size Assert on the size of the Response body in bytes.

    Assertion Comparisons List

    Comparison Description
    equal A string equality check on the given property and value.
    empty The given value is an empty string.
    not_empty The given value is not an empty string.
    not_equal The given string property is not equal to the given string value.
    contains The given string value is found in the given property.
    does_not_contain The given string value is not found in the given property.
    is_a_number The source property can be converted to a numeric value. This comparison does not take a value.
    equal_number The source property is numerically equal to the given value. This comparison ensures the values are able to be converted to numbers.
    is_less_than The given property is numerically less than the given value.
    is_less_than_or_equal The given property is numerically less than or equal to the given value.
    is_greater_than The given property is numerically greater than the given value.
    is_greater_than_or_equal The given property is numerically greater than or equal to the given value.
    has_key The JSON property evaluates to an object and contains the given value as a key. Source must be response_json.
    has_value The JSON property evaluates to an array and contains the given value as an element. Source must be response_json
    is_null The JSON property has a NULL value. Source must be response_json.

    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

    Source Description
    response_status Create a variable from the value of the HTTP status code from the Response.
    response_headers Create a variable from the value of a Response Header. You must include a property with the name of the header to extract the value from.
    response_json Parse the response body as JSON. You must include a property with the JSON path to extract.
    response_xml Parse the response body as XML. You must include a property with the XPath to extract.
    response_text Parse the response body as plain text. This source does not specify a property.
    response_time Create a variable from the execution time of the response in milliseconds.
    response_size Create a variable from the size of the Response body in bytes.

    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>'
    

    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 environments for a test.

    Test Environment List Response Attributes

    Attribute Description
    id

    string

    The unique ID for this environment.
    name

    string

    The name for this environment.
    parent_environment_id

    string

    The parent environment to inherit from, applies only to test-specific environments.
    test_id

    string

    The test this environment is associated with, applies only to test-specific environments.
    retry_on_failure

    boolean

    If this is set to true, an additional test run will be triggered immediately after a failed scheduled test run.
    stop_on_failure

    boolean

    If this is set to true, test runs will stop executing after the first step that fails. All subsequent steps will be skipped.
    verify_ssl

    boolean

    If this is set to false, tests using this environment won't verify SSL certificates.
    client_certificate

    string

    Client certificate text available to be used in request authentication. PEM-encoded.
    preserve_cookies

    boolean

    If this is set to true, tests using this enviornment will manage cookies between steps.
    script

    string

    The initial script to run before starting tests using this environment.
    initial_variables

    object

    An object with the keys and values being used for variables when the test begins.
    regions

    array

    A list of Runscope regions to execute test runs in when using this environment.
    remote_agents

    array

    A list of remote agents to execute test runs in when using this environment.
    webhooks

    array

    A list of URL's to send results to when test runs using this environment finish.
    integrations

    array

    A list of integrations to enable for test runs using this environment.
    notify_on

    string

    Upon completion of a test run Runscope will send email notifications according to the following rules:
    • all — send an email for every test run completed
    • failures — send an email for every test run that fails
    • threshold — send an email only after notify_threshold failures
    • switch — send an email only after notify_threshold failures, and then once more when it begins passing again.
    notify_threshold

    integer

    An integer between 1 and 10 for use with the notify_on settings: threshold and switch
    notify_all

    boolean

    Send an email to all team members according to the notify_on rules.
    recipients

    array

    A list of team users to recieve emails according to the other settings.

    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>'
    

    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"
        }
    }
    

    Get the list of schedules for a test.

    Test Schedule List Response Attributes

    Attribute Description
    id

    string

    The unique ID for this schedule.
    note

    string

    A human-friendly description for the schedule.
    environment_id

    string

    The id of the environment to use when running the test.
    interval

    string

    The schedule's interval, must be one of:
    • 1m — every minute
    • 5m — every 5 minutes
    • 15m — every 15 minutes
    • 30m — every 30 minutes
    • 1h — every hour
    • 6h — every 6 hours
    • 1d — every day

    Schedule Details

    Schedule Details

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

    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"
        }
    }
    

    Get the details of a single test schedule.

    Schedule Details Response Attributes

    Attribute Description
    environment_id

    string

    The id of the environment to use when running the test.

    required

    interval

    string

    The schedule's interval (e.g. 1m, 5m, 15m, 30m, 1h, 6h, 1d).

    required

    note

    string

    A human-friendly description for the schedule.

    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"}'
    

    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"
        }
    }
    

    Create one or more tests in this bucket.

    Create Schedule Request Attributes

    Attribute Description
    note

    string

    A human-friendly description for the schedule.
    environment_id

    string

    The id of the environment to use when running the test.

    required

    interval

    string

    The schedule's interval, must be one of:

    required

    • 1m — every minute
    • 5m — every 5 minutes
    • 15m — every 15 minutes
    • 30m — every 30 minutes
    • 1h — every hour
    • 6h — every 6 hours
    • 1d — every day

    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"}'
    

    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"
        }
    }
    

    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

    Attribute Description
    note

    string

    A human-friendly description for the schedule.
    environment_id

    string

    The id of the environment to use when running the test.

    required

    interval

    string

    The schedule's interval, must be one of:

    required

    • 1m — every minute
    • 5m — every 5 minutes
    • 15m — every 15 minutes
    • 30m — every 30 minutes
    • 1h — every hour
    • 6h — every 6 hours
    • 1d — every day

    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>'
    

    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"
        }
    }
    

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

    Test Result List Request Parameters

    Attribute Description
    count

    integer

    Maximum number of test results to return. Defaults to 10 if not specified. Maximum value is 50
    since

    float

    Only return test results started after the given Unix timestamp.

    Exclusive

    before

    float

    Only return test results started before the given Unix timestamp.

    Exclusive

    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>'
    

    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"
        }
    }
    

    Retrieve the details of a given test run by ID.

    Test Result Detail Response Attributes

    Attribute Description
    agent

    string

    The ID of the agent used to execute this request. If a Runscope location was used, null.
    assertions_defined

    integer

    The total number of simple assertions (non-script) defined for all requests in this test run.
    assertions_failed

    integer

    The total number of simple assertions that failed for all requests in this test run.
    assertions_passed

    integer

    The total number of simple assertions that passed for all requests in this test run.
    bucket_key

    string

    The key for the bucket that contains the test that caused this test run.
    finished_at

    float

    The Unix timestamp representing when the test run completed.
    region

    string

    The region code for the Runscope location used to execute the test run. If an agent was used, null.
    uuid

    string

    The unique ID for the individual test step. Can be used with the Test Step Detail resource to retrieve full HTTP request and response details for request and incoming request steps.
    result

    string

    The aggregate result of variables, assertions, and scripts processed for this test run. Either pass (all passed) or fail (any failed).
    url

    string

    The URL that was used for this request.
    method

    string

    The HTTP method used for this request.
    assertions_defined

    integer

    The number of simple assertions (non-script) defined for this request.
    assertions_failed

    integer

    The number of simple assertions (non-script) that failed for this request.
    assertions_passed

    integer

    The number of simple assertions (non-script) that passed for this request.
    scripts_defined

    integer

    The number of scripts defined for this request.
    scripts_failed

    integer

    The number of scripts that failed for this request.
    scripts_passed

    integer

    The number of scripts that passed for this request.
    variables_defined

    integer

    The number of simple variables (non-script) defined for this request.
    variables_failed

    integer

    The number of simple variables (non-script) that failed for this request.
    variables_passed

    integer

    The number of simple variables (non-script) that passed for this request.
    result

    string

    The pass/fail result for this assertion.
    source

    string

    The data source for the assertion. Possible values are json, xml, response_headers, response_size_bytes, response_time_ms or status_code.
    property

    string

    The target property within the data source used to locate the actual value.
    comparison

    string

    The comparison used to compare the target and expected values. Possible values are equals, does_not_equal, is_empty, is_not_empty, greater_than_or_equal, greater_than, less_than_or_equal, less_than, equals_number, contains, does_not_contain, has_key or has_value.
    target_value

    string

    The value to compare against.
    actual_value

    string

    The actual value extracted during the test run.
    error

    string

    If the assertion failed, a description of the failure. If the assertion passed, null.
    result

    string

    The pass/fail result of the script.
    output

    string

    Any log output from the script execution
    error

    string

    Additional information if a script fails.
    dial_ms

    float

    Total time connecting to server in milliseconds.
    dns_lookup_ms

    float

    Total time for DNS lookup in milliseconds.
    receive_response_ms

    float

    Total time to receive response in milliseconds.
    send_body_ms

    float

    Total time to send request body in milliseconds.
    send_headers_ms

    float

    Total time to send headers in milliseconds.
    wait_for_response_ms

    float

    Total time waiting for response in milliseconds.
    result

    string

    The pass/fail result for this variable.
    source

    string

    The data source for the variable. Possible values are json, xml, response_headers, response_size_bytes, response_time_ms or status_code.
    property

    string

    A list of team users to recieve emails according to the other settings.
    requests_executed

    integer

    The number of requests executed in this test run.
    result

    string

    The overall result of the test run. Possible values are: pass, fail, working, canceled, or queued.
    scripts_defined

    integer

    The number of scripts defined across all requests in this test run.
    scripts_failed

    integer

    The number of scripts that didn't complete in this test run.
    scripts_passed

    integer

    The number of scripts that were successfully processed in this test run.
    started_at

    float

    The Unix timestamp representing the time the test run was initiated.
    test_run_id

    string

    The unique ID for this test run.
    test_id

    string

    The unique ID for this test.
    variables_defined

    integer

    The number of variables defined across all requests in this test run.
    variables_failed

    integer

    The number of variables that failed across all requests in this test run.
    variables_passed

    integer

    The number of variables that passed across all requests in this test run.

    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>'
    

    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"
        }
    }
    

    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

    Attribute Description
    uuid

    string

    The unique identifier (UUID) for this request/response pair.
    bucket_key

    string

    The bucket where this request step is stored.
    headers

    object

    The HTTP request headers as an object. The keys of this object are header names and the value is an array of values.
    host

    string

    The destination hostname of the HTTP request.
    method

    string

    The HTTP method of the request.
    params

    object

    Any querystring parameters in the request as an object. The keys of this object are parameter names, and the value is an array of values.
    path

    string

    The path portion of the HTTP request
    scheme

    string

    The scheme of the request. (http or https)
    timestamp

    float

    A unix timestamp representing the time the request was made. This is a floating point number that with microsecond granularity.
    body

    string

    A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded bodies.
    body_encoding

    string

    The encoding of the request.body. Either 'plaintext' or 'base64'.
    headers

    object

    The HTTP response headers as an object. The keys of this object are header names and the value is an array of values.
    status

    integer

    Integer status code for the HTTP response.
    reason

    string

    Text status reason that corresponds to response.status. e.g. - 'OK', 'Not Found', etc.
    size_bytes

    integer

    The size of the response body in bytes.
    timestamp

    float

    A unix timestamp representing the time the response was received. This is a floating point number that with microsecond granularity.
    body

    string

    A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded bodies.
    body_encoding

    string

    The encoding of the response.body. Either 'plaintext' or 'base64'.

    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

    Attribute Description
    region

    string

    The region code for the test service region you wish to get results from. E.g.: us1 for US Virginia location. Default value is all.
    timeframe

    string

    The timeframe you want to filter your results. Default value is day. Accepted values are hour, day, week, and month.
    environment_uuid

    string

    Filter the metrics results by a given environment ID. Default value is all.

    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'
    

    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"
        }
    }
    

    Information about the authorized account.

    Account Response Attributes

    Attribute Description
    name

    string

    The name of the person for this account.
    uuid

    string

    The unique identifier for this account.
    email

    string

    The email address for this account. Only present if authorized with the account:email scope.

    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>'
    

    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"
        }
    }
    

    Retrieve the details of a given bucket by key.

    Bucket Detail Response Attributes

    Attribute Description
    auth_token

    string

    Bucket auth token if set, otherwise this value is null.
    default

    boolean

    True if this bucket is the 'default' for a team. Default buckets cannot be deleted.
    key

    string

    The unique identitifer used to address a bucket.
    name

    string

    The name of this bucket as displayed in your dashboard.
    team

    object

    An object describing the team this bucket belongs to. Includes the name and uuid of the team.
    verify_ssl

    boolean

    True if this bucket is configured to verify ssl for requests made to it.

    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>'
    

    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"
        }
    }
    

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

    Creating a Bucket Request Parameters

    Attribute Description
    name

    string

    Name of this bucket.

    required

    team_uuid

    string

    Unique identifier for the team this to create this bucket for.

    required

    Creating a Bucket Response Attributes

    Attribute Description
    auth_token

    string

    Bucket auth token if set, otherwise this value is null
    default

    boolean

    True if this bucket is the 'default' for a team. Default buckets cannot be deleted.
    key

    string

    The unique identitifer used to address a bucket.
    name

    string

    The name of this bucket as displayed in your dashboard.
    team

    object

    An object describing the team this bucket belongs to. Includes the name and uuid of the team.
    verify_ssl

    boolean

    True if this bucket is configured to verify ssl for requests made to it.

    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>'
    

    Response 200 OK

    [
        {
            "email": "grace@example.com",
            "name": "Grace Hopper",
            "uuid": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9",
        },
        {
            "email": "ada@example.com",
            "name": "Ada Lovelace",
            "uuid": "84fa0764-ba80-4f0e-8e33-1ad12280f3f1"
        }
    ]
    

    Teams Response Attributes

    Attribute Description
    name

    string

    The name of the person.
    uuid

    string

    The unique identifier for this person's account.
    email

    string

    The email address for this account. Only present if authorized with the account:email scope.

    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

    Attribute Description
    uuid

    string

    The unique identifier for this integrated service instance.
    description

    string

    The human-friendly description of the integrated service instance.
    type

    string

    The external service type for this integrated service instance.

    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'
    

    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
    }
    

    Agents Response Attributes

    Attribute Description
    version

    string

    The version for this agent.
    agent_id

    string

    The unique identifier for this agent.
    name

    string

    The name of the agent set in the configuration file or with the command line flag.

    Role Based Access Control

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

    Available Permissions

    Permission Description
    team:billing:view View billing information for a team
    team:billing:modify Change billing information for a team
    team:people:view View all members of a team
    team:people:modify Add or delete team members
    team:people:invite Invite members to a team
    team:buckets:modify Change settings in buckets, delete buckets, change bucket names
    team:buckets:add Add new buckets
    team:gateway_agent:allow Authorize to sign in via the Gateway Agent
    team:radar_agent:allow Authorize to sign in via the Radar Agent
    team:connected_services:modify Add a connected service
    team:connected_services:delete Delete a connected service
    team:name:modify Change team name
    team:usage:view View team usage
    bucket:tests:view View all tests within a bucket
    bucket:tests:execute Run or cancel tests within a bucket
    bucket:tests:modify Create and edit tests within a bucket
    bucket:tests:delete Delete tests within a bucket
    bucket:tests:share Share the results of a test
    bucket:tests:schedule Add, modify, and delete test schedules within a bucket
    bucket:tests:export Download test exports within a bucket
    bucket:shared_environment:modify Add, modify, and delete shared environments within a bucket
    team:groups:view View group permissions and membership
    team:groups:modify Modify group permissions and membership
    team:script_library:delete Delete script libraries
    team:script_library:modify Modify script libraries
    team:secrets:view View the list of all sensitive variables
    team:secrets:modify Create, edit, and delete sensitive variables
    team:file_upload:modify Upload and delete files

    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

    Attribute Description
    name

    string

    Name of this role.
    permissions

    array

    A list of roles to add to this role.

    Role Details

    Role Details

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

    Response 200 OK

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

    Retrieve the details of a given role by ID.

    Returns a single role resource.

    Role Details Response Attributes

    Attribute Description
    name

    string

    The name of this role.
    permissions

    array

    A list of the allowed permissions for this role.
    uuid

    string

    The id of this role.

    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"}'
    

    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"
        }
    }
    

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

    Returns the details of the new group.

    Create Group Request Attributes

    Attribute Description
    name

    string

    Name of this group.

    Group Details

    Group Details

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

    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"
        }
    }
    

    Retrieve the details of a given group by ID.

    Returns a single group resource.

    Group Details Response Attributes

    Attribute Description
    bucket_keys

    array

    The list of bucket IDs attached to this group.
    name

    string

    The name of this group.
    user_count

    integer

    A count of the number of users tied to this group
    users

    array

    A list of user details tied to this group
    uuid

    string

    The id of this group.

    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.