Create tests

Create one or more tests in this bucket.

This API returns test details for the new test with a 201 CREATED status if the test is successfully created. See the Test detail response.

Create 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.

Create tests
Sample POST body (JSON) for single test

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

Create 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.

Create tests
Sample POST body (JSON) for multiple tests

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

Create tests data attributes

Attributes

  • namestring

    The name of this test

  • descriptionstring

    description

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