API / handle-origin-pull-request-label-webhooks

API

Handle Origin pull request label webhooks

As of the September 19, 2026 Origin changelog, apps can subscribe to pull_request.label.added and pull_request.label.removed. Official payload fields: llms-full.txt → Pull Request Label Events.

Origin is in Early Beta and subject to change. Subscribe when you configure the app's webhook events list (Create App / Update App). Delivery uses the same signed envelope as other Origin webhooks.

Events

event.type When it fires
pull_request.label.added A label is assigned to a pull request.
pull_request.label.removed A label is unassigned from a pull request. Deleting a label definition delivers one pull_request.label.removed for every pull request that carried the label.

Payload fields

Field Meaning
pullRequest.id Immutable Origin pull request id
pullRequest.number Pull request number
pullRequest.repository Repository reference (id, name, owner)
label.id / label.name Label the event is about
label.color Six-character hex without a leading #
label.description Optional description
actor Principal that assigned the label, when known. Set only on pull_request.label.added. Carries user, app, or serviceAccount variants.

Sample event.payload (added, with actor):

{
  "pullRequest": {
    "id": "pr_01k2ja2000e0080000000000d4",
    "number": "17",
    "repository": {
      "id": "repo_01k2ja2000e0080000000000q4",
      "name": "rocket",
      "owner": {
        "slug": "acme",
        "id": "ns_01k2ja2000e0080000000000p3",
        "type": "team"
      }
    }
  },
  "label": {
    "id": "lbl_01k2ja2000e0080000000000m1",
    "name": "bug",
    "color": "d73a4a",
    "description": "Something isn't working"
  },
  "actor": {
    "user": {
      "id": "user_01k2ja2000e0080000000000c3",
      "email": "jane@acme.dev"
    }
  }
}

Receiver tips

  1. Branch on event.type for added vs removed. Expect actor on added only.
  2. After a label-definition delete, expect many pull_request.label.removed deliveries — one per pull request that held the label.
  3. Read the current assigned set with List Pull Request Labels when you need the full assigned set after the event.
  4. Keep the webhook receiver answering within Origin's delivery deadline (10 seconds as of the Sep 18, 2026 changelog).

Pitfalls

  • Do not invent a label-assignment REST write beyond the published Add / Set / Remove Pull Request Labels endpoints.
  • Comment reaction events (pull_request.comment.reaction.added / removed) are a separate family — see Handle Origin pull request comment reaction webhooks.
  • Pull request lifecycle webhook payloads omit assigned labels; use these label events or the REST list endpoints for label state.