Tests API

The Tests API allows you to create, retrieve, update, and delete tests associated with acceptance criteria. Tests provide structured procedures for verifying that acceptance criteria have been met.

The Test Object

  • Name
    id
    Type
    string
    Description

    Unique identifier for the test.

  • Name
    name
    Type
    string
    Description

    The name of the test.

  • Name
    description
    Type
    string
    Description

    A detailed description of what the test verifies.

  • Name
    status
    Type
    string
    Description

    Current status of the test. One of: pending, passed, failed, skipped.

  • Name
    criterionId
    Type
    string
    Description

    ID of the acceptance criterion this test verifies.

  • Name
    testSections
    Type
    array
    Description

    Array of test sections containing functions and criteria.

  • Name
    createdAt
    Type
    timestamp
    Description

    Timestamp of when the test was created.

  • Name
    updatedAt
    Type
    timestamp
    Description

    Timestamp of when the test was last updated.

GET/api/v2/tests

List tests for a criterion

This endpoint allows you to retrieve all tests associated with a specific acceptance criterion.

Query Parameters

  • Name
    criterionId
    Type
    string
    Required
    Description

    The ID of the criterion to retrieve tests for.

Response

Returns an array of test objects associated with the specified criterion.

cURL

curl https://api.tanda.app/api/v2/tests?criterionId=crit_123 \
  -H "Authorization: Bearer {token}"

Response

[
  {
    "id": "test_123",
    "name": "User Login Test",
    "description": "Verify that users can log in with valid credentials",
    "status": "pending",
    "criterionId": "crit_123",
    "createdAt": "2025-05-25T12:00:00Z",
    "updatedAt": "2025-05-25T12:00:00Z"
  }
]

GET/api/v2/tests/{testId}

Retrieve a test

This endpoint allows you to retrieve a single test by its ID.

Path Parameters

  • Name
    testId
    Type
    string
    Required
    Description

    The ID of the test to retrieve.

Response

Returns the test object if found.

cURL

curl https://api.tanda.app/api/v2/tests/test_123 \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "test_123",
  "name": "User Login Test",
  "description": "Verify that users can log in with valid credentials",
  "status": "pending",
  "criterionId": "crit_123",
  "createdAt": "2025-05-25T12:00:00Z",
  "updatedAt": "2025-05-25T12:00:00Z"
}

GET/api/v2/tests/{testId}/sections

Get test sections

This endpoint retrieves the hierarchical structure of test sections, functions, and criteria for a specific test.

Path Parameters

  • Name
    testId
    Type
    string
    Required
    Description

    The ID of the test to retrieve sections for.

Response

Returns an array of test sections with nested functions and criteria.

cURL

curl https://api.tanda.app/api/v2/tests/test_123/sections \
  -H "Authorization: Bearer {token}"

Response

[
  {
    "id": "sect_123",
    "testId": "test_123",
    "name": "Authentication",
    "description": "Test user authentication",
    "orderIndex": 1,
    "functions": [
      {
        "id": "func_123",
        "sectionId": "sect_123",
        "name": "Login Function",
        "description": "Test login functionality",
        "orderIndex": 1,
        "criteria": [
          {
            "id": "crit_123",
            "functionId": "func_123",
            "description": "User can login with valid credentials",
            "expectedResult": "Successful authentication",
            "actualResult": null,
            "passed": false,
            "orderIndex": 1
          }
        ]
      }
    ]
  }
]

POST/api/v2/tests

Create a test

This endpoint allows you to create a new test for an acceptance criterion.

Request Body

  • Name
    name
    Type
    string
    Required
    Description

    The name of the test.

  • Name
    description
    Type
    string
    Description

    A detailed description of what the test verifies.

  • Name
    criterionId
    Type
    string
    Required
    Description

    The ID of the criterion this test verifies.

  • Name
    status
    Type
    string
    Description

    Initial status of the test. Defaults to pending.

Response

Returns the created test object.

cURL

curl -X POST https://api.tanda.app/api/v2/tests \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "User Login Test",
    "description": "Verify that users can log in with valid credentials",
    "criterionId": "crit_123"
  }'

Response

{
  "id": "test_456",
  "name": "User Login Test",
  "description": "Verify that users can log in with valid credentials",
  "status": "pending",
  "criterionId": "crit_123",
  "createdAt": "2025-05-25T12:00:00Z",
  "updatedAt": "2025-05-25T12:00:00Z"
}

PUT/api/v2/tests/{testId}

Update a test

This endpoint allows you to update an existing test.

Path Parameters

  • Name
    testId
    Type
    string
    Required
    Description

    The ID of the test to update.

Request Body

  • Name
    name
    Type
    string
    Description

    The updated name of the test.

  • Name
    description
    Type
    string
    Description

    The updated description.

  • Name
    status
    Type
    string
    Description

    The updated status. One of: pending, passed, failed, skipped.

Response

Returns the updated test object.

cURL

curl -X PUT https://api.tanda.app/api/v2/tests/test_123 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "passed"
  }'

Response

{
  "id": "test_123",
  "name": "User Login Test",
  "description": "Verify that users can log in with valid credentials",
  "status": "passed",
  "criterionId": "crit_123",
  "createdAt": "2025-05-25T12:00:00Z",
  "updatedAt": "2025-05-25T13:00:00Z"
}

DELETE/api/v2/tests/{testId}

Delete a test

This endpoint allows you to delete a test.

Path Parameters

  • Name
    testId
    Type
    string
    Required
    Description

    The ID of the test to delete.

Response

Returns a success message if the test was deleted.

cURL

curl -X DELETE https://api.tanda.app/api/v2/tests/test_123 \
  -H "Authorization: Bearer {token}"

Response

{
  "message": "Test deleted successfully"
}

GET/api/sow/{sowId}

Enhanced SOW endpoint

The SOW detail endpoint has been enhanced to include tests and test sections in the response.

Path Parameters

  • Name
    sowId
    Type
    string
    Required
    Description

    The ID of the SOW to retrieve.

Response

Returns the SOW object with nested items (requirements and task items), criteria, tests, and test sections.

cURL

curl https://api.tanda.app/api/sow/sow_123 \
  -H "Authorization: Bearer {token}"

Response

{
  "sow": {
    "id": "sow_123",
    "title": "Project SOW",
    "items": [
      {
        "id": "item_123",
        "title": "User Authentication",
        "type": "task_item",
        "criteria": [
          {
            "id": "crit_123",
            "content": "User can login with valid credentials",
            "tests": [
              {
                "id": "test_123",
                "name": "User Login Test",
                "status": "pending"
              }
            ]
          }
        ]
      }
    ],
    "tests": [
      {
        "id": "test_123",
        "name": "User Login Test",
        "testSections": [
          {
            "id": "sect_123",
            "name": "Authentication",
            "functions": [
              {
                "id": "func_123",
                "name": "Login Function",
                "criteria": [
                  {
                    "id": "crit_123",
                    "description": "User can login with valid credentials"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

Error Responses

The API uses standard HTTP status codes to indicate success or failure:

  • 200 OK - Request succeeded
  • 201 Created - Resource created successfully
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Missing or invalid authentication
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource not found
  • 500 Internal Server Error - Server error

Error responses include a descriptive message:

{
  "error": "Test not found"
}

Was this page helpful?