openapi: 3.0.0

info:
  title: SS_ADCCF_DataCollection API
  version: 1.0.0
  description: |
    API for A-DCCF Data Collection service.  
    © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.549 V19.5.0 Service Enabler Architecture Layer for Verticals (SEAL);
    Application Programming Interface (API) specification; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.549/

security:
  - {}
  - oAuth2ClientCredentials: []

servers:
  - url: '{apiRoot}/ss-adccf-dc/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549

paths:
  /subscriptions:
    post:
      summary: Create an "Individual Data Collection Subscription" resource.
      operationId: SubscribeDataCollection
      tags:
        - Data Collection Subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataCollectionSub'
      responses:
        '201':
          description: >
            The "Individual Data Collection Subscription" resource is created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionSub'
          headers:
            Location:
              description: Contains the URI of the newly created individual resource.
              required: true
              schema:
                type: string
        '200':
          description: The requested data collection response is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionResp'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'
      callbacks:
        DataCollectionNotif:
          '{$request.body#/notifUri}': 
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/DataCollectionNotif'
              responses:
                '204':
                  description: The notification is successfully received.
                '307':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/307'
                '308':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/308'
                '400':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/400'
                '401':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/401'
                '403':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/403'
                '404':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/404'
                '411':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/411'
                '413':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/413'
                '415':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/415'
                '429':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/429'
                '500':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/500'
                '503':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/503'
                default:
                  $ref: 'TS29122_CommonData.yaml#/components/responses/default'

  /subscriptions/{subscriptionId}:
    parameters:
      - name: subscriptionId
        in: path
        description: >
          Represents the identifier of an Individual Location-Related UE
          Group Analytics Subscription.
        required: true
        schema:
          type: string

    get:
      summary: Read the "Individual Data Collection Subscription" resource.
      operationId: ReadDataCollectionSubscription
      tags:
        - Individual Data Collection Subscription (Document)
      responses:
        '200':
          description: >
            The requested "Individual Data Collection Subscription"
            resource is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionSub'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29122_CommonData.yaml#/components/responses/406'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    put:
      summary: >
        Update the "Individual Data Collection Subscription" resource.
      operationId: UpdateDataCollectionSubscription
      tags:
        - Individual Data Collection Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataCollectionSub'
      responses:
        '200':
          description: >
            Successful case. The "Individual Data Collection Subscription"
            resource is successfully updated, and a representation of the
            updated resource is returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionSub'
        '204':
          description: >
            No Content. The "Individual Data Collection Subscription" resource is
            successfully updated and no content is returned in the response body.
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    patch:
      summary: Modify the "Individual Data Collection Subscription" resource.
      operationId: ModifyDataCollectionSubscription
      tags:
        - Individual Data Collection Subscription (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/DataCollectionSubPatch'
      responses:
        '200':
          description: >
            Successful case. The "Individual Data Collection Subscription"
            resource is successfully modified and a representation of the updated
            resource is returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionSub'
        '204':
          description: >
            No Content. The "Individual Data Collection Subscription" resource is
            successfully modified and no content is returned in the response body.
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    delete:
      summary: Remove the "Individual Data Collection Subscription" resource.
      operationId: RemoveDataCollectionSubscription
      tags:
        - Individual Data Collection Subscription (Document)
      responses:
        '204':
          description: >
            The "Individual Data Collection Subscription" resource
            matching the subscriptionId is deleted.
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{tokenUrl}'
          scopes: {}

  schemas:
    DataCollectionSub:
      description: >
        Represents the Data Collection Subscription.
      type: object
      properties:
        dataColEvnId:
          type: string
        dataColReq:
          $ref: '#/components/schemas/DataCollectionReq'
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        analyticsId:
          type: string
        dataProdIds:
          type: array
          items:
            type: string
          minItems: 1
        profiles:
          type: array
          items:
            $ref: 'TS29549_SS_AADRF_DataManagement.yaml#/components/schemas/DataProducerProfile'
          minItems: 1
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        duration:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec'
        procReq:
          $ref: '#/components/schemas/ProcessingReq'
        storageReqs:
          $ref: '#/components/schemas/StorageRequirements'
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
        imReport:
          $ref: '#/components/schemas/DataCollectionNotif'
      required:
        - dataColEvnId
        - dataColReq
        - notifUri

    DataCollectionSubPatch:
      description: >
        Represents the requested modifications to a Data Collection Subscription.
      type: object
      properties:
        dataColReq:
          $ref: '#/components/schemas/DataCollectionReq'
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        dataProdIds:
          type: array
          items:
            type: string
          minItems: 1
        profiles:
          type: array
          items:
            $ref: 'TS29549_SS_AADRF_DataManagement.yaml#/components/schemas/DataProducerProfile'
          minItems: 1
        duration:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec'
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'

    DataCollectionResp:
      description: >
        Represents the data collection response.
      type: object
      properties:
        reports:
          type: array
          items:
            $ref: '#/components/schemas/DataCollectionNotif'
          minItems: 1
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - reports

    DataCollectionNotif:
      description: >
        Represents the Data Collection Notification.
      type: object
      properties:
        dataColEvnId:
          type: string
        analyticsId:
          type: string
        analyticsType:
          $ref: 'TS29549_SS_ADAE_VALPerformanceAnalytics.yaml#/components/schemas/AnalyticsType'
        dataType:
          $ref: '#/components/schemas/AdccfDataType'
        dataOutput:
          $ref: '#/components/schemas/DataOutput'
        procReq:
          $ref: '#/components/schemas/ProcessingReq'
        storageReqs:
          type: array
          items:
            type: string
          minItems: 1
      required:
        - dataColEvnId
        - dataOutput

    DataCollectionReq:
      description: >
        Represents the data collection requirements.
      type: object
      properties:
        dataFormat:
          $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/DataFormat'
        repFreq:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec'
        abstraction:
          type: integer
          minimum: 0
          maximum: 100
        accuracy:
          type: integer
          minimum: 0
          maximum: 100
      required:
        - dataFormat
        - repFreq
        - abstraction
        - accuracy

    ProcessingReq:
      description: >
        Represents the data processing requirements.
      type: object
      properties:
        req:
          type: string
      anyOf:
        - required: [req]

    AdccfDataType:
      description: >
        Represents A-DCCD data type.
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DataType'
        gran:
          $ref: '#/components/schemas/GranularityType'
      oneOf:
        - required: [type]
        - required: [gran]

    DataOutput:
      description: >
        Represents the A-DCCF data output.
      type: object
      properties:
        dataOutput:
          type: string
      required:
        - dataOutput

    StorageRequirements:
      description: >
        Represents the data storage requirements.
      type: object
      properties:
        storageReqs:
          type: array
          items:
            type: string
          minItems: 1
      required:
        - storageReqs

# Simple data types and Enumerations

    DataType:
      anyOf:
      - type: string
        enum:
           - UE_DATA
           - NETWORK_DATA
           - APP_DATA
           - EDGE_DATA
      - type: string
        description: >
          This string provides forward-compatibility with future
          extensions to the enumeration and is not used to encode
          content defined in the present version of this API.
      description: |
        Represents the data type.  
        Possible values are:
        - UE_DATA: Indicates that the data sample related to the UE data.
        - NETWORK_DATA: Indicates that the data sample related to the network data.
        - APP_DATA: Indicates that the data sample related to the application data.
        - EDGE_DATA: Indicates that the data sample related to the edge data.

    GranularityType:
      anyOf:
      - type: string
        enum:
           - REAL_TIME
           - NON_REAL_TIME
      - type: string
        description: >
          This string provides forward-compatibility with future
          extensions to the enumeration and is not used to encode
          content defined in the present version of this API.
      description: |
        Represents the granularity type.  
        Possible values are:
        - REAL_TIME: Indicates that the data granularity is real time.
        - NON_REAL_TIME: Indicates that the data granularity is non-real time.

