openapi: 3.0.0

info:
  title: Nnef_Inference
  version: 1.0.1
  description: |
    API for Nnef_Inference Service.  
    © 2026, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
     3GPP TS 29.591 V19.6.0; 5G System; Network Exposure Function Southbound Services; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.591/

servers:
  - url: '{apiRoot}/nnef-inference/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501

security:
  - {}
  - oAuth2ClientCredentials:
    - nnef-inference
    
paths:
  /subscriptions:
    post:
      summary: Create a new Individual Inference Subscription resource.
      operationId: CreateInferenceSubcription
      tags:
        - Subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferEventSubsc'
      responses:
        '201':
          description: Create a new Individual Inference Subscription resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferEventSubsc'
          headers:
            Location:
              description: >
                Contains the URI of the newly created resource, according to the
                structure 
                {apiRoot}/nnef-inference/v1/subscriptions/{subscriptionId}.
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '502':
          $ref: 'TS29571_CommonData.yaml#/components/responses/502'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
      callbacks:
        myNotification:
          '{$request.body#/notifUri}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: 'TS29530_Naf_Inference.yaml#/components/schemas/InferNotif'
              responses:
                '204':
                  description: No Content, Notification was successful
                '307':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/307'
                '308':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/308'
                '400':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/400'
                '401':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/401'
                '403':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/403'
                '404':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/404'
                '411':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/411'
                '413':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/413'
                '415':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/415'
                '429':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/429'
                '500':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/500'
                '502':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/502'
                '503':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/503'
                default:
                  $ref: 'TS29571_CommonData.yaml#/components/responses/default'
  /subscriptions/{subscriptionId}:
    put:
      summary: Update an existing Individual Inference Subscription
      operationId: UpdateInferenceSubcription
      tags:
        - Individual Inference Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferEventSubsc'
      parameters:
        - name: subscriptionId
          in: path
          description: String identifying an Individual Inference Subscription.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >
            The Individual Inference Subscription resource was modified
            successfully and a representation of that resource is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferEventSubsc'
        '204':
          description: >
            The Individual Inference Subscription resource was modified
            successfully.
        '307':
          $ref: 'TS29571_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29571_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '502':
          $ref: 'TS29571_CommonData.yaml#/components/responses/502'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    patch:
      summary: Partial update an existing Individual Inference Subscription
      operationId: PartialUpdateInferenceSubcription
      tags:
        - Individual Inference Subscription (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/InferEventSubscPatch'
      parameters:
        - name: subscriptionId
          in: path
          description: String identifying an Individual Inference Subscription.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >
            The Individual Inference Subscription resource was partial
            modified successfully and a representation of that resource is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferEventSubsc'
        '204':
          description: >
            The Individual Inference Subscription resource was partial
            modified successfully.
        '307':
          $ref: 'TS29571_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29571_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '502':
          $ref: 'TS29571_CommonData.yaml#/components/responses/502'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    delete:
      summary: Delete an existing Individual Inference Subscription.
      operationId: DeleteInferenceSubcription
      tags:
        - Individual Inference Subscription (Document)
      parameters:
        - name: subscriptionId
          in: path
          description: >
            String identifying an Individual Inference Subscription.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: >
            No Content. The Individual Inference Subscription matching the
            subscriptionId was deleted.
        '307':
          $ref: 'TS29571_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29571_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '502':
          $ref: 'TS29571_CommonData.yaml#/components/responses/502'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'

components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{nrfApiRoot}/oauth2/token'
          scopes:
            nnef-inference: Access to the Nnef_Inference API

  schemas:
    InferEventSubsc:
      description: Represents an Inference subscription.
      type: object
      properties:
        notifCorrId:
          type: string
          description: >
            String identifying the Notification Correlation ID in the corresponding notification.
        notifUri:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri'
        suppFeats:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
        inferAnaSubs:
          type: object
          additionalProperties:
            $ref: 'TS29530_Naf_Inference.yaml#/components/schemas/InferAnaSub'
          minProperties: 1
          description: >
            Represents inference subscription per analytics Id. The key of
            the map shall be set to the value of the "anaEvent" attribute in the
            InferAnaSub data structure.
        inferResults:
          type: object
          additionalProperties:
            $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventNotification'
          minProperties: 1
          description: >
            Represents Inference result. The key of the map shall be set to the value of the "Event"
            attribute in the EventNotification data structure.
        reportingReqs:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        targetServerId:
          type: string
          description: String identifying target VFL server id.
      required:
        - notifUri
        - notifCorrId
        - inferAnaSubs
        - targetServerId

    InferEventSubscPatch:
      description: Represents parameters to request the modification of an Inference subscription.
      type: object
      properties:
        inferAnaSubs:
          type: object
          additionalProperties:
            $ref: 'TS29530_Naf_Inference.yaml#/components/schemas/InferAnaSub'
          minProperties: 1
          description: >
            Represents inference subscription per analytics Id. The key of
            the map shall be set to the value of the "anaEvent" attribute in the
            InferAnaSub data structure.
        notifUri:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri'
        notifCorrId:
          type: string
          description: >
            String identifying the Notification Correlation ID in the corresponding notification.
        reportingReqs:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
