# Push data from your application

A dataset your application fills by sending rows to GOAT.

A Push API dataset holds rows your application sends to GOAT over HTTPS, rather than data GOAT reads from BigQuery or Cloud Storage. An author creates the dataset and declares its columns; a developer sends the rows.

## Before you start

- You need an Admin or Author sign-in to create the dataset.
- Your developers need an API key with the `ingest` scope ("Push and load data"). Only an admin can create one. See [API keys](../run-goat/api-keys.md).

## Create the dataset

1. Open Datasets and choose New dataset.
2. On "Where is the data?", open Advanced and choose Push API.
3. Under Declare its columns, add each column with its name and type. Or choose Paste a JSON schema and paste a BigQuery schema.
4. Choose Continue.
5. Name the dataset and set its Tenant key. See [Connect and upload data](connect-data.md#the-tenant-key).
6. Choose Create dataset.

Column names use letters, digits, and underscores, and do not start with a digit. The types are those of BigQuery, such as STRING, INT64, FLOAT64, DATE, and TIMESTAMP.

The dataset's status reads Pending, with "first push" beside it, until rows arrive. You can place charts on it right away.

## Send rows

The dataset's Data tab shows a sample request under Send rows from your app, with the dataset's own address:

```sh
curl -X POST https://analytics.example.com/v5/dataload/datasets/<dataset id>/ingest \
  -H "X-Api-Key: <your API key>" \
  -H "Content-Type: application/json" \
  -d '{"rows": [ {"order_id": "A-1001", "region": "West", "amount": 120.5} ]}'
```

Each row is a JSON object whose keys are the declared column names. Rows are added to the table GOAT keeps for the dataset.

Send the API key from your server only, never from a browser or a mobile app.

## Common problems

| What you see | What to check |
|---|---|
| Your request answers `401 API_KEY_INVALID` | The API key is wrong or revoked. |
| Your request answers `403 INSUFFICIENT_SCOPE` | The key does not have the `ingest` scope. |
| The status stays on "first push" | No rows have arrived yet. Check the dataset id in the address. |
| Add files is refused on the dataset | A Push API dataset takes rows only, not files: a file load would replace the table. |
