openapi: 3.0.0

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

externalDocs:
  description: >
    3GPP TS 29.437 V19.1.0; Service Enabler Architecture Layer for Verticals (SEAL);
    Metaverse Enablement Services; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.437/

servers:
  - url: "{apiRoot}/ssan-usg/v1"
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549.

security:
  - {}
  - oAuth2ClientCredentials: []

paths:
  /subscriptions:
    post:
      summary: Create a new Spatial Anchors Usage Information Subscription.
      operationId: CreateSpatialAnchorsUsageSub
      tags:
        - Spatial Anchors Usage Information Subscription (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpatialAnchorsUsageInfoSub'
      responses:
        '200':
          description: >
            OK. The requested Spatial Anchors Usage Information report(s) are successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpatialAnchorsUsageInfo'
        '201':
          description: >
            Created. The Spatial Anchors Usage Information Subscription is successfully created and
            a representation of the created Individual Spatial Anchors Usage Information
            Subscription resource is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpatialAnchorsUsageInfoSub'
          headers:
            Location:
              description: Contains the URI of the newly created resource.
              required: true
              schema:
                type: string
        '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:
        SpatialAnchorsUsageInfoNotif:
          '{$request.body#/notifUri}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/SpatialAnchorsUsageInfoNotif'
              responses:
                '204':
                  description: >
                    No Content. The Spatial Anchors Usage Information Notification is successfully
                    received and acknowledged.
                '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 the Individual Spatial Anchors Usage Information Subscription
          resource.
        required: true
        schema:
          type: string

    get:
      summary: Retrieve an existing Individual Spatial Anchors Usage Information Subscription resource.
      operationId: GetIndSpatialAnchorsUsageInfoSub
      tags:
        - Individual Spatial Anchors Usage Information Subscription (Document)
      responses:
        '200':
          description: >
            OK. The requested Individual Spatial Anchors Usage Information Subscription is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpatialAnchorsUsageInfoSub'
        '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'
        '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 an existing Individual Spatial Anchors Usage Information Subscription resource.
      operationId: UpdateIndSpatialAnchorsUsageInfoSub
      tags:
        - Individual Spatial Anchors Usage Information Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpatialAnchorsUsageInfoSub'
      responses:
        '200':
          description: >
            OK. The Individual Spatial Anchors Usage Information 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/SpatialAnchorsUsageInfoSub'
        '204':
          description: >
            No Content. The Individual Spatial Anchors Usage Information 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 an existing Individual Spatial Anchors Usage Information Subscription resource.
      operationId: ModifyIndSpatialAnchorsUsageInfoSub
      tags:
        - Individual Spatial Anchors Usage Information Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpatialAnchorsUsageInfoSubPatch'
      responses:
        '200':
          description: >
            OK. The Individual Spatial Anchors Usage Information Subscription resource is
            successfully modified and a representation of the updated resource shall be returned in
            the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpatialAnchorsUsageInfoSub'
        '204':
          description: >
            No Content. The Individual Spatial Anchors Usage Information 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: Delete an existing Individual Spatial Anchors Usage Information Subscription resource.
      operationId: DeleteIndSpatialAnchorsUsageInfoSub
      tags:
        - Individual Spatial Anchors Usage Information Subscription (Document)
      responses:
        '204':
          description: >
            No Content. The Individual Spatial Anchors Usage Information Subscription resource is
            successfully 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'

  /report:
    post:
      summary: Enables a service consumer to report the spatial anchor usage information.
      operationId: ReportSpatialAnchorsUsageInfo
      tags:
        - Report Spatial Anchor Usage Information
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpatialAnchorUsageReportReq'
      responses:
        '204':
          description: >
            No Content. The reported Spatial Anchor Usage Information is successfully received and
            processed.
        '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'

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

  schemas:
#
# STRUCTURED DATA TYPES
#
    SpatialAnchorsUsageInfoSub:
      description: >
        Represents the spatial anchors usage information subscription.
      type: object
      properties:
        eventSubs:
          type: array
          items:
            $ref: '#/components/schemas/AnchorsUsageSub'
          minItems: 1
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        report:
          $ref: '#/components/schemas/SpatialAnchorsUsageInfoNotif'
        sampInt:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec'
        reportReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        expTime:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - eventSubs

    SpatialAnchorsUsageInfoSubPatch:
      description: >
        Represents the spatial anchors usage information subscription.
      type: object
      properties:
        eventSubs:
          type: array
          items:
            $ref: '#/components/schemas/AnchorsUsageSub'
          minItems: 1
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        sampInt:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec'
        reportReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        expTime:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime'

    AnchorsUsageSub:
      description: >
        Represent the subscription details related to spatial anchor usage.
      type: object
      properties:
        event:
          $ref: '#/components/schemas/AnchorUsageEvent'
        evntFltr:
          $ref: '#/components/schemas/AnchorsUsageEventFilter'
      required:
        - event
        - evntFltr

    AnchorsUsageEventFilter:
      description: >
        Represents the filter information for anchors usage event.
      type: object
      properties:
        anchAnlFltr:
          $ref: '#/components/schemas/AnchorsUsageFilter'

    AnchorsUsageFilter:
      description: >
        Represents the spatial anchors usage filter information.
      type: object
      properties:
        anchIds:
           type: array
           items:
             $ref: 'TS29437_SS_SAnManagement.yaml#/components/schemas/SpatialAnchorId'
           minItems: 1
        anchLoc:
          $ref: 'TS29122_MonitoringEvent.yaml#/components/schemas/LocationInfo'
        area:
          $ref: 'TS29558_Eecs_EESRegistration.yaml#/components/schemas/ServiceArea'
        appId:
          type: string
      anyOf:
        - required: [anchIds]
        - required: [anchLoc]
        - required: [area]
        - required: [appId]

    SpatialAnchorsUsageInfoNotif:
      description: >
        Represents the spatial anchors usage information notification.
      type: object
      properties:
        subId:
          type: string
        reports:
          type: array
          items:
            $ref: '#/components/schemas/SpatialAnchorsUsageReport'
          minItems: 1
      required:
        - subId
        - reports

    SpatialAnchorsUsageReport:
      description: >
        Represents the usage report in the notification.
      type: object
      properties:
        event:
          $ref: '#/components/schemas/AnchorUsageEvent'
        anchUsgInf:
          type: array
          items:
            $ref: '#/components/schemas/AnchorsUsageInfo'
          minItems: 1
      required:
        - event

    AnchorsUsageInfo:
      description: >
        Represents the anchor usage details.
      type: object
      properties:
        anchIds:
          type: array
          items:
            $ref: 'TS29437_SS_SAnManagement.yaml#/components/schemas/SpatialAnchorId'
          minItems: 1
        discAcc:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        serAcc:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        anchDensity:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        usrDensity:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
      required:
        - anchIds
        - discAcc
        - serAcc
        - anchDensity
        - usrDensity

    SpatialAnchorUsageReportReq:
      description: >
        Represents the request for spatial anchor usage report.
      type: object
      properties:
        anchUsg:
          type: array
          items:
            $ref: '#/components/schemas/AnchorUsage'
          minItems: 1
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - anchUsg

    AnchorUsage:
      description: >
        Represents the anchor usage information reported.
      type: object
      properties:
        anchId:
          $ref: 'TS29437_SS_SAnManagement.yaml#/components/schemas/SpatialAnchorId'
        access:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        repPer:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
      required:
        - anchId
        - access

    SpatialAnchorsUsageInfo:
      description: >
        Represents the response to the spatial anchor usage information request.
      type: object
      properties:
        reports:
          type: array
          items:
            $ref: '#/components/schemas/SpatialAnchorsUsageReport'
          minItems: 0
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - reports

# SIMPLE DATA TYPES
#
#
# ENUMERATIONS
#
    AnchorUsageEvent:
      anyOf:
      - type: string
        enum:
        - SPATIAL_ANCHOR_USAGE_INFORMATION
      - type: string
        description: >
          This string provides forward-compatibility with future extensions to the enumeration but
          is not used to encode content defined in the present version of this API.
      description: |
        Represents the type of entity.  
        Possible values are:  
          - SPATIAL_ANCHOR_USAGE_INFORMATION: Indicates that the event is related to spatial
            anchors usage.
# Data types describing alternative data types or combinations of data types:
#


