Link a pull request to a task
Link a PR by its URL. Usually unnecessary: a PR whose title, branch or description contains the task's `pr_token` links itself. Linking an already-linked PR refreshes it. Needs the PerspecTask GitHub app installed on the repository (Account → GitHub in the web app). Answers 404 with `code: "not_installed"` when the app isn't on that repository or your GitHub account can't read it.
Link a PR by its URL. Usually unnecessary: a PR whose title, branch or description contains the task's pr_token links itself. Linking an already-linked PR refreshes it. Needs the PerspecTask GitHub app installed on the repository (Account → GitHub in the web app). Answers 404 with code: "not_installed" when the app isn't on that repository or your GitHub account can't read it.
Authorization
bearerAuth Your PerspecTask API key (starts with pt_live_). Each key carries scopes: tasks:read (GET), tasks:write (full create/update), and tasks:write:meta (create/update everything EXCEPT editing title/description of existing tasks — for automation that manages workflow without rewriting human-authored content).
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/tasks/string/pull-requests" \ -H "Content-Type: application/json" \ -d '{ "url": "https://github.com/octocat/hello-world/pull/42" }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"repo": "octocat/hello-world",
"number": 0,
"title": "string",
"url": "string",
"state": "open",
"draft": true,
"checks": "pending",
"review": "approved",
"preview_url": "string",
"preview_status": "building",
"linked_by": "auto"
}List pull requests linked to a task GET
The GitHub pull requests linked to this task, with their state, CI result, review decision and preview deploy, kept up to date by GitHub webhooks. Needs the PerspecTask GitHub app installed on the repository (Account → GitHub in the web app).
Unlink a pull request from a task DELETE
Remove a link (`prId` is the `id` from the list). It stays unlinked: later pushes to the PR do not link it again, only linking it by URL does.