openapi: 3.0.0
info:
  title: Status Page API
  version: 1.0.0
  description:
    $ref: './md-partials/org-status-intro.mdx'
servers:
  - url: https://app.nobl9.com/api/dashboards/v1
  - url: https://us1.nobl9.com/api/dashboards/v1

tags:
  - name: Organization status
    description: >-
      External telemetry signals are a source of issues in Organization status.
      They are received from external telemetry tools or systems when those tools
      detect a problem with a component.

paths:
  /status-page/issues/external:
    post:
      summary: Send issue from external telemetry
      description: >-
        Sends an external telemetry signal to the Organization status.
      tags:
        - External telemetry integration
      security:
        - basicAuth: []
      parameters:
        - $ref: '#/components/parameters/organization'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExternalIssuePayload'
      responses:
        '201':
          description: Issue created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateExternalIssueResult'
        '400':
          description: Invalid request
        '401':
          description: Authentication credentials not valid
        '403':
          description: Insufficient permissions to access this resource
        '404':
          description: Component with the specified name not found
        '429':
          description: API call exceeded the rate limit
        '500':
          description: Internal server error

components:
  parameters:
    organization:
      in: header
      name: organization
      description: Your organization ID
      required: true
      schema:
        type: string

  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic authentication using access key credentials
        (clientId:clientSecret) for external telemetry tools or systems.

  schemas:
    CreateExternalIssuePayload:
      type: object
      required:
        - componentName
        - occurredAt
        - requestedBy
      properties:
        componentName:
          type: string
          description: >-
            Name of the component for which to send the issue signal.
            The name can match multiple components if they share the same value.
          example: API service
        occurredAt:
          type: string
          format: date-time
          description: When the issue was detected. Cannot be in the future.
        comment:
          type: string
          description: Context for the issue.
          example: Elevated error rate detected on the public API endpoint.
        requestedBy:
          type: string
          minLength: 1
          maxLength: 50
          description: >-
            Identifier of the external telemetry tool or system sending the issue.
          example: servicenow-monitoring
        url:
          type: string
          format: uri
          maxLength: 2048
          description: >-
            Link back to the source issue context or incident in the external telemetry tool
            or system.
            Must use the http or https scheme.
          example: https://source.example.com/incidents/123

    CreateExternalIssueResult:
      type: object
      properties:
        signals:
          type: array
          description: Created issues from external telemetry, one for each matching component
          items:
            $ref: '#/components/schemas/CreateExternalTelemetrySignalResult'
        message:
          type: string
          description: Summary message
          example: Issue from external telemetry created successfully

    CreateExternalTelemetrySignalResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Issue ID
        componentId:
          type: string
          format: uuid
          description: Component ID
        occurredAt:
          type: string
          format: date-time
          description: When the issue occurred
        comment:
          type: string
          description: Issue context
        reportedAt:
          type: string
          format: date-time
          description: When the issue from external telemetry was sent
        reportedBy:
          type: string
          description: External telemetry tool, system, or user that sent the signal
        organization:
          type: string
          description: Organization ID
        type:
          type: string
          enum: [external]
          description: Issue source. Always `external` for this endpoint.
          example: external
        metadata:
          type: object
          description: Additional metadata associated with the external telemetry signal
          additionalProperties: true
