Skip to content

Add a defect link to a case

POST
/v1/test-cases/{id}/defects
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.

id
required
string format: uuid
X-Plune-Project
string

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.

Media type application/json
object
url
required

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.

string
<= 2000 characters
label

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.

string
nullable <= 200 characters
Example
{
"url": "https://tracker.example.com/browse/PLN-482",
"label": "Coupon is not applied on an empty cart"
}

Added

Media type application/json

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
id
required
string format: uuid
url
required
string
<= 2000 characters /^[Hh][Tt][Tt][Pp][Ss]:///
label
required
string
nullable <= 200 characters
authorId
required
string
createdAt
required
string format: date-time
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

Media type application/json
object
error
required
string
Example
{
"error": "invalid JSON body"
}

No / invalid token or session

A reader asked

Media type application/json
object
error
required
string
Example
{
"error": "read-only member"
}

No such case in this project, or it is in the bin

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The case already holds 20 links: too_many_defects

Media type application/json
object
error
required
string
code
required
string
Allowed values: defect_url_required defect_url_not_https defect_url_invalid defect_url_too_long defect_label_invalid defect_label_too_long too_many_defects result_not_failed
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

Media type application/json
object
error
required
string
code
required
string
Allowed values: defect_url_required defect_url_not_https defect_url_invalid defect_url_too_long defect_label_invalid defect_label_too_long too_many_defects result_not_failed
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.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over