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
  • POST /api/source/join/validate
  • POST /api/source/join/preview
  • GET /api/source/{id}/schedule
  • GET /api/source/{id}
  • GET /api/source
  • POST /api/source/merge
  • POST /api/source/join
  • 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}/alerts/events
  • POST /api/view/{id}/alerts/preview
  • GET /api/view/{id}/alerts
  • GET /api/view/{id}
  • GET /api/view
  • POST /api/view/{id}/alerts
  • PATCH /api/view/{id}/alerts/{alertId}
  • DELETE /api/view/{id}/alerts/{alertId}
  • 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, open data and NBA stats
  • 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/nba/datasets
  • GET /api/connections/{id}
  • GET /api/connections
  • POST /api/sheet-sync
  • POST /api/file/presign
  • POST /api/file/ingest
  • POST /api/socrata/ingest
  • POST /api/nba/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
——
Workflows
  • GET /api/workflow/alerts
  • GET /api/workflow/{id}/deliveries
  • GET /api/workflow/{id}
  • GET /api/workflow
  • POST /api/workflow/{id}/test
  • PATCH /api/workflow/{id}
  • DELETE /api/workflow/{id}
  • POST /api/workflow
—

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

The top 10 categories by total. 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"}],"orderBy":[{"fieldFunctionExpression":{"functionName":"AggregateSum","args":["amount"]},"direction":"DESC"}],"limit":10}' \
  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_requiredThe action needs the Plus plan: scheduled refresh, creating a view alert, turning one on or changing its condition, or creating a workflow, turning one on, pointing it at another alert, changing its message or sending a test.
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.
409handle_requiredMaking a view public needs a public handle (it's part of the link). Claim one on your Account page, then retry.
409alert_limit_reachedThe view, or your account, has as many alerts as allowed (limit, scope). Delete one first.
409workflow_limit_reachedThe alert, or your account, has as many workflows as allowed (limit; scope is alert, 5 per alert, or user, 50 in all). Delete one first.
413file_too_large, dataset_too_largeThe file or dataset is over the import limit.
422not_socrataThe host isn't a Socrata open-data portal.
422snapshot_unavailableThe view's data couldn't be read to test an alert's condition or to run a workflow's Send test. Resync the view's source, or save the view again, then retry.
422alert_invalidA workflow's Send test can't run because its alert's condition can't be checked on the view's data (errors says why, when known). Fix the alert's condition, then retry.
429rate_limitedToo many requests or imports with this key (limit says which), too many open-data searches, or too many NBA datasets added. Wait Retry-After seconds.
429send_limit_reachedA workflow's Send test is over one of your account's send limits (5 test messages an hour, and 10 messages an hour or 25 in 24 hours, tests included). They're per account, not per key; limit says how many, and scope is test_hour, hour or day (24 hours). There's no Retry-After: try again later.
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.
503alerts_unavailableView alerts aren't available on this installation of Hipsift. Retrying won't help.
503workflows_unavailableThis installation of Hipsift doesn't support workflows (self-hosted). Retrying won't help, unless the answer has retryable: true: then it's brief, during an update, and you can 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, open data and NBA stats 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

Add NBA stats

A dataset id and its options from GET /nba/datasets; missing options take their default. NBA.com's terms apply to the data.

curl -X POST -H "Authorization: Bearer pfg_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"datasetId":"standings","params":{"season":"2024-25"}}' \
  https://hipsift.com/api/nba/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

Limits

Each key can make 300 requests a minute, and 10 of them can be imports. Over a limit, requests answer 429 rate_limited with a Retry-After header in seconds: wait that long before trying again, rather than retrying in a loop. When you poll an import or a query, one request every second or two is plenty.

Workflow email has its own limits, per account rather than per key: 5 test messages an hour, and 10 messages an hour or 25 in 24 hours, tests included. Over one, a workflow's Send test answers 429 send_limit_reached with the limit and its scope, and no Retry-After; a message from an alert firing isn't sent, and its workflow's history says why.

Every operation, with its parameters and responses, is in the full API reference, where you can also try requests with your key.