WP Engine SSH Key API

The SSH Key API from WP Engine — 2 operation(s) for ssh key.

OpenAPI Specification

wpengine-ssh-key-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: 'The API described in this document is subject to change.

    '
  version: 1.17.0
  title: WP Engine Hosting Platform Account SSH Key API
  termsOfService: https://wpengine.com/legal/terms-of-service/
host: api.wpengineapi.com
basePath: /v1
schemes:
- https
tags:
- name: SSH Key
paths:
  /ssh_keys:
    get:
      tags:
      - SSH Key
      summary: Get your SSH keys
      description: '# Description

        Use this to list the SSH keys that you''ve added to WP Engine.

        '
      operationId: listSshKeys
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - $ref: '#/parameters/limitParam'
      - $ref: '#/parameters/offsetParam'
      responses:
        '200':
          description: List of SSH keys
          schema:
            type: object
            properties:
              previous:
                $ref: '#/definitions/PreviousPage'
              next:
                $ref: '#/definitions/NextPage'
              count:
                $ref: '#/definitions/ResultsCount'
              results:
                type: array
                items:
                  $ref: '#/definitions/SshKey'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/ssh_keys
        responses:
          '200':
            statusCode: '200'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '429':
            statusCode: '429'
          '503':
            statusCode: '503'
          default:
            statusCode: '500'
        requestParameters:
          integration.request.header.X-Request-ID: context.requestId
          integration.request.header.sourceIp: context.identity.sourceIp
          integration.request.header.authorization: method.request.header.Authorization
          integration.request.querystring.offset: method.request.querystring.offset
          integration.request.querystring.limit: method.request.querystring.limit
        passthroughBehavior: when_no_match
        httpMethod: GET
        type: http
    post:
      tags:
      - SSH Key
      summary: Add a new SSH key
      description: '# Description

        Use this to add a new SSH key to WP Engine.

        '
      operationId: createSshKey
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - in: body
        name: body
        description: '##### Properties

          * public_key - **required** - The public key you want to add

          '
        required: true
        schema:
          type: object
          required:
          - public_key
          properties:
            public_key:
              type: string
              example: ssh-rsa AAAAbcdefg+567te/4i9ASKGHtw9euaskl+Iksldfjw== joe@gmail.com
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/SshKey'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '403':
          description: Not authorized
          schema:
            $ref: '#/definitions/ForbiddenErrorResponse'
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/ssh_keys
        responses:
          '201':
            statusCode: '201'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '403':
            statusCode: '403'
          '429':
            statusCode: '429'
          '503':
            statusCode: '503'
          default:
            statusCode: '500'
        requestParameters:
          integration.request.header.X-Request-ID: context.requestId
          integration.request.header.sourceIp: context.identity.sourceIp
          integration.request.header.authorization: method.request.header.Authorization
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: http
  /ssh_keys/{ssh_key_id}:
    delete:
      tags:
      - SSH Key
      summary: Delete an existing SSH key
      description: '# Description

        This will delete the SSH key.

        '
      operationId: deleteSshKey
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - name: ssh_key_id
        in: path
        description: The ID of the SSH key to delete
        required: true
        type: string
        format: uuid
        x-example: 294deacc-d8b8-4005-82c4-0727ba8ddde0
      responses:
        '204':
          description: Deleted
        '400':
          description: Bad Request
        '401':
          description: Authentication Error
        '403':
          description: Not authorized
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/ssh_keys/{ssh_key_id}
        responses:
          '204':
            statusCode: '204'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '403':
            statusCode: '403'
          '429':
            statusCode: '429'
          '503':
            statusCode: '503'
          default:
            statusCode: '500'
        requestParameters:
          integration.request.header.X-Request-ID: context.requestId
          integration.request.header.sourceIp: context.identity.sourceIp
          integration.request.header.authorization: method.request.header.Authorization
          integration.request.path.ssh_key_id: method.request.path.ssh_key_id
        passthroughBehavior: when_no_match
        httpMethod: DELETE
        type: http
definitions:
  PreviousPage:
    type: string
    example: https://api.wpengineapi.com/v1/example-endpoint?limit=100&offset=0
    x-nullable: true
    description: Path to the previous page of results
  SshKey:
    type: object
    properties:
      comment:
        type: string
        example: joe@gmail.com
      created_at:
        type: string
        example: '2019-09-01T15:59:24.277Z'
      fingerprint:
        type: string
        example: a1:b2:c3:d4:e5:46:a7:88:c9:40:d2:d7:9b:cd:42:05
      uuid:
        type: string
        format: uuid
        example: e41fa98f-ea80-1f16-a7b7-d748bcc9e64d
  NextPage:
    type: string
    example: https://api.wpengineapi.com/v1/example-endpoint?limit=100&offset=200
    x-nullable: true
    description: Path to the next page of results
  TooManyRequestsOperation:
    description: Too many requests
  BadRequestErrorResponse:
    type: object
    required:
    - message
    properties:
      message:
        type: string
        description: A message regarding the error that occurred on the server
        example: 'Invalid Site: Name cannot be empty.'
      documentation_url:
        type: string
        description: (Optional) A URL where documentation regarding this specific error can be found
      errors:
        type: array
        description: An array of error objects describing specific errors that arose when servicing the request
        items:
          $ref: '#/definitions/ResourceError'
  ResourceError:
    type: object
    required:
    - resource
    - field
    - type
    - code
    - message
    properties:
      resource:
        type: string
        description: The name of the resource that was being processed when the error occurred
        example: Site
      field:
        type: string
        description: (Optional) The specific field associated with the error
        example: name
      type:
        type: string
        description: (Optional) A type associated with the error. `invalid_value`, `access_error`, `value_unavailable`
        example: invalid_value
      code:
        type: string
        description: (Optional) A machine code relating to the error that occurred with the field and resource
        example: too_long
      message:
        type: string
        description: (Optional) A human-readable message relating to the error that occurred with the field and resource
        example: Name is too long (maximum is 40 characters)
  ServiceUnavailableOperation:
    description: Service unavailable
  ResultsCount:
    type: integer
    example: 225
    description: The total number of results
  ForbiddenErrorResponse:
    type: object
    required:
    - message
    properties:
      message:
        type: string
        description: A message regarding the error that occurred on the server
        example: You don't have permission to perform that action
      documentation_url:
        type: string
        description: (Optional) A URL where documentation regarding this specific error can be found
  AuthenticationErrorResponse:
    type: object
    required:
    - message
    properties:
      message:
        type: string
        description: A message regarding the error that occurred on the server
        example: Bad Credentials
      documentation_url:
        type: string
        description: (Optional) A URL where documentation regarding this specific error can be found
parameters:
  offsetParam:
    name: offset
    in: query
    type: integer
    required: false
    default: 0
    minimum: 0
    description: (Optional) The first record of the result set to be retrieved
  authorization:
    name: Authorization
    in: header
    type: string
    format: uuid
  limitParam:
    name: limit
    in: query
    type: integer
    required: false
    default: 100
    minimum: 0
    maximum: 100
    description: (Optional) The number of records to return
securityDefinitions:
  basicAuth:
    type: basic
    description: 'API username and password from Portal''s API Access page: https://my.wpengine.com/api_access'