Requirements
How to work with requirements using the public API
The requirements endpoints let you retrieve and manage the requirements that test cases link to within a project. Requirements help track traceability between test cases and external specifications, user stories, or other documentation.
About Requirements
Requirements are references to external documentation or specifications that test cases are designed to verify. They consist of:
- Text: A descriptive label for the requirement (1–255 characters)
- URL (optional): A link to the external requirement document or issue tracker
Requirements can be linked to multiple test cases, and a single test case can be linked to multiple requirements. This enables full traceability between your tests and the specifications they validate.
- Requirements can be linked to external issues when a Jira or Linear integration is configured for the project
- Use
include=tcaseCountto see how many test cases are linked to each requirement - Requirements without any linked test cases are still returned in the list
List Requirements
/paginated endpoints are transitional. In API v1, the base paths will return paginated responses and the /paginated suffix will be removed.
Retrieves all requirements within a project, optionally sorted and with additional fields included.
Path Parameters
project_id: The project identifier (can be either the project code or UUID)
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: created_at or text. | text | sortField=text |
sortOrder | string | Sort direction for sortField: asc or desc. | asc | sortOrder=asc |
include | string | Include additional fields omitted by default. Accepted value: tcaseCount. | None | include=tcaseCount |
- Use
include=tcaseCountto see how many test cases are linked to each requirement - Sorting by
created_atshows the most recently created requirements first (withdesc) or oldest first (withasc) - Sorting by
textprovides alphabetical ordering
Example Request
Fetch all requirements
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement/paginatedFetch all requirements sorted by text in ascending order
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement/paginated?sortField=text&sortOrder=asc"Fetch all requirements with test case count included
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement/paginated?include=tcaseCount"Response Fields
{
total: number // Number of matching requirements across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: Array<{ // Requirements in this page
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
integrationLink: { // Jira or Linear issue linked to the requirement, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the requirement in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
tcaseCount?: number // Number of test cases linked to this requirement; only with `include=tcaseCount`
}>
}Example Response
{
"total": 3,
"offset": 0,
"limit": 100,
"data": [
{
"id": "1CKgJ5HMU_1VQTDrRJDdDVW",
"text": "User Authentication",
"url": "https://docs.example.com/specs/auth",
"integrationLink": null,
"tcaseCount": 5
},
{
"id": "1CKgJ5HMU_2BJje4hdXZHag",
"text": "PROJ-456: Implement password reset functionality",
"url": "https://jira.example.com/browse/PROJ-456",
"integrationLink": {
"type": "jira",
"integrationId": "1CTPNLhFU_rPbCr23CbqftL",
"issueId": "10456",
"issueTitle": "Implement password reset functionality",
"issueUrl": "https://jira.example.com/browse/PROJ-456",
"remoteLinkId": "12345"
},
"tcaseCount": 3
},
{
"id": "1CKgJ5HMU_3apSDSQWRw6Ys",
"text": "Performance Requirements",
"url": "",
"integrationLink": null,
"tcaseCount": 0
}
]
}Get Requirement
Returns one requirement, in the shape of a List Requirements item, with tcaseCount always included.
Response
Status: 200 OK
{
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
integrationLink: { // Jira or Linear issue linked to the requirement, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the requirement in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
tcaseCount: number // Number of test cases linked to this requirement
}Example Response
{
"id": "1CKgJ5HMU_2BJje4hdXZHag",
"text": "PROJ-456: Implement password reset functionality",
"url": "https://jira.example.com/browse/PROJ-456",
"integrationLink": {
"type": "jira",
"integrationId": "1CTPNLhFU_rPbCr23CbqftL",
"issueId": "10456",
"issueTitle": "Implement password reset functionality",
"issueUrl": "https://jira.example.com/browse/PROJ-456",
"remoteLinkId": "12345"
},
"tcaseCount": 3
}Create Requirement
Creates a requirement. Update Test Case Requirements also creates missing requirements while linking them to test cases.
Request Body
{
text: string // Title of the requirement (1–255 characters), unique in the project
url?: string // URL of the requirement (http or https, max 255 characters)
integrationIssueId?: string // Issue to link the requirement to in the project's Jira or Linear integration
}integrationIssueId: ID or key of an issue in the project's Jira or Linear integration. QA Sphere stores the value sent (asissueId), the issue's title and URL in the requirement'sintegrationLinkand adds a link back to the requirement on the issue. It is ignored when the project has no Jira or Linear integration. If the issue cannot be fetched, the requirement is not created: the response is400 Bad Requestfor an issue that doesn't exist, and otherwise has the status the integration endpoints return when the tracker refuses a request.
Response
Status: 201 Created
The created requirement, as Get Requirement returns it.
Errors
| Status Code | Description |
|---|---|
| 409 | A requirement with the same text exists |
Update Requirement
Changes a requirement's label, URL or issue link. Test cases linked to it show the change, without a new version.
Request Body
{
text?: string // New title (1–255 characters), unique in the project
url?: string // New URL; "" clears it
integrationIssueId?: string // Issue to link instead, as in Create Requirement; "" removes the link
}Omitted fields are left unchanged. Changing or removing the issue link also removes the link back to the requirement from the old issue.
integrationIssueId: If the new issue can't be fetched, or the link back can't be added to it, the update fails and the requirement is left unchanged. Sending the value already inintegrationLink.issueIdchanges nothing, while naming the same issue another way (its ID instead of its key) re-creates the link back. When the project has no Jira or Linear integration,""still removes the link from the requirement (the old issue keeps its link back), and any other value is ignored.
Response
Status: 200 OK
The updated requirement, as Get Requirement returns it.
Errors
| Status Code | Description |
|---|---|
| 409 | A requirement with the same text exists |
Delete Requirement
Deletes a requirement.
Irreversible
Deleted requirements don't go to the trash and can't be restored. A requirement is unlinked from every test case, in every version, and its link is removed from the Jira or Linear issue.
Response
Status: 200 OK
{
message: string
}List Requirements (Deprecated)
Deprecated
This endpoint is deprecated. Use List Requirements (GET /api/public/v0/project/{project_id}/requirement/paginated) instead.
Retrieves all requirements within a project, optionally sorted and with additional fields included.
Path Parameters
project_id: The project identifier (can be either the project code or UUID)
Query Parameters
All query parameters are optional.
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
sortField | string | Field to sort by: created_at or text. | text | sortField=text |
sortOrder | string | Sort direction for sortField: asc or desc. | asc | sortOrder=asc |
include | string | Include additional fields omitted by default. Accepted value: tcaseCount. | None | include=tcaseCount |
- Use
include=tcaseCountto see how many test cases are linked to each requirement - Sorting by
created_atshows the most recently created requirements first (withdesc) or oldest first (withasc) - Sorting by
textprovides alphabetical ordering
Example Request
Fetch all requirements
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirementFetch all requirements sorted by text in ascending order
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement?sortField=text&sortOrder=asc"Fetch all requirements with test case count included
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement?include=tcaseCount"Response Fields
{
requirements: Array<{ // List of requirement objects
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
integrationLink: { // Jira or Linear issue linked to the requirement, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the requirement in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
tcaseCount?: number // Number of test cases linked to this requirement; only with `include=tcaseCount`
}>
}Example Response
{
"requirements": [
{
"id": "1CKgJ5HMU_1VQTDrRJDdDVW",
"text": "User Authentication",
"url": "https://docs.example.com/specs/auth",
"integrationLink": null,
"tcaseCount": 5
},
{
"id": "1CKgJ5HMU_2BJje4hdXZHag",
"text": "PROJ-456: Implement password reset functionality",
"url": "https://jira.example.com/browse/PROJ-456",
"integrationLink": {
"type": "jira",
"integrationId": "1CTPNLhFU_rPbCr23CbqftL",
"issueId": "10456",
"issueTitle": "Implement password reset functionality",
"issueUrl": "https://jira.example.com/browse/PROJ-456",
"remoteLinkId": "12345"
},
"tcaseCount": 3
},
{
"id": "1CKgJ5HMU_3apSDSQWRw6Ys",
"text": "Performance Requirements",
"url": "",
"integrationLink": null,
"tcaseCount": 0
}
]
}