WP Engine Backup API

The Backup API from WP Engine — 3 operation(s) for backup.

OpenAPI Specification

wpengine-backup-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 Backup API
  termsOfService: https://wpengine.com/legal/terms-of-service/
host: api.wpengineapi.com
basePath: /v1
schemes:
- https
tags:
- name: Backup
paths:
  /installs/{install_id}/backups:
    get:
      tags:
      - Backup
      summary: List backups for a WordPress installation
      description: 'Returns a paginated list of backups for the specified WordPress installation,

        in all states (`requested`, `in_progress`, `completed`, `aborted`).

        '
      operationId: listBackups
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - $ref: '#/parameters/limitParam'
      - $ref: '#/parameters/offsetParam'
      - name: install_id
        in: path
        format: uuid
        description: ID of install
        required: true
        type: string
        x-example: 294deacc-d8b8-4005-82c4-0727ba8ddde0
      responses:
        '200':
          description: List of backups for install
          schema:
            type: object
            properties:
              previous:
                $ref: '#/definitions/PreviousPage'
              next:
                $ref: '#/definitions/NextPage'
              count:
                $ref: '#/definitions/ResultsCount'
              results:
                type: array
                items:
                  $ref: '#/definitions/Backup'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '403':
          description: Not authorized
          schema:
            $ref: '#/definitions/ForbiddenErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/NotFoundErrorResponse'
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '502':
          $ref: '#/definitions/BadGatewayOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/installs/{install_id}/backups
        responses:
          '200':
            statusCode: '200'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '403':
            statusCode: '403'
          '404':
            statusCode: '404'
          '429':
            statusCode: '429'
          '502':
            statusCode: '502'
          '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.install_id: method.request.path.install_id
          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:
      - Backup
      summary: Requests a new backup of a WordPress installation
      description: Kicks off a backup of a WordPress installation.
      operationId: createBackup
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - name: install_id
        in: path
        format: uuid
        description: ID of install
        required: true
        type: string
        x-example: 294deacc-d8b8-4005-82c4-0727ba8ddde0
      - in: body
        name: body
        description: '##### Properties

          * description - **required**  - A description of this backup.

          * notification_emails - **required** - The email address(es) that will receive an email once the backup has completed.

          '
        required: true
        schema:
          type: object
          required:
          - description
          - notification_emails
          properties:
            description:
              type: string
              description: A description of this backup.
            notification_emails:
              type: array
              items:
                type: string
              description: The email address(es) that will receive an email once the backup has completed.
          example:
            description: Taking a backup of torquemag before I start developing new features for it
            notification_emails:
            - myself@torquemag.com
            - other_person_interested_in_backup@torquemag.com
      responses:
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/Backup'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '403':
          description: Not authorized
          schema:
            $ref: '#/definitions/ForbiddenErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/NotFoundErrorResponse'
        '429':
          description: Too many requests
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/installs/{install_id}/backups
        responses:
          '202':
            statusCode: '202'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '403':
            statusCode: '403'
          '404':
            statusCode: '404'
          '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.install_id: method.request.path.install_id
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: http
  /installs/{install_id}/backups/{backup_id}:
    get:
      tags:
      - Backup
      summary: Retrieves the status of a backup of a WordPress installation
      description: 'Retrieves the status of a backup of a WordPress installation.

        Possible statuses include

        - `requested`

        - `in_progress`

        - `completed`

        - `aborted`

        `initiated` has been deprecated for `in_progress`.

        '
      operationId: showBackup
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - name: install_id
        in: path
        format: uuid
        description: ID of install
        required: true
        type: string
        x-example: 294deacc-d8b8-4005-82c4-0727ba8ddde0
      - name: backup_id
        in: path
        format: uuid
        description: ID of backup
        required: true
        type: string
        x-example: e41fa98f-ea80-4654-b229-a9b765d0863a
      responses:
        '200':
          description: A backup
          schema:
            $ref: '#/definitions/Backup'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/NotFoundErrorResponse'
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/installs/{install_id}/backups/{backup_id}
        responses:
          '200':
            statusCode: '200'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '404':
            statusCode: '404'
          '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.install_id: method.request.path.install_id
          integration.request.path.backup_id: method.request.path.backup_id
        passthroughBehavior: when_no_match
        httpMethod: GET
        type: http
  /installs/{install_id}/backups/{backup_id}/restore:
    post:
      tags:
      - Backup
      summary: Restores a WordPress installation from a backup
      description: 'Initiates a restore operation from a specific backup. This will restore the WordPress installation

        to the state captured in the specified backup.

        '
      operationId: restoreBackup
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - $ref: '#/parameters/authorization'
      - name: install_id
        in: path
        format: uuid
        description: ID of install
        required: true
        type: string
        x-example: 294deacc-d8b8-4005-82c4-0727ba8ddde0
      - name: backup_id
        in: path
        format: uuid
        description: ID of backup to restore from
        required: true
        type: string
        x-example: e41fa98f-ea80-4654-b229-a9b765d0863a
      - in: body
        name: body
        description: '##### Properties

          * notification_emails - **required** - The email address(es) that will receive an email once the restore has completed.

          * restore_database - optional (default: true) - Whether to restore the database from the backup.

          * create_checkpoint - optional (default: true) - Whether to create a checkpoint before restoring.

          '
        required: true
        schema:
          type: object
          required:
          - notification_emails
          properties:
            notification_emails:
              type: array
              items:
                type: string
              description: The email address(es) that will receive an email once the restore has completed.
            restore_database:
              type: boolean
              description: Whether to restore the database from the backup.
              default: true
            create_checkpoint:
              type: boolean
              description: Whether to create a checkpoint before restoring.
              default: true
          example:
            notification_emails:
            - myself@torquemag.com
            restore_database: true
            create_checkpoint: true
      responses:
        '202':
          description: Accepted - restore operation has been initiated
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/BadRequestErrorResponse'
        '401':
          description: Authentication Error
          schema:
            $ref: '#/definitions/AuthenticationErrorResponse'
        '403':
          description: Not authorized
          schema:
            $ref: '#/definitions/ForbiddenErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/NotFoundErrorResponse'
        '429':
          $ref: '#/definitions/TooManyRequestsOperation'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/InternalServerErrorResponse'
        '502':
          $ref: '#/definitions/BadGatewayOperation'
        '503':
          $ref: '#/definitions/ServiceUnavailableOperation'
      security:
      - basicAuth: []
      x-amazon-apigateway-integration:
        uri: https://my.wpengine.com/capi/v1/installs/{install_id}/backups/{backup_id}/restore
        responses:
          '202':
            statusCode: '202'
          '400':
            statusCode: '400'
          '401':
            statusCode: '401'
          '403':
            statusCode: '403'
          '404':
            statusCode: '404'
          '429':
            statusCode: '429'
          '500':
            statusCode: '500'
          '502':
            statusCode: '502'
          '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.install_id: method.request.path.install_id
          integration.request.path.backup_id: method.request.path.backup_id
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: http
definitions:
  InternalServerErrorResponse:
    type: object
    required:
    - message
    properties:
      message:
        type: string
        description: A message regarding the error that occurred on the server
        example: An unexpected error occurred, please try again in a few minutes
  NotFoundErrorResponse:
    type: object
    required:
    - message
    properties:
      message:
        type: string
        description: A message regarding the error that occurred on the server
        example: Not Found
      documentation_url:
        type: string
        description: (Optional) A URL where documentation regarding this specific error can be found
  Backup:
    type: object
    required:
    - id
    - status
    properties:
      id:
        type: string
        format: uuid
        description: The unique identifier of the backup
        example: e41fa98f-ea80-4654-b229-a9b765d0863a
      status:
        type: string
        description: State of the backup.
        enum:
        - requested
        - in_progress
        - completed
        - aborted
        example: completed
      description:
        type: string
        description: Human-readable description provided when the backup was requested
        example: Pre-deploy snapshot
        x-nullable: true
      create_time:
        type: string
        format: date-time
        description: Timestamp when the backup was created
        example: '2024-01-15T10:00:00Z'
        x-nullable: true
      complete_time:
        type: string
        format: date-time
        description: Timestamp when the backup completed. `null` while the backup is still in progress.
        example: '2024-01-15T10:30:00Z'
        x-nullable: true
      wordpress_version:
        type: string
        description: WordPress version of the install at the time the backup was taken
        example: 6.4.2
        x-nullable: true
  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
  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
  BadGatewayOperation:
    description: An invalid response was received from an upstream server
  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'