# Testany Platform API reference

Testany API provides programmatic access to our testing platform, enabling users to automate testing workflows, manage test executions, and retrieve test results with ease.

Version 2.1.0. Each group below is a Markdown file with its operations, parameters, request and response bodies, and the schemas they use. Full OpenAPI specification: https://docs.testany.io/api/openapi.yaml.

**Base URLs**

- `https://{tenant}.testany.com.cn/api/v2`: Your dedicated tenant
- `https://app.testany.com.cn/api/v2`: Multi-tenant shared environment

**Authentication**

- HTTP bearer (JWT): JWT token for authentication. Please use the token provided in the response of the login API.

## Groups

- [Case Management](https://docs.testany.io/api/reference/case-management.md) (31 operations): Manage and retrieve metadata related to individual test cases within the platform.
- [Pipeline Management](https://docs.testany.io/api/reference/pipeline-management.md) (20 operations): Access and operate on test pipelines, including creation, reading, updates, and deletion.
- [Execution Management](https://docs.testany.io/api/reference/execution-management.md) (9 operations): Control and monitor the execution of test cases and pipelines, including results tracking.
- [Workspace Management](https://docs.testany.io/api/reference/workspace-management.md) (10 operations): Manage workspace configurations, resources, and settings within the platform.
- [Plan Management](https://docs.testany.io/api/reference/plan-management.md) (7 operations): Define, manage, and schedule test executions on the platform.
- [User Management](https://docs.testany.io/api/reference/user-management.md) (21 operations): Handle user accounts, roles, and permissions for secure and organized access to platform features.
- [Metering Query](https://docs.testany.io/api/reference/metering-query.md) (4 operations): Retrieve metering data, providing insights into usage statistics across workspaces and tenants.
- [Gatekeeper Management](https://docs.testany.io/api/reference/gatekeeper-management.md) (6 operations): Set up and manage gatekeepers for triggering pipeline executions under specified conditions.
- [Internal API](https://docs.testany.io/api/reference/internal-api.md) (11 operations): Internal functionalities for platform operations and service-to-service interactions.
- [Authorization Management](https://docs.testany.io/api/reference/authorization-management.md) (4 operations): Validate and manage user permissions and access control for platform operations.
- [Tenant Management](https://docs.testany.io/api/reference/tenant-management.md) (8 operations): APIs dedicated to tenant-level management, enabling administrators to oversee tenant configurations, billing & credit info, and resource allocation.
- [Testany Secrets Service Management](https://docs.testany.io/api/reference/testany-secrets-service-management.md) (16 operations): Securely manage sensitive secrets and credentials within the platform's secrets service.
- [Partner Management](https://docs.testany.io/api/reference/partner-management.md) (5 operations): Manage partner configurations and integrations within the platform.
- [NG Management APIs](https://docs.testany.io/api/reference/ng-management-apis.md) (2 operations): Perform administrative tasks at the global level for Notification Gateway.
- [NG Receiver APIs](https://docs.testany.io/api/reference/ng-receiver-apis.md) (7 operations): APIs to manage receivers, including configuration and notification settings.
- [NG Rule APIs](https://docs.testany.io/api/reference/ng-rule-apis.md) (4 operations): Manage rules of the notifications
- [NG Utility APIs](https://docs.testany.io/api/reference/ng-utility-apis.md) (2 operations): Utility functions to support miscellaneous operational needs within the Notification Gateway Service.
- [Directory View Management APIs](https://docs.testany.io/api/reference/directory-view-management-apis.md) (7 operations): APIs to manage directory views within the platform.

## Standard error responses

Shared responses that operations refer to by name (shown next to the status code) instead of repeating them.

| Name | Description | Body |
| --- | --- | --- |
| 400 | Bad request, parameters issue maybe? | object with `GenericError` (`application/json`) |
| 401 | Unauthorized. Requesting resources without valid authorization context. | object with `GenericError` (`application/json`) |
| 403 | Forbidden. Requesting resources without sufficient permissions. | object with `GenericError` (`application/json`) |
| 404 | Not found. Requesting resources is not exist. | object with `GenericError` (`application/json`) |
| 405 | Method not allowed. The method is not supported for the requested URL. | object with `GenericError` (`application/json`) |
| 406 | Not acceptable. The MIME type of the request is not supported. | object with `GenericError` (`application/json`) |
| 409 | Conflict. The request could not be completed due to a conflict with the current state of the resource. | object with `GenericError` (`application/json`) |
| 410 | Resource unavailable. Requesting resources was marked as deleted. | object with `GenericError` (`application/json`) |
| 429 | Too many requests | object with `GenericError` (`application/json`) |
| 500 | Internal server exceptions | object with `GenericError` (`application/json`) |
| 503 | Service unavailable | object with `GenericError` (`application/json`) |
| UnauthorizedResponse | Unauthorized (401) | object with `code`, `message` (`application/json`) |
| BadRequestResponse | Bad Request (400) | object with `code`, `message`, `reason`, `details` (`application/json`) |
| NotFoundResponse | Not Found (404) | object with `code`, `message`, `reason`, `details` (`application/json`) |
| MethodNotAllowedResponse | Method Not Allowed (405) | object with `code`, `message` (`application/json`) |
| ForbiddenResponse | You're not allowed to {$action} {$resource_key} yet. | object with `code`, `message`, `reason`, `details` (`application/json`) |
| TooManyRequestsResponse | Too Many Requests (429) | object with `code`, `message` (`application/json`) |
| UnsupportedMediaTypeResponse | Unsupported Media Type (415) | object with `code`, `message` (`application/json`) |
| NotAcceptableResponse | Not Acceptable (406) | object with `code`, `message` (`application/json`) |
| ConflictResponse | Conflict (409) | object with `code`, `message`, `reason`, `details` (`application/json`) |
| DefaultResponse | A fallback error response for undefined errors | object with `code`, `message` (`application/json`) |
| default | fallback error | object with `GenericError` (`application/json`) |
