Docs · API

The Hipsift API.

Find your sheets, run queries, and manage views and collections over HTTPS with an API key.

Authentication

Sign in to Hipsift, open the API Keys page and create a key. It's shown once, so copy it somewhere safe. Send it with every request:

Authorization: Bearer pfg_YOUR_API_KEY

The base URL is https://hipsift.com/api. An x-api-key header works too. Call the API from your own server or scripts: browsers on other sites can't call it.

Scopes

  • read: Discover data, inspect status, and run analytical queries.
  • write: Read access plus imports, schedules, transforms, views, collections and other changes.
  • admin: Write access plus sharing views and making them public.
Areareadwriteadmin
Sheets and columns
  • GET /api/sheet/{id}/fields
  • GET /api/sheet/{id}/dataset-info
  • GET /api/sheet/{id}
  • GET /api/sheet
  • GET /api/field/transform
  • POST /api/sheet/{id}/header
  • POST /api/sheet/{id}/resync
  • PUT /api/sheet/{id}
  • DELETE /api/sheet/{id}
  • POST /api/field/{id}/transform
  • PATCH /api/field/{id}
—
Queries
  • POST /api/query/{sheetId}
  • GET /api/query/{sheetId}/runs
  • GET /api/query/{sheetId}/run/latest
  • GET /api/query/{sheetId}/run/{queryId}
——
Sources and schedules
  • POST /api/source/merge/validate
  • POST /api/source/merge/preview
  • GET /api/source/{id}/schedule
  • GET /api/source/{id}
  • GET /api/source
  • POST /api/source/merge
  • POST /api/source/{id}/resync-now
  • PUT /api/source/{id}/schedule
  • PUT /api/source/{id}
  • DELETE /api/source/{id}
—
Saved views and sharing
  • GET /api/view/{id}
  • GET /api/view
  • POST /api/view
  • PUT /api/view/{id}
  • PATCH /api/view/{id}
  • DELETE /api/view/{id}
  • GET /api/view/{id}/shares
  • POST /api/view/{id}/shares
  • DELETE /api/view/{id}/shares/{shareId}
Collections
  • GET /api/collection/{id}
  • GET /api/collection
  • POST /api/collection/{id}/sheets
  • POST /api/collection/{id}/views
  • POST /api/collection
  • PUT /api/collection/{id}
  • DELETE /api/collection/{id}/sheets/{sheetId}
  • DELETE /api/collection/{id}/views/{viewId}
  • DELETE /api/collection/{id}
—
Google Sheets, files and open data
  • GET /api/google/spreadsheets
  • GET /api/google/sheets
  • GET /api/google/sheet
  • GET /api/file/capabilities
  • GET /api/socrata/domains
  • GET /api/socrata/portals
  • GET /api/socrata/catalog
  • GET /api/connections/{id}
  • GET /api/connections
  • POST /api/sheet-sync
  • POST /api/file/presign
  • POST /api/file/ingest
  • POST /api/socrata/ingest
—
Import status and storage
  • GET /api/ingest-queue/all
  • GET /api/ingest-queue/source/{sourceId}
  • GET /api/ingest-queue/{sourceId}/{sheetId}
  • GET /api/ingest-queue
  • GET /api/storage/usage
——

Sending isPublic in the body of POST /api/view, PUT /api/view/{id} or PATCH /api/view/{id} needs an admin key.

Quickstart: total a column

Replace SHEET_ID and QUERY_ID with the ids from the steps before, and the column names with your own.

1. Find your sheets

Each sheet has a numeric id.

curl -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  https://hipsift.com/api/sheet

2. List a sheet's columns

Use each field's parquetName in queries. Totals need a number column.

curl -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  https://hipsift.com/api/sheet/SHEET_ID/fields

3. Run a query

Queries run in the background. The answer has a queryId.

curl -X POST -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"selectFields":[{"fieldExpressionString":"category"}],"selectFieldFunctions":[{"functionName":"AggregateSum","args":["amount"],"alias":"total"}],"groupByFields":[{"fieldExpressionString":"category"}],"limit":100}' \
  https://hipsift.com/api/query/SHEET_ID

4. Get the result

Repeat until status is COMPLETE (the rows are in result) or ERROR.

curl -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  https://hipsift.com/api/query/SHEET_ID/run/QUERY_ID

A plain-text 404 Dataset not ingested yet means the sheet's import hasn't finished: check GET /api/ingest-queue/all and try again once it's synced. If a column holds text such as “$1,200”, add "transform": "CAST_USD" to the function.

Errors

Most errors are JSON with error, code and message. Some answer with plain text instead, so check the HTTP status first.

StatuscodeMeaning
400invalid_requestThe request is missing or has an invalid field. An invalid query answers errors: [{ field, message }] instead.
400missing_connection_id, ambiguous_connection_idImporting a Google Sheet needs connectionId (the id from GET /api/connections).
400unsupported_format, file_invalidThe file's format isn't supported, or it isn't a valid file of that format.
401auth_requiredNo credential, or the key is invalid or deleted.
401account_inactiveThe account was deleted.
401 / 403reauthorize_requiredThe Google account needs reconnecting in the app (not a key problem).
403insufficient_scopeThe key's scope is too low; requiredScope says which is needed.
403paid_plan_requiredScheduled refresh needs the Basic plan.
403storage_limit_reachedThe plan's storage is full.
403file_access_requiredGoogle can't open the spreadsheet for this connection: pick it again in Hipsift with Google's file picker.
404not_foundNo such resource, or it isn't yours.
404query_run_not_foundRight after submitting a query, the run may not be visible yet. Retry a few times.
409conflictThe request conflicts with the current state.
413file_too_large, dataset_too_largeThe file or dataset is over the import limit.
422not_socrataThe host isn't a Socrata open-data portal.
429rate_limitedToo many open-data searches; wait for Retry-After seconds.
502enqueue_failedThe source was created but its import didn't start. Send the same request again after a few minutes.
503queue_unavailableImports can't be started right now. Retry later.
502 / 503upstream_unavailableA service Hipsift depends on is unavailable. Retry.
503metadata_sync_failedA change couldn't be saved yet. Retry.
503entitlement_unavailable, storage_usage_unavailableYour plan or storage use couldn't be checked. Retry.
503service_drainingHipsift is restarting. Retry.
504upstream_timeoutA dependency (such as Google) didn't answer in time. Retry.

Importing data

Imports need a write key, count toward your plan's storage, and run in the background. To upload a file instead of linking to it, use POST /api/file/presign first (see the reference). Google Sheets and open data can be refreshed later with POST /api/source/SOURCE_ID/resync-now; to update a file, add the new one and delete the old source.

Add a Google Sheet

Use a spreadsheetId from GET /api/google/spreadsheets (spreadsheets you've picked in Hipsift). Add connectionId (the id from GET /api/connections) if you have more than one Google account, or no Google Sheets in Hipsift yet.

curl -X POST -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spreadsheetId":"SPREADSHEET_ID"}' \
  https://hipsift.com/api/sheet-sync

Add a file from a URL

A public HTTPS link to a Parquet or CSV file. requestId is a new random UUID (for example from uuidgen); sending the same one again is safe.

curl -X POST -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"csv","fileName":"orders.csv","sourceKind":"url","url":"https://example.com/orders.csv","requestId":"REQUEST_UUID"}' \
  https://hipsift.com/api/file/ingest

Add an open-data dataset

The dataset's page on a Socrata portal.

curl -X POST -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://data.example.gov/d/abcd-1234"}' \
  https://hipsift.com/api/socrata/ingest

Wait for the import

Use the sourceId from the import's answer. Repeat until the list isn't empty and every sheet's status is SYNCED (or FAILED, with an error).

curl -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  https://hipsift.com/api/ingest-queue/source/SOURCE_ID
Every operation, with its parameters and responses, is in the full API reference, where you can also try requests with your key.