Add a defect link to a case
const url = 'https://beta-api.plune.ai/v1/test-cases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/defects';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://tracker.example.com/browse/PLN-482","label":"Coupon is not applied on an empty cart"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/test-cases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/defects \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://tracker.example.com/browse/PLN-482", "label": "Coupon is not applied on an empty cart" }'The address of a ticket somebody already filed (#1064). https only, at most 2 000 characters, with an optional one-line label of text; at most 20 links on a case. No condition on the case: any case in the project takes one. The body is judged before the owner is looked up. Audited on the case as test_case/event, the address in the diff; not undone from the feed. A reader is refused at the boundary with 403 read-only member.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Header Parameters
Section titled “Header Parameters ”Which of your projects to act in — an id from GET /v1/projects. Absent, your default project. A project you are not a member of answers 404, the same as one that does not exist. Ignored under a bearer token, which is bound to the project it was minted in.
Request Body required
Section titled “Request Body required ”object
Trimmed. Must start with https:// and be a web address with a host, no spaces, no user name or password; at most 2000 characters. javascript:, data:, http: and a bare word are all refused with defect_url_not_https.
Optional, trimmed, one line of text, at most 200 characters; empty is no label. Stored and returned exactly as sent: nothing in it is interpreted.
Example
{ "url": "https://tracker.example.com/browse/PLN-482", "label": "Coupon is not applied on an empty cart"}Responses
Section titled “ Responses ”Added
A defect (#1064): the address of a ticket somebody already filed, kept beside a case or a failed result. https only, at most 2000 characters; the label is plain text, at most 200, and is shown as text, never as markup. The author is a userId; the dashboard names them from GET /v1/members. No type: Bugs (#1065) will read the same links as external tickets.
object
Example
{ "id": "6f1c2b3a-0000-4000-8000-0000000000a7", "url": "https://tracker.example.com/browse/PLN-482", "label": "Coupon is not applied on an empty cart", "authorId": "6f1c2b3a-0000-4000-8000-0000000000a2", "createdAt": "2026-09-16T10:30:00.000Z"}The body is not JSON
object
Example
{ "error": "invalid JSON body"}No / invalid token or session
A reader asked
object
Example
{ "error": "read-only member"}No such case in this project, or it is in the bin
object
Example generated
{ "error": "example"}The case already holds 20 links: too_many_defects
object
Example
{ "error": "test case '6f1c2b3a-0000-4000-8000-0000000000c1' already has 20 defect links: take one off first", "code": "too_many_defects"}The address or the label is refused; code says which
object
Example
{ "error": "the address must start with https:// — nothing else is accepted", "code": "defect_url_not_https"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over