openapi: 3.0.0
info:
  title: 3gpp-akma
  version: 1.1.0
  description: |
    API for AKMA.  
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.
externalDocs:
  description: >
    3GPP TS 29.522 V18.6.0; 5G System; Network Exposure Function Northbound APIs.
  url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/'
security:
  - {}
  - oAuth2ClientCredentials: []
servers:
  - url: '{apiRoot}/3gpp-akma/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122.
paths:
  /retrieve:
    post:
      summary: Retrieve AKMA Application Key Information.
      operationId: RetrieveAKMAAppKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AkmaAfKeyRequest'
      responses:
        '200':
          description: The requested information was returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AkmaAfKeyData'
        '204':
          description: No Content.
        '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'
      callbacks:
        ServiceDisablementNotification:
          '{$request.body#/notifUri}':
            post:
              requestBody:
                description: >
                  Represents the AKMA service disablement information.
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/ServiceDisableNotif'
              responses:
                '204':
                  description: No content. The notification 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:
            nnef-akma:gpsi-access: >
              Return GPSI in the AKMA Application Key information for the UE.

  schemas: 
    AkmaAfKeyRequest:
      description: >
        Represents the parameters to request the retrieval of AKMA Application Key information.
      type: object
      properties:
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        afId:
          $ref: '#/components/schemas/AfId'
        aKId:
          $ref: '#/components/schemas/AKId'
        anonInd:
          type: boolean
          description: >
            Indicates whether an anonymous user access. Set to "true" if an anonymous user access is 
            requested; otherwise set to "false". Default value is "false" if omitted.
          default: false
      required:
        - afId
        - aKId

    AkmaAfKeyData:
      description: Represents AKMA Application Key information data.
      type: object
      properties:
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
        gpsi:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi'
        expiry:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime'
        kaf:
          type: string
        supi:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi'
      required:
        - kaf
        - expiry

    ServiceDisableNotif:
      description: Represents the AKMA Service Disable Notification.
      type: object
      properties:
        aKId:
          $ref: '#/components/schemas/AKId'
      required:
        - aKId


#Simple Data types


    AfId:
      description: Represents an AF identifier.
      type: string
    AKId:
      description: Represents an AKMA Key Identifier.
      type: string
