openapi: 3.0.0
info:
  description: SORACOM Krypton API v1
  title: SORACOM Krypton API
  version: 20230923-000517
servers:
- description: SORACOM Air のセルラー回線を使用した認証
  url: https://krypton.soracom.io:8036/v1
- description: SORACOM Endorse による SIM 認証 (グローバルカバレッジの API)
  url: https://g.api.soracom.io/v1
- description: SORACOM Endorse による SIM 認証 (日本カバレッジの API)
  url: https://api.soracom.io/v1
paths:
  /keys:
    get:
      description: Returns a list of keys for a subscriber
      operationId: listKeys
      parameters:
      - in: query
        name: last_evaluated_key
        required: false
        schema:
          type: string
      - in: query
        name: limit
        required: false
        schema:
          default: -1
          format: int32
          type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Key'
                type: array
          description: List of keys
      summary: listKeys
      tags:
      - SORACOM Endorse
    post:
      description: Create a new master key for a subscriber.
      operationId: createKey
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateMasterKeyResponse'
          description: Successfully generated a newly created, unverified master key
        "401":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateMasterKeyResponse'
          description: A challenge is issued for the client to verify the ownership
            of IMSI
      summary: createKey
      tags:
      - SORACOM Endorse
  /keys/{key_id}/verify:
    post:
      description: Verify a key for a subscriber specified by a key ID
      operationId: verifyKey
      parameters:
      - description: Key ID
        in: path
        name: key_id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                res:
                  type: string
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Key'
          description: Key is successfully verified
      summary: verifyKey
      tags:
      - SORACOM Endorse
  /provisioning/aws/cognito/credentials:
    post:
      description: Generate AWS session credentials via Amazon Cognito
      operationId: generateAmazonCognitoSessionCredentials
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/ProvisioningRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmazonCognitoSessionCredentialsResponse'
          description: AWS session credentials associated with Amazon Cognito identity
            pool
      summary: generateAmazonCognitoSessionCredentials
      tags:
      - SORACOM Krypton
  /provisioning/aws/cognito/open_id_tokens:
    post:
      description: Generate Amazon Cognito Open ID token for the subscriber
      operationId: generateAmazonCognitoOpenIdToken
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/ProvisioningRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmazonCognitoOpenIdTokenResponse'
          description: Open ID token to access Amazon Cognito identity pool
      summary: generateAmazonCognitoOpenIdToken
      tags:
      - SORACOM Krypton
  /provisioning/aws/iot/bootstrap:
    post:
      description: Generate AWS IoT device certificate, provision a thing and return
        bootstrap information
      operationId: bootstrapAwsIotThing
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisioningRequest'
        description: keyId, requestParameters. `requestParameters` may include `thingName`
          string value or `skipCertificates` boolean value. If the `thingName` is
          set, Thing Name will be its value. If the `skipCertificates` value is set
          to true, the server skips AWS IoT device certificate and root CA certificate
          in the response so that the response size fits in a small footprint.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AwsIotBootstrapResponse'
          description: AWS IoT thing bootstrap configuration
      summary: bootstrapAwsIotThing
      tags:
      - SORACOM Krypton
  /provisioning/aws/iot/ca_certificate:
    post:
      description: Fetches AWS IoT root CA certificate.
      operationId: getAwsIotThingCACertificate
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/ProvisioningRequest2'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AwsIotThingCertificateResponse'
          description: AWS IoT thing certificate
      summary: getAwsIotThingCACertificate
      tags:
      - SORACOM Krypton
  /provisioning/aws/iot/certificates/{cert_id}:
    post:
      description: Fetches AWS IoT device certificate with the certificate ID specified
        in the path.
      operationId: getAwsIotThingCertificate
      parameters:
      - description: AWS IoT device certificate ID
        in: path
        name: cert_id
        required: true
        schema:
          type: string
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisioningRequest'
        description: keyId, requestParameters.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AwsIotThingCertificateResponse'
          description: AWS IoT thing certificate
      summary: getAwsIotThingCertificate
      tags:
      - SORACOM Krypton
  /provisioning/azure/iot/register:
    post:
      description: Register devices to Azure IoT Hub
      operationId: registerAzureIotDevice
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AzureProvisioningRequest'
        description: keyId, requestParameters. `requestParameters` should be empty
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AzureRegisterDeviceOperation'
          description: Azure IoT Hub registration operation id and status
      summary: registerAzureIotDevice
      tags:
      - SORACOM Krypton
  /provisioning/azure/iot/registrations/{operation_id}:
    post:
      description: Get the IoT device registration status to the Microsoft Azure IoT
        Hub after calling registerAzureIotDevice
      operationId: getAzureIotDeviceRegistrationStatus
      parameters:
      - description: Azure operation Id which is obtained after calling registerAzureIotDevice
        in: path
        name: operation_id
        required: true
        schema:
          type: string
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AzureProvisioningRequest'
        description: keyId, requestParameters. `requestParameters` should be empty
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AzureIotGetRegistrationStatResponse'
          description: Azure IoT Hub device registration status and X.509 certificates
            and keys
      summary: getAzureIotDeviceRegistrationStatus
      tags:
      - SORACOM Krypton
  /provisioning/soracom/air/subscriber_metadata:
    post:
      description: Gets subscriber metadata
      operationId: getSubscriberMetadata
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/ProvisioningRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SoracomAirSubscriberMetadataResponse'
          description: SORACOM Air subscriber metadata is successfully obtained
      summary: getSubscriberMetadata
      tags:
      - SORACOM Krypton
  /provisioning/soracom/air/userdata:
    post:
      description: Gets Userdata
      operationId: getUserdata
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/ProvisioningRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SoracomAirUserdataResponse'
          description: SORACOM Air userdata is successfully obtained
      summary: getUserdata
      tags:
      - SORACOM Krypton
  /provisioning/soracom/arc/bootstrap:
    post:
      description: SORACOM Arc デバイスのブートストラップを行います。ブートストラップ情報を返却します。
      operationId: bootstrapArc
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SoracomArcBootstrapResponse'
          description: SORACOM Arc のデバイスのセットアップが成功したことを表します
      summary: Arc デバイスのブートストラップ
      tags:
      - SORACOM Krypton
  /provisioning/soracom/inventory/bootstrap:
    post:
      description: Creates a SORACOM Inventory device and returns bootstrap information
      operationId: bootstrapInventoryDevice
      parameters:
      - in: header
        name: x-soracom-signature
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-timestamp
        required: false
        schema:
          type: string
      - in: header
        name: x-soracom-digest-algorithm
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SoracomInventoryBootstrapRequest'
        description: keyId, endpoint, requestParameters
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SoracomInventoryBootstrapResponse'
          description: SORACOM Inventory device is successfully provisioned
      summary: bootstrapInventoryDevice
      tags:
      - SORACOM Krypton
components:
  requestBodies:
    ProvisioningRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProvisioningRequest'
      description: keyId, requestParameters
    ProvisioningRequest2:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProvisioningRequest'
      description: keyId, requestParameters.
  schemas:
    AmazonCognitoOpenIdTokenResponse:
      properties:
        identityId:
          type: string
        region:
          type: string
        token:
          type: string
      type: object
    AmazonCognitoSessionCredentialsResponse:
      properties:
        credentials:
          $ref: '#/components/schemas/Credentials'
        identityId:
          type: string
        region:
          type: string
      type: object
    AwsIotBootstrapResponse:
      properties:
        certificate:
          type: string
        clientId:
          type: string
        host:
          type: string
        privateKey:
          type: string
        region:
          type: string
        rootCaCertificate:
          type: string
      type: object
    AwsIotRootCACertificateResponse:
      properties:
        rootCaCertificate:
          type: string
      type: object
    AwsIotThingCertificateResponse:
      properties:
        certificate:
          type: string
      type: object
    AzureIotGetRegistrationStatResponse:
      properties:
        certificate:
          type: string
        deviceId:
          type: string
        host:
          type: string
        operationId:
          type: string
        privateKey:
          type: string
        rootCaCertificate:
          type: string
        status:
          type: string
      type: object
    AzureProvisioningRequest:
      properties:
        keyId:
          type: string
        requestParameters:
          type: object
      type: object
    AzureRegisterDeviceOperation:
      properties:
        operationId:
          type: string
        status:
          enum:
          - assigned
          - assigning
          - disabled
          - failed
          - unassigned
          type: string
      type: object
    CompletionStageResult:
      type: object
    CreateKeyRequest:
      properties:
        auts:
          type: string
        imsi:
          type: string
        rand:
          type: string
      required:
      - imsi
      type: object
    Credentials:
      properties:
        accessKeyId:
          type: string
        expiration:
          format: date-time
          type: string
        secretKey:
          type: string
        sessionToken:
          type: string
      type: object
    GenerateApplicationKeyResponse:
      properties:
        applicationKey:
          items:
            format: byte
            type: string
          type: array
        imsi:
          type: string
        nonce:
          items:
            format: byte
            type: string
          type: array
        operatorId:
          type: string
        timestamp:
          type: string
      type: object
    GenerateMasterKeyResponse:
      properties:
        autn:
          format: byte
          type: string
        expiryTime:
          format: int64
          type: integer
        keyId:
          type: string
        rand:
          format: byte
          type: string
      type: object
    Key:
      properties:
        createdTime:
          format: int64
          type: integer
        expiryTime:
          format: int64
          type: integer
        imsi:
          type: string
        keyId:
          type: string
        lastUsedTime:
          format: date-time
          type: string
        operatorId:
          type: string
        status:
          enum:
          - active
          - inactive
          type: string
        verifiedTime:
          format: int64
          type: integer
      type: object
    ProvisioningRequest:
      properties:
        keyId:
          type: string
        requestParameters:
          $ref: '#/components/schemas/ProvisioningRequestParameters'
      type: object
    ProvisioningRequestParameters:
      properties:
        skipCertificates:
          type: boolean
        thingName:
          type: string
      type: object
    SoracomAirSubscriberMetadataResponse:
      type: object
    SoracomAirUserdataResponse:
      type: object
    SoracomArcBootstrapResponse:
      properties:
        arcAllowedIPs:
          items:
            type: string
          type: array
        arcClientPeerIpAddress:
          type: string
        arcClientPeerPrivateKey:
          type: string
        arcServerEndpoint:
          type: string
        arcServerPeerPublicKey:
          type: string
      type: object
    SoracomInventoryBootstrapRequest:
      properties:
        endpoint:
          type: string
        keyId:
          type: string
        requestParameters:
          type: string
      required:
      - endpoint
      type: object
    SoracomInventoryBootstrapResponse:
      properties:
        applicationKey:
          type: string
        pskId:
          type: string
        serverUri:
          type: string
        shortServerId:
          type: string
      type: object
tags:
- name: SORACOM Krypton
- name: SORACOM Endorse
