Skip to main content

Quickstart

In this guide you will find one well, copy its asset_id, and retrieve the latest record from a dataset. You need read access through an API key or Bearer token.

1. Choose and store your authorization

The examples use an API key. Set it as an environment variable so it does not appear in your source code. Follow your organization's shell-history and secret-management policy when setting its value.

export CORVA_API_KEY='YOUR_API_KEY'

Every request in this guide sends it through the Authorization header:

Authorization: API YOUR_API_KEY

Bearer tokens are also supported: replace the value with Bearer YOUR_JWT. See Authentication for API key creation, credential-based token generation, refresh, and security guidance.

2. Find a well

GEThttps://api.corva.ai/v2/wells

The request returns one visible well and only the fields needed for the next step.

curl --get 'https://api.corva.ai/v2/wells' \
--header "Authorization: API ${CORVA_API_KEY}" \
--data-urlencode 'per_page=1' \
--data-urlencode 'visibility=visible' \
--data-urlencode 'fields[]=well.name' \
--data-urlencode 'fields[]=well.asset_id'

A successful response contains the selected well fields. Copy the asset_id value from attributes; it identifies the well in dataset records.

{
"data": [
{
"type": "well",
"attributes": {
"name": "Example Well",
"asset_id": 12345
}
}
]
}

3. Read the latest dataset record

Replace 12345 with the asset_id returned above.

GEThttps://data.corva.ai/api/v1/data/corva/wits/
curl --get 'https://data.corva.ai/api/v1/data/corva/wits/' \
--header "Authorization: API ${CORVA_API_KEY}" \
--data-urlencode 'query={"asset_id":12345}' \
--data-urlencode 'sort={"timestamp":-1}' \
--data-urlencode 'limit=1'

The Data API returns an array. An empty array means the request succeeded but no records matched the selected well and dataset.

Next steps