Amazon Lightsail Keypairs API

The Keypairs API from Amazon Lightsail — 6 operation(s) for keypairs.

GitHub OpenAPI

Operations 6

POST /#CreateKeyPair Create Key Pair #
POST /#DeleteKeyPair Delete Key Pair #
POST /#GetKeyPair Get Key Pair #
POST /#GetKeyPairs Get Key Pairs #
POST /#ImportKeyPair Import Key Pair #
POST /#DownloadDefaultKeyPair Download Default Key Pair #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-lightsail:amazon-lightsail-keypairs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-lightsail-keypairs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Lightsail Keypairs API
  version: '2016-11-28'
  description: Generated from AWS's published Smithy model for Amazon Lightsail. 6 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://lightsail.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#CreateKeyPair:
    post:
      operationId: CreateKeyPair
      summary: Create Key Pair
      description: Creates a custom SSH key pair that you can use with an Amazon Lightsail instance. Use the DownloadDefaultKeyPair
        action to create a Lightsail default key pair in an Amazon Web Services Region where a default key pair does not currently
        exist. The create key pair operation supports tag-based access control via request tags. For more information, see
        the Amazon Lightsail Developer Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/CreateKeyPairResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.CreateKeyPair
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/CreateKeyPairRequest'
      tags:
      - Keypairs
  /#DeleteKeyPair:
    post:
      operationId: DeleteKeyPair
      summary: Delete Key Pair
      description: Deletes the specified key pair by removing the public key from Amazon Lightsail. You can delete key pairs
        that were created using the ImportKeyPair and CreateKeyPair actions, as well as the Lightsail default key pair. A
        new default key pair will not be created unless you launch an instance without specifying a custom key pair, or you
        call the DownloadDefaultKeyPair API. The delete key pair operation supports tag-based access control via resource
        tags applied to the resource identified by key pair name. For more information, see the Amazon Lightsail Developer
        Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DeleteKeyPairResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.DeleteKeyPair
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DeleteKeyPairRequest'
      tags:
      - Keypairs
  /#GetKeyPair:
    post:
      operationId: GetKeyPair
      summary: Get Key Pair
      description: Returns information about a specific key pair.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetKeyPairResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.GetKeyPair
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetKeyPairRequest'
      tags:
      - Keypairs
  /#GetKeyPairs:
    post:
      operationId: GetKeyPairs
      summary: Get Key Pairs
      description: Returns information about all key pairs in the user's account.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetKeyPairsResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.GetKeyPairs
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetKeyPairsRequest'
      tags:
      - Keypairs
  /#ImportKeyPair:
    post:
      operationId: ImportKeyPair
      summary: Import Key Pair
      description: Imports a public SSH key from a specific key pair.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ImportKeyPairResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.ImportKeyPair
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/ImportKeyPairRequest'
      tags:
      - Keypairs
  /#DownloadDefaultKeyPair:
    post:
      operationId: DownloadDefaultKeyPair
      summary: Download Default Key Pair
      description: Downloads the regional Amazon Lightsail default key pair. This action also creates a Lightsail default
        key pair if a default key pair does not currently exist in the Amazon Web Services Region.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DownloadDefaultKeyPairResult'
        '403':
          description: AccessDeniedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '428':
          description: AccountSetupInProgressException; RegionSetupInProgressException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/AccountSetupInProgressException'
        '400':
          description: InvalidInputException; OperationFailureException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '404':
          description: NotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/NotFoundException'
        '500':
          description: ServiceException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceException'
        '401':
          description: UnauthenticatedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UnauthenticatedException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Lightsail_20161128.DownloadDefaultKeyPair
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DownloadDefaultKeyPairRequest'
      tags:
      - Keypairs
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: lightsail
  schemas:
    AccessDeniedException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
    AccountSetupInProgressException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
    CreateKeyPairRequest:
      type: object
      properties:
        keyPairName:
          type: string
          description: The name for your new key pair.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: The tag keys and optional values to add to the resource during create. Use the TagResource action to
            tag a resource after it's created.
      required:
      - keyPairName
    CreateKeyPairResult:
      type: object
      properties:
        keyPair:
          $ref: '#/components/schemas/KeyPair'
        publicKeyBase64:
          type: string
          description: A base64-encoded public key of the ssh-rsa type.
        privateKeyBase64:
          type: string
          description: A base64-encoded RSA private key.
        operation:
          $ref: '#/components/schemas/Operation'
    DeleteKeyPairRequest:
      type: object
      properties:
        keyPairName:
          type: string
          description: The name of the key pair to delete.
        expectedFingerprint:
          type: string
          description: The RSA fingerprint of the Lightsail default key pair to delete. The expectedFingerprint parameter
            is required only when specifying to delete a Lightsail default key pair.
      required:
      - keyPairName
    DeleteKeyPairResult:
      type: object
      properties:
        operation:
          $ref: '#/components/schemas/Operation'
    DownloadDefaultKeyPairRequest:
      type: object
      properties: {}
    DownloadDefaultKeyPairResult:
      type: object
      properties:
        publicKeyBase64:
          type: string
          description: A base64-encoded public key of the ssh-rsa type.
        privateKeyBase64:
          type: string
          description: A base64-encoded RSA private key.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the default key pair was created.
    GetKeyPairRequest:
      type: object
      properties:
        keyPairName:
          type: string
          description: The name of the key pair for which you are requesting information.
      required:
      - keyPairName
    GetKeyPairResult:
      type: object
      properties:
        keyPair:
          $ref: '#/components/schemas/KeyPair'
    GetKeyPairsRequest:
      type: object
      properties:
        pageToken:
          type: string
          description: The token to advance to the next page of results from your request. To get a page token, perform an
            initial GetKeyPairs request. If your results are paginated, the response will return a next page token that you
            can specify as the page token in a subsequent request.
        includeDefaultKeyPair:
          type: boolean
          description: A Boolean value that indicates whether to include the default key pair in the response of your request.
    GetKeyPairsResult:
      type: object
      properties:
        keyPairs:
          type: array
          items:
            $ref: '#/components/schemas/KeyPair'
          description: An array of key-value pairs containing information about the key pairs.
        nextPageToken:
          type: string
          description: The token to advance to the next page of results from your request. A next page token is not returned
            if there are no more results to display. To get the next page of results, perform another GetKeyPairs request
            and specify the next page token using the pageToken parameter.
    ImportKeyPairRequest:
      type: object
      properties:
        keyPairName:
          type: string
          description: The name of the key pair for which you want to import the public key.
        publicKeyBase64:
          type: string
          description: A base64-encoded public key of the ssh-rsa type.
      required:
      - keyPairName
      - publicKeyBase64
    ImportKeyPairResult:
      type: object
      properties:
        operation:
          $ref: '#/components/schemas/Operation'
    InvalidInputException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
    KeyPair:
      type: object
      properties:
        name:
          type: string
          description: The friendly name of the SSH key pair.
        arn:
          type: string
          description: The Amazon Resource Name (ARN) of the key pair (arn:aws:lightsail:us-east-2:123456789101:KeyPair/05859e3d-331d-48ba-9034-12345EXAMPLE).
        supportCode:
          type: string
          description: The support code. Include this code in your email to support when you have questions about an instance
            or another resource in Lightsail. This code enables our support team to look up your Lightsail information more
            easily.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the key pair was created (1479816991.349).
        location:
          $ref: '#/components/schemas/ResourceLocation'
        resourceType:
          type: string
          enum:
          - ContainerService
          - Instance
          - StaticIp
          - KeyPair
          - InstanceSnapshot
          - Domain
          - PeeredVpc
          - LoadBalancer
          - LoadBalancerTlsCertificate
          - Disk
          - DiskSnapshot
          - RelationalDatabase
          - RelationalDatabaseSnapshot
          - ExportSnapshotRecord
          - CloudFormationStackRecord
          - Alarm
          - ContactMethod
          - Distribution
          - Certificate
          - Bucket
          description: The resource type (usually KeyPair).
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: The tag keys and optional values for the resource. For more information about tags in Lightsail, see
            the Amazon Lightsail Developer Guide.
        fingerprint:
          type: string
          description: The RSA fingerprint of the key pair.
    NotFoundException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
    Operation:
      type: object
      properties:
        id:
          type: string
          description: The ID of the operation.
        resourceName:
          type: string
          description: The resource name.
        resourceType:
          type: string
          enum:
          - ContainerService
          - Instance
          - StaticIp
          - KeyPair
          - InstanceSnapshot
          - Domain
          - PeeredVpc
          - LoadBalancer
          - LoadBalancerTlsCertificate
          - Disk
          - DiskSnapshot
          - RelationalDatabase
          - RelationalDatabaseSnapshot
          - ExportSnapshotRecord
          - CloudFormationStackRecord
          - Alarm
          - ContactMethod
          - Distribution
          - Certificate
          - Bucket
          description: The resource type.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the operation was initialized (1479816991.349).
        location:
          $ref: '#/components/schemas/ResourceLocation'
        isTerminal:
          type: boolean
          description: A Boolean value indicating whether the operation is terminal.
        operationDetails:
          type: string
          description: Details about the operation (Debian-1GB-Ohio-1).
        operationType:
          type: string
          enum:
          - DeleteKnownHostKeys
          - DeleteInstance
          - CreateInstance
          - StopInstance
          - StartInstance
          - RebootInstance
          - OpenInstancePublicPorts
          - PutInstancePublicPorts
          - CloseInstancePublicPorts
          - AllocateStaticIp
          - ReleaseStaticIp
          - AttachStaticIp
          - DetachStaticIp
          - UpdateDomainEntry
          - DeleteDomainEntry
          - CreateDomain
          - DeleteDomain
          - CreateInstanceSnapshot
          - DeleteInstanceSnapshot
          - CreateInstancesFromSnapshot
          - CreateLoadBalancer
          - DeleteLoadBalancer
          - AttachInstancesToLoadBalancer
          - DetachInstancesFromLoadBalancer
          - UpdateLoadBalancerAttribute
          - CreateLoadBalancerTlsCertificate
          - DeleteLoadBalancerTlsCertificate
          - AttachLoadBalancerTlsCertificate
          - CreateDisk
          - DeleteDisk
          - AttachDisk
          - DetachDisk
          - CreateDiskSnapshot
          - DeleteDiskSnapshot
          - CreateDiskFromSnapshot
          - CreateRelationalDatabase
          - UpdateRelationalDatabase
          - DeleteRelationalDatabase
          - CreateRelationalDatabaseFromSnapshot
          - CreateRelationalDatabaseSnapshot
          - DeleteRelationalDatabaseSnapshot
          - UpdateRelationalDatabaseParameters
          - StartRelationalDatabase
          - RebootRelationalDatabase
          - StopRelationalDatabase
          - EnableAddOn
          - DisableAddOn
          - PutAlarm
          - GetAlarms
          - DeleteAlarm
          - TestAlarm
          - CreateContactMethod
          - GetContactMethods
          - SendContactMethodVerification
          - DeleteContactMethod
          - CreateDistribution
          - UpdateDistribution
          - DeleteDistribution
          - ResetDistributionCache
          - AttachCertificateToDistribution
          - DetachCertificateFromDistribution
          - UpdateDistributionBundle
          - SetIpAddressType
          - CreateCertificate
          - DeleteCertificate
          - CreateContainerService
          - UpdateContainerService
          - DeleteContainerService
          - CreateContainerServiceDeployment
          - CreateContainerServiceRegistryLogin
          - RegisterContainerImage
          - DeleteContainerImage
          - CreateBucket
          - DeleteBucket
          - CreateBucketAccessKey
          - DeleteBucketAccessKey
          - UpdateBucketBundle
          - UpdateBucket
          - SetResourceAccessForBucket
          - UpdateInstanceMetadataOptions
          - StartGUISession
          - StopGUISession
          - SetupInstanceHttps
          - GetProfile
          description: The type of operation.
        status:
          type: string
          enum:
          - NotStarted
          - Started
          - Failed
          - Completed
          - Succeeded
          description: The status of the operation.
        statusChangedAt:
          type: string
          format: date-time
          description: The timestamp when the status was changed (1479816991.349).
        errorCode:
          type: string
          description: The error code.
        errorDetails:
          type: string
          description: The error details.
    ResourceLocation:
      type: object
      properties:
        availabilityZone:
          type: string
          description: The Availability Zone. Follows the format us-east-2a (case-sensitive).
        regionName:
          type: string
          enum:
          - us-east-1
          - us-east-2
          - us-west-1
          - us-west-2
          - eu-west-1
          - eu-west-2
          - eu-west-3
          - eu-central-1
          - eu-north-1
          - eu-south-2
          - ca-central-1
          - ap-east-1
          - ap-south-1
          - ap-southeast-1
          - ap-southeast-2
          - ap-northeast-1
          - ap-northeast-2
          - ap-southeast-3
          - ap-southeast-5
          - sa-east-1
          description: The Amazon Web Services Region name.
    ServiceException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
    Tag:
      type: object
      properties:
        key:
          type: string
          description: 'The key of the tag. Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8,
            or the following characters: + - = . _ : / @'
        value:
          type: string
          description: 'The value of the tag. Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in
            UTF-8, or the following characters: + - = . _ : / @'
    UnauthenticatedException:
      type: object
      properties:
        code:
          type: string
        docs:
          type: string
        message:
          type: string
        tip:
          type: string
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/lightsail/service/2016-11-28/lightsail-2016-11-28.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)