ReferenceReference by module

Shared views & forms API

Every Shared views & forms action (3) and data model (1): endpoints, scopes, input, preconditions, events and examples.

Share a Base view with a private link, or publish it as a form.

Module code data_sharing · 3 actions · 1 data models · 3 events. A key or token never does more here than the person behind it can; row-level security applies exactly as in the app. Scopes: data_sharing (everything), data_sharing:read (read only) or data_sharing:<capability>.

Resources

ResourceTableList and readPOSTPATCHDELETE
data_sharesdata_share/api/v1/data_shares

Lists take limit (up to 200), cursor, order (e.g. -created_at), fields and q; every other query parameter is a column filter: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.

Actions

ActionNeedsWhat it does
data_sharing.create_linkdata_sharing:manageShare a view
data_sharing.revoke_linkdata_sharing:manageRevoke a shared link
data_sharing.update_linkdata_sharing:manageChange a shared link

Share a view — Publishes a view on a secret link — read-only, or a form strangers can fill in.

Needs data_sharing:manage · changes data

POSThttps://app.getera.io/api/v1/data_shares/actions/create_link
API key or OAuth token · data_sharing:manage
  • Canonical address: POST /api/v1/actions/data_sharing.create_link
FieldTypeRequiredNotes
savedViewIduuidyesView · id of saved_view
scopestring (enum)yesPeople with the link can · Allowed values: read, submit
passwordstringPassword · max 200
expiresAtdate-timeExpires
allowDownloadbooleanAllow CSV download

The action is refused with 409 and one of these codes:

CodeRefused when
view_not_foundThe view must be a Base view on this workspace.
wrong_view_kindForms are shared to fill in; other views to read.
form_not_builtA form view is shared once its form exists.
password_too_shortA link password is at least six characters.
expiry_in_pastA link has to expire in the future.

Events it publishes: data_sharing.link_created

What it writes: data_share (insert) — Creates the link

curl -X POST https://app.getera.io/api/v1/data_shares/actions/create_link \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"savedViewId":"SAVED_VIEW_ID","scope":"read"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "data_sharing.link_created"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.dataShares.createLink({
  savedViewId: "SAVED_VIEW_ID",
  scope: "read"
})
era data_shares create_link \
  --saved-view-id "SAVED_VIEW_ID" \
  --scope "read"
tools/call
{
  "name": "era__data_sharing__create_link",
  "arguments": {
    "savedViewId": "SAVED_VIEW_ID",
    "scope": "read"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold data_sharing:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 view_not_found, wrong_view_kind, form_not_built, password_too_short, expiry_in_past · 429 slow down

Revoke a shared link — The link stops working at once, for everyone who has it.

Needs data_sharing:manage · removes or cannot be undone · asks a person to confirm when Era runs it

POSThttps://app.getera.io/api/v1/data_shares/{id}/actions/revoke_link
API key or OAuth token · data_sharing:manage
  • Canonical address: POST /api/v1/actions/data_sharing.revoke_link
FieldTypeRequiredNotes
iduuidyesFilled from the path {id} · Link · id of data_share

The action is refused with 409 and one of these codes:

CodeRefused when
link_not_foundThe link must exist and still be live.

Events it publishes: data_sharing.link_revoked

What it writes: data_share (update) — Switches the link off

curl -X POST https://app.getera.io/api/v1/data_shares/DATA_SHARE_ID/actions/revoke_link \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "data_sharing.link_revoked"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.dataShares.revokeLink("DATA_SHARE_ID")
era data_shares revoke_link DATA_SHARE_ID
tools/call
{
  "name": "era__data_sharing__revoke_link",
  "arguments": {
    "id": "DATA_SHARE_ID"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold data_sharing:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 link_not_found · 429 slow down

Change a shared link — Sets or removes its password and expiry, and whether it allows a download.

Needs data_sharing:manage · changes data

POSThttps://app.getera.io/api/v1/data_shares/{id}/actions/update_link
API key or OAuth token · data_sharing:manage
  • Canonical address: POST /api/v1/actions/data_sharing.update_link
FieldTypeRequiredNotes
iduuidyesFilled from the path {id} · Link · id of data_share
passwordstringNew password · max 200
removePasswordbooleanRemove the password
expiresAtdate-timeExpires
removeExpirybooleanNever expire
allowDownloadbooleanAllow CSV download

The action is refused with 409 and one of these codes:

CodeRefused when
link_not_foundThe link must exist and still be live.
password_too_shortA link password is at least six characters.
expiry_in_pastA link has to expire in the future.

Events it publishes: data_sharing.link_changed

What it writes: data_share (update) — Changes the link

curl -X POST https://app.getera.io/api/v1/data_shares/DATA_SHARE_ID/actions/update_link \
  -H "Authorization: Bearer $ERA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"password":"New password"}'
Response
{
  "ok": true,
  "result": "…",
  "events": [
    "data_sharing.link_changed"
  ]
}
import { createEra } from "@getera/sdk"

const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.dataShares.updateLink("DATA_SHARE_ID", {
  password: "New password"
})
era data_shares update_link DATA_SHARE_ID \
  --password "New password"
tools/call
{
  "name": "era__data_sharing__update_link",
  "arguments": {
    "id": "DATA_SHARE_ID",
    "password": "New password"
  }
}

Errors: 401 no or expired credential · 403 the credential does not hold data_sharing:manage · 404 the record or module is outside what it may reach · 422 invalid input (problems[]) · 409 link_not_found, password_too_short, expiry_in_past · 429 slow down

Data models

DataShare

Table data_share · Resource data_shares

  • GET /api/v1/data_shares
  • GET /api/v1/data_shares/{id}
ColumnTypeNullableAllowed valuesReferences
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
data_table_idstring (uuid) · uuid
saved_view_idstring (uuid) · uuid
scopestring · textread, submit
expires_atstring (date-time) · timestamptzyes
allow_downloadboolean · bool
is_activeboolean · bool
created_bystring (uuid) · uuidapp_user
created_atstring (date-time) · timestamptz
updated_atstring (date-time) · timestamptz

Primary key: id

Unique: token

Events

Workflows and webhooks react to these events.

EventWhat happensPayload
data_sharing.link_changedA shared link’s password or expiry changed.id
data_sharing.link_createdA view was shared on a link.id, savedViewId, scope
data_sharing.link_revokedA shared link was switched off.id
Was this page helpful?