# Overview

# What is an API?

API, or Application Programming Interface, defines the relationship between two pieces of software. It is a regulated request sent from one with a response sent from the other. Many systems provide an API so that external plugins can take advantage of the data and processing power available.

overview-workflow

# What is REST?

The way we use APIs are through something called REST or Representational State Transfer. The client software sends all necessary information with each request. REST APIs utilize a standard protocol, typically HTTP which is stateless. Statelessness means no dependencies for requests. This means no dependencies and that is super scalable.

overview-crud

The reason we use REST is for with a server to retrieve and modify information. HTTP and JSON are the standard for this type of operations. HTTP is the protocol of the web and JSON is, for the most part, machine and human readable. REST services typically provide the basic "CRUD" operations; create, read, update, delete. In this way, proprietary algorithms can integrate with Petro.ai, modify jobs and custom variables, and export/Import data to/from any system (Python, R, SQL, etc.).

{
    "pwi":"5cab2abd32435bedcab",
    "wellid":"TOM HANKS 001H",
    "basinName":"Permian",
    "countyName":"Harris"
}

# Petro.ai CRUD Operations

The Petro.ai API offers a robust data API for interacting and retrieving data loaded into the platform.

The primary endpoint for interacting with data is /api/data and supports the following HTTP methods

Command Description
HTTP POST Create new records
HTTP PUT Insert/Replace records
HTTP PATCH Update/Modify portions of records
HTTP DELETE Deletes records

Instead of providing a GET method, the data endpoint provides a query route which offers the user a robust schema for making requests for their data.

POST /api/data/query

It currently only supports POST requests and accepts data through the request body.

More info can be found here.