> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atollhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Link a GitHub pull request to an issue

> Requires edit or admin access to the current issue project, or eligible non-guest access for a projectless issue. The authorized live GitHub response must supply immutable numeric repository and pull-request IDs.



## OpenAPI

````yaml /openapi.json post /api/orgs/{id}/issues/{issueId}/external-references
openapi: 3.1.0
info:
  title: Atoll API
  version: 1.0.0
  description: >-
    REST API for Atoll project management, agent collaboration, strategy
    tracking, and integrations.
servers:
  - url: https://atollhq.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Organizations
  - name: Projects
  - name: Project access
  - name: Issues
  - name: Issue details
  - name: Milestones
  - name: Artifacts
  - name: Strategy
  - name: Members and agents
  - name: Planning
  - name: Setup
  - name: Integrations and billing
  - name: Notifications and public
  - name: Private inbox
  - name: Agent executions
  - name: Human attention
paths:
  /api/orgs/{id}/issues/{issueId}/external-references:
    post:
      tags:
        - Issues
      summary: Link a GitHub pull request to an issue
      description: >-
        Requires edit or admin access to the current issue project, or eligible
        non-guest access for a projectless issue. The authorized live GitHub
        response must supply immutable numeric repository and pull-request IDs.
      operationId: post_api_orgs_id_issues_issueId_external_references
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: issueId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  description: >-
                    GitHub pull request URL used only to address the authorized
                    provider read.
                provider:
                  type: string
                  enum:
                    - github
                object_type:
                  type: string
                  enum:
                    - pull_request
      responses:
        '201':
          description: External reference linked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalReferenceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Authorized provider identity unavailable
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                  code:
                    const: github_identity_unavailable
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    ExternalReferenceResponse:
      type: object
      required:
        - externalReference
      properties:
        externalReference:
          $ref: '#/components/schemas/ExternalReference'
      additionalProperties: false
    ExternalReference:
      type: object
      description: >-
        A bounded external provider identity linked to an issue or project.
        Provider payloads and credentials are never returned.
      required:
        - link_id
        - id
        - org_id
        - target_type
        - target_id
        - provider
        - object_type
        - provider_object_id
        - provider_container_id
        - canonical_url
        - display_metadata
        - provenance
        - resolvable
        - resolution_error
        - last_observed_at
        - created_at
        - updated_at
        - linked_at
      properties:
        link_id:
          type: string
          format: uuid
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        target_type:
          type: string
          enum:
            - issue
            - project
        target_id:
          type: string
          format: uuid
        provider:
          type: string
          enum:
            - github
        object_type:
          type: string
          enum:
            - pull_request
        provider_object_id:
          type: string
          pattern: ^[1-9][0-9]*$
        provider_container_id:
          type: string
          pattern: ^[1-9][0-9]*$
        canonical_url:
          type: string
          format: uri
        display_metadata:
          type: object
          additionalProperties: true
        provenance:
          type: string
          enum:
            - github_api
        resolvable:
          type: boolean
        resolution_error:
          type:
            - string
            - 'null'
          enum:
            - github_identity_unavailable
            - revoked
            - private
            - null
        last_observed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        linked_at:
          type: string
          format: date-time
      additionalProperties: false
    Error:
      type: object
      description: >-
        Common error responses contain error. Shared missing-auth and
        unknown-API responses also contain a stable code.
      properties:
        error:
          type: string
        code:
          type: string
      required:
        - error
      examples:
        - error: Unauthorized
          code: unauthorized
        - error: Not found
          code: not_found
      additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated but not allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found or not visible
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_atoll_<key>

````