Grist API (1.0.1)
An API for manipulating Grist sites, workspaces, and documents.
List the orgs you have access to
This enumerates all the team sites or personal areas available.
Authorizations:
Responses
An array of organizations
Response samples
- 200
[- {
- "id": 42,
- "name": "Grist Labs",
- "domain": "gristlabs",
- "owner": {
- "id": 101,
- "name": "Helga Hufflepuff",
- "picture": null
}, - "access": "owners",
- "createdAt": "2019-09-13T15:42:35.000Z",
- "updatedAt": "2019-09-13T15:42:35.000Z"
}
]
Describe an org
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Responses
An organization
Response samples
- 200
{- "id": 42,
- "name": "Grist Labs",
- "domain": "gristlabs",
- "owner": {
- "id": 101,
- "name": "Helga Hufflepuff",
- "picture": null
}, - "access": "owners",
- "createdAt": "2019-09-13T15:42:35.000Z",
- "updatedAt": "2019-09-13T15:42:35.000Z"
}
Modify an org
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Request Body schema: application/json
the changes to make
name | string |
Responses
Success
Request samples
- Payload
{- "name": "ACME Unlimited"
}
List users with access to org
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Responses
Users with access to org
Response samples
- 200
{- "users": [
- {
- "id": 1,
- "name": "Andrea",
- "email": "andrea@getgrist.com",
- "access": "owners"
}
]
}
Change who has access to org
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Request Body schema: application/json
the changes to make
delta required | object (OrgAccessWrite) |
Request samples
- Payload
{- "delta": {
- "users": {
- "foo@getgrist.com": "owners",
- "bar@getgrist.com": null
}
}
}
List workspaces and documents within an org
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Responses
An org's workspaces and documents
Response samples
- 200
{- "id": 42,
- "name": "Grist Labs",
- "domain": "gristlabs",
- "owner": {
- "id": 101,
- "name": "Helga Hufflepuff",
- "picture": null
}, - "access": "owners",
- "createdAt": "2019-09-13T15:42:35.000Z",
- "updatedAt": "2019-09-13T15:42:35.000Z",
- "workspaces": [
- {
- "id": 97,
- "name": "Secret Plans",
- "access": "owners",
- "docs": [
- {
- "id": 145,
- "name": "Project Lollipop",
- "access": "owners",
- "isPinned": true,
- "urlId": null
}
]
}
]
}
Create an empty workspace
Authorizations:
path Parameters
orgId required | any (OrgKey) This can be an integer id, or a string subdomain (e.g. |
Request Body schema: application/json
settings for the workspace
name | string |
Responses
The workspace id
Request samples
- Payload
{- "name": "Retreat Docs"
}
Response samples
- 200
155
Describe a workspace
Authorizations:
path Parameters
workspaceId required | integer (WorkspaceKey) An integer id |
Responses
A workspace
Response samples
- 200
{- "id": 97,
- "name": "Secret Plans",
- "access": "owners",
- "org": {
- "id": 42,
- "name": "Grist Labs",
- "domain": "gristlabs",
- "owner": {
- "id": 101,
- "name": "Helga Hufflepuff",
- "picture": null
}, - "access": "owners",
- "createdAt": "2019-09-13T15:42:35.000Z",
- "updatedAt": "2019-09-13T15:42:35.000Z"
}
}
Modify a workspace
Authorizations:
path Parameters
workspaceId required | integer (WorkspaceKey) An integer id |
Request Body schema: application/json
the changes to make
name | string |
Responses
Success
Request samples
- Payload
{- "name": "Retreat Docs"
}
List users with access to workspace
Authorizations:
path Parameters
workspaceId required | integer (WorkspaceKey) An integer id |
Responses
Users with access to workspace
Response samples
- 200
{- "maxInheritedRole": "owners",
- "users": [
- {
- "id": 1,
- "name": "Andrea",
- "email": "andrea@getgrist.com",
- "access": "owners",
- "parentAccess": "owners"
}
]
}
Change who has access to workspace
Authorizations:
path Parameters
workspaceId required | integer (WorkspaceKey) An integer id |
Request Body schema: application/json
the changes to make
delta required | object (WorkspaceAccessWrite) |
Request samples
- Payload
{- "delta": {
- "maxInheritedRole": "owners",
- "users": {
- "foo@getgrist.com": "owners",
- "bar@getgrist.com": null
}
}
}
Create an empty document
Authorizations:
path Parameters
workspaceId required | integer (WorkspaceKey) An integer id |
Request Body schema: application/json
settings for the document
name | string |
isPinned | boolean |
Responses
The document id
Request samples
- Payload
{- "name": "Competitive Analysis",
- "isPinned": false
}
Response samples
- 200
"8b97c8db-b4df-4b34-b72c-17459e70140a"
Describe a document
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Responses
A document's metadata
Response samples
- 200
{- "id": 145,
- "name": "Project Lollipop",
- "access": "owners",
- "isPinned": true,
- "urlId": null,
- "workspace": {
- "id": 97,
- "name": "Secret Plans",
- "access": "owners",
- "org": {
- "id": 42,
- "name": "Grist Labs",
- "domain": "gristlabs",
- "owner": {
- "id": 101,
- "name": "Helga Hufflepuff",
- "picture": null
}, - "access": "owners",
- "createdAt": "2019-09-13T15:42:35.000Z",
- "updatedAt": "2019-09-13T15:42:35.000Z"
}
}
}
Modify document metadata (but not its contents)
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Request Body schema: application/json
the changes to make
name | string |
isPinned | boolean |
Responses
Success
Request samples
- Payload
{- "name": "Competitive Analysis",
- "isPinned": false
}
Move document to another workspace in the same org.
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Request Body schema: application/json
the target workspace
workspace required | integer |
Responses
Success
Request samples
- Payload
{- "workspace": 597
}
List users with access to document
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Responses
Users with access to document
Response samples
- 200
{- "maxInheritedRole": "owners",
- "users": [
- {
- "id": 1,
- "name": "Andrea",
- "email": "andrea@getgrist.com",
- "access": "owners",
- "parentAccess": "owners"
}
]
}
Change who has access to document
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Request Body schema: application/json
the changes to make
delta required | object (WorkspaceAccessWrite) |
Request samples
- Payload
{- "delta": {
- "maxInheritedRole": "owners",
- "users": {
- "foo@getgrist.com": "owners",
- "bar@getgrist.com": null
}
}
}
Content of document, as an Excel file
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Responses
A documents's content in Excel form
Content of table, as a CSV file
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
query Parameters
tableId required | string Name of a table (normalized). |
Responses
A table's content in CSV form
Fetch records from a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
filter | string Example: filter={"pet": ["cat", "dog"]} This is a JSON object mapping column names to arrays of allowed values. For example, to filter column |
sort | string Example: sort=pet,-age Order in which to return results. If a single column name is given (e.g. |
limit | number Example: limit=5 Return at most this number of rows. A value of 0 is equivalent to having no limit. |
header Parameters
X-Sort | string Example: pet,-age Same as |
X-Limit | number Example: 5 Same as |
Responses
Records from the table
Response samples
- 200
{- "records": [
- {
- "id": 1,
- "fields": {
- "pet": "cat",
- "popularity": 67
}
}, - {
- "id": 2,
- "fields": {
- "pet": "dog",
- "popularity": 95
}
}
]
}
Add records to a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
noparse | boolean Set to true to prohibit parsing strings according to the column type. |
Request Body schema: application/json
the records to add
records required | Array of objects |
Responses
IDs of records added
Request samples
- Payload
{- "records": [
- {
- "fields": {
- "pet": "cat",
- "popularity": 67
}
}, - {
- "fields": {
- "pet": "dog",
- "popularity": 95
}
}
]
}
Response samples
- 200
{- "records": [
- {
- "id": 1
}, - {
- "id": 2
}
]
}
Modify records of a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
noparse | boolean Set to true to prohibit parsing strings according to the column type. |
Request Body schema: application/json
the records to change, with ids
records required | Array of objects |
Responses
Success
Request samples
- Payload
{- "records": [
- {
- "id": 1,
- "fields": {
- "pet": "cat",
- "popularity": 67
}
}, - {
- "id": 2,
- "fields": {
- "pet": "dog",
- "popularity": 95
}
}
]
}
Add or update records of a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
noparse | boolean Set to true to prohibit parsing strings according to the column type. |
onmany | string Enum: "first" "none" "all" Which records to update if multiple records are found to match
|
noadd | boolean Set to true to prohibit adding records. |
noupdate | boolean Set to true to prohibit updating records. |
allow_empty_require | boolean Set to true to allow |
Request Body schema: application/json
The records to add or update. Instead of an id, a require
object is provided, with the same structure as fields
. If no query parameter options are set, then the operation is as follows. First, we check if a record exists matching the values specified for columns in require
. If so, we update it by setting the values specified for columns in fields
. If not, we create a new record with a combination of the values in require
and fields
, with fields
taking priority if the same column is specified in both. The query parameters allow for variations on this behavior.
records required | Array of objects |
Responses
Success
Request samples
- Payload
{- "records": [
- {
- "require": {
- "pet": "cat"
}, - "fields": {
- "popularity": 67
}
}, - {
- "require": {
- "pet": "dog"
}, - "fields": {
- "popularity": 95
}
}
]
}
List columns in a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
Responses
The columns in a table
Response samples
- 200
{- "columns": [
- {
- "id": "pet",
- "fields": {
- "label": "Pet"
}
}, - {
- "id": "popularity",
- "fields": {
- "label": "Popularity ❤"
}
}
]
}
Work with table data, using a (now deprecated) columnar format. We now recommend the records
endpoints.
Fetch data from a table Deprecated
Deprecated in favor of records
endpoints. We have no immediate plans to remove these endpoints, but consider records
a better starting point for new projects.
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
filter | string Example: filter={"pet": ["cat", "dog"]} This is a JSON object mapping column names to arrays of allowed values. For example, to filter column |
sort | string Example: sort=pet,-age Order in which to return results. If a single column name is given (e.g. |
limit | number Example: limit=5 Return at most this number of rows. A value of 0 is equivalent to having no limit. |
header Parameters
X-Sort | string Example: pet,-age Same as |
X-Limit | number Example: 5 Same as |
Responses
Cells from the table
Response samples
- 200
{- "id": [
- 1,
- 2
], - "pet": [
- "cat",
- "dog"
], - "popularity": [
- 67,
- 95
]
}
Add rows to a table Deprecated
Deprecated in favor of records
endpoints. We have no immediate plans to remove these endpoints, but consider records
a better starting point for new projects.
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
noparse | boolean Set to true to prohibit parsing strings according to the column type. |
Request Body schema: application/json
the data to add
property name* | Array of any |
Responses
IDs of rows added
Request samples
- Payload
{- "pet": [
- "cat",
- "dog"
], - "popularity": [
- 67,
- 95
]
}
Response samples
- 200
[- 101,
- 102,
- 103
]
Modify rows of a table Deprecated
Deprecated in favor of records
endpoints. We have no immediate plans to remove these endpoints, but consider records
a better starting point for new projects.
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
query Parameters
noparse | boolean Set to true to prohibit parsing strings according to the column type. |
Request Body schema: application/json
the data to change, with ids
id required | Array of integers |
property name* | Array of any |
Responses
IDs of rows modified
Request samples
- Payload
{- "id": [
- 1,
- 2
], - "pet": [
- "cat",
- "dog"
], - "popularity": [
- 67,
- 95
]
}
Response samples
- 200
[- 101,
- 102,
- 103
]
Delete rows of a table
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
tableId required | string name of a table (normalized) |
Request Body schema: application/json
the IDs of rows to remove
Responses
Nothing returned
Request samples
- Payload
[- 101,
- 102,
- 103
]
Response samples
- 200
null
Documents may include attached files. Data records can refer to these using a column of type Attachments
.
Upload attachments to a doc
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
Request Body schema: multipart/form-data
the files to add to the doc
upload | Array of File |
Responses
IDs of attachments added, one per file.
Response samples
- 200
[- 101,
- 102,
- 103
]
Get the metadata for an attachment
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
attachmentId required | number (AttachmentId) An integer ID |
Responses
Attachment metadata
Response samples
- 200
{- "fileName": "logo.png",
- "fileSize": 12345,
- "timeUploaded": "2020-02-13T12:17:19.000Z"
}
Download the contents of an attachment
Authorizations:
path Parameters
docId required | string (DocKey) A string id (UUID) |
attachmentId required | number (AttachmentId) An integer ID |
Responses
Attachment contents, with suitable Content-Type.