API reference
Documents, Sheets and Slides
Creating and co-editing documents, spreadsheets and presentations, their versions, comments, templates, imports, downloads and search.
See Documents, Sheets and Slides. Every route is under /v1/orgs/:orgId/office (an organization's files) and /v1/me/office (your personal space: signed-in people only, never keys). Public links and the print page's render tokens are under /v1/hooks/office without a session.
The files are Drive files: move, share, star, trash and delete them with Drive's API, which decides every access check here too. Reading needs drive:read; changes need drive:write as well as the access the file allows.
Editing: GET files/:fileId/collab answers the file's state (base64 Yjs: the latest version plus the edits after it), its epoch and seq, your rights, and a ticket for the co-editing socket. Edits go over the socket, or to POST files/:fileId/collab/updates when they're larger than 90 KB. When an answer says reset, the file was replaced (a restore or an upload): load the state again.
Imports and downloads in other formats are jobs: POST imports or POST exports answers a job; ask GET jobs/:jobId until it's done (a new file, or a download link good for a day) or failed.
GET /v1/hooks/office/links/:token/state
A document, spreadsheet or presentation through its public link, for viewing: its name, kind and state (base64 Yjs). No authentication; password-protected links need their grant (x-si-link-grant).
Auth: none
| Path parameter | Description |
|---|---|
:token | A secret from a link: an issue automation rule's incoming-webhook token (shown once when issued), a map's share link, a notification recipient's confirm and unsubscribe link, a Drive public link (/l/<token>), or a Mirage interaction's token (itk_…, sent with the interaction, good for 15 minutes), or the token in the link to a file of a message Mirage sent to Discord, or a Marketing link's sealed token (a tracked click, the open pixel, unsubscribe and the preference centre, a double opt-in confirmation); or a Food recipe's public link (/r/<token>) or a household's calendar feed. |
Response 200
{
item: {
itemId: string
name: string
modifiedAt: number
}
kind: "document" | "spreadsheet" | "presentation" | "video"
state: string
}GET /v1/hooks/office/links/:token/media/:mediaId
A picture in a file shared by a public link.
Auth: none
| Path parameter | Description |
|---|---|
:token | A secret from a link: an issue automation rule's incoming-webhook token (shown once when issued), a map's share link, a notification recipient's confirm and unsubscribe link, a Drive public link (/l/<token>), or a Mirage interaction's token (itk_…, sent with the interaction, good for 15 minutes), or the token in the link to a file of a message Mirage sent to Discord, or a Marketing link's sealed token (a tracked click, the open pixel, unsubscribe and the preference centre, a double opt-in confirmation); or a Food recipe's public link (/r/<token>) or a household's calendar feed. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
url: string
mime: string
}GET /v1/hooks/office/render/:token/state
The file a render token names (a two-minute token for printing and PDF downloads), for the print page.
Auth: none
| Path parameter | Description |
|---|---|
:token | A secret from a link: an issue automation rule's incoming-webhook token (shown once when issued), a map's share link, a notification recipient's confirm and unsubscribe link, a Drive public link (/l/<token>), or a Mirage interaction's token (itk_…, sent with the interaction, good for 15 minutes), or the token in the link to a file of a message Mirage sent to Discord, or a Marketing link's sealed token (a tracked click, the open pixel, unsubscribe and the preference centre, a double opt-in confirmation); or a Food recipe's public link (/r/<token>) or a household's calendar feed. |
Response 200
{
fileId: string
kind?: "document" | "spreadsheet" | "presentation" | "video"
format: "pdf" | "png" | "print"
options: {
[key: string]: string
}
state: string
}GET /v1/hooks/office/render/:token/media/:mediaId
A picture in the file a render token names.
Auth: none
| Path parameter | Description |
|---|---|
:token | A secret from a link: an issue automation rule's incoming-webhook token (shown once when issued), a map's share link, a notification recipient's confirm and unsubscribe link, a Drive public link (/l/<token>), or a Mirage interaction's token (itk_…, sent with the interaction, good for 15 minutes), or the token in the link to a file of a message Mirage sent to Discord, or a Marketing link's sealed token (a tracked click, the open pixel, unsubscribe and the preference centre, a double opt-in confirmation); or a Food recipe's public link (/r/<token>) or a household's calendar feed. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
url: string
mime: string
}POST /v1/orgs/:orgId/office/files
A new document, spreadsheet or presentation (blank, a built-in template or one of the org's), in parentId or My Drive.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | Yes | |
parentId | string | No | 3–64 characters |
name | string | No | 1–255 characters |
templateId | string | No | 3–64 characters |
locale | string | No | up to 20 characters |
today | string | No | matches ^\d{4}-\d{2}-\d{2}$ |
meeting | object | No | |
meeting.title | string | No | up to 200 characters |
meeting.time | string | No | up to 60 characters |
meeting.guests | string[] | No | up to 50 items; each up to 120 characters |
Response 201
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId
A document, spreadsheet or presentation: its Drive item, kind, what you may do (rights: edit, comment, share) and where it is.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/copy
Makes a copy ("Copy of …", or name) in parentId or beside it, with its pictures; versionId copies an earlier version.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | 1–255 characters |
parentId | string | No | 3–64 characters |
versionId | string | No | up to 64 characters |
withProxies | boolean | No |
Response 201
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/collab
The shared document with the caller's rights and a socket ticket (ticket=0 without; state=0 for a ticket alone, on reconnects).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
ticket | "0" | "1" | No | |
state | "0" | "1" | No | |
tab | string | No | up to 64 characters |
device | string | No | up to 60 characters |
Response 200
{
epoch: null | string
seq: number
state: null | string
base: string | number
canWrite: boolean
canComment?: boolean
socket: null | {
url: string
ticket: null | string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/collab/seed
Sets up a file nobody has edited yet: the first update (base64 Yjs) on the version base. 409 when it's already set up.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
undefinedErrors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
413 | Too large. |
POST /v1/orgs/:orgId/office/files/:fileId/collab/updates
Sends an edit (update, base64 Yjs) at epoch; answers its seq. For edits too large for the socket (over 90 KB). 409 when the epoch is stale: reload the state.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body (up to 2,936,012.8 bytes)
| Field | Type | Required | Notes |
|---|---|---|---|
epoch | string | Yes | 1–64 characters |
update | string | Yes | at least 1 character |
Response 200
{
seq: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
413 | Too large. |
GET /v1/orgs/:orgId/office/files/:fileId/collab/updates
Edits after after at epoch, or { reset: true } when the file was replaced since (a restore or an upload): reload the state.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
epoch | string | Yes | 1–64 characters |
after | integer | Yes | ≥ 0; coerced from a string |
Response 200
{
reset: true
} | {
reset: false
updates: {
seq: number
update: string
}[]
state?: null | string
seq?: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/checkpoint
Saves a checkpoint now (a Drive version): on leaving, every 10 minutes of editing, or named.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
reason | "interval" | "leave" | "named" | Yes | |
name | string | No | up to 200 characters |
Response 200
{
saved: boolean
seq: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/media
A picture into the file: a one-part upload link, then …/complete; GET a one-hour link to it.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | 1–255 characters |
size | integer | Yes | ≥ 1 |
mime | string | Yes | up to 100 characters |
Response 201
{
mediaId: string
url: string
method: "PUT"
expiresIn: number
uploadId: string
partSize: number
partCount: number
urls: {
[key: number]: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/media/:mediaId/complete
Finishes a picture's upload (after the PUT to the link POST …/media answered).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
mediaId: string
size: number
mime: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/media/:mediaId
A short-lived link to a picture in the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
url: string
mime: string
size: number
expiresIn: number
canEdit: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/versions
Versions (Drive's, newest first) with names and pins, whether you may manage them, and how many changes aren't in a version yet (unsaved).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
{
versions: {
versionId: string
name: string
size: number
mime: string
checksum?: string
uploadedBy: string
createdAt: number
current: boolean
restoredFrom?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
label?: string
pinned?: boolean
}[]
canManage: boolean
unsaved: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/versions/:versionId/content
An earlier version's state (base64 Yjs) for viewing. Editors only, as in Drive.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Response 200
{
versionId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
state: null | string
createdAt: number
uploadedBy: string
label?: string
pinned: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/orgs/:orgId/office/files/:fileId/versions/:versionId
Names (name, null to clear) or pins (pinned) a version. Pinned versions aren't pruned.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | up to 200 characters; can be null |
pinned | boolean | No |
Response 200
{
versionId: string
label?: string
pinned: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/versions/:versionId/restore
Makes an earlier version current again (a new version with its content); open editors reload.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Response 200
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}
versionId: string
restoredFrom: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/threads
Comment threads on the file, with their anchors (text, cell, slide element or point) and authors' names.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
{
threads: {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/threads
Starts a thread at anchor with body (Markdown; @[Name](usr_…) mentions notify). Commenters and up.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
anchor | object | object | object | object | object | object | Yes | |
body | string | Yes | 1–8,000 characters |
Response 201
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/threads/:threadId/comments
Replies to a thread (and reopens it if it was resolved).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
body | string | Yes | 1–8,000 characters |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/orgs/:orgId/office/files/:fileId/threads/:threadId
Resolves or reopens a thread (resolved). Anyone who can comment.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
resolved | boolean | Yes |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/orgs/:orgId/office/files/:fileId/threads/:threadId
Deletes a thread. Its author, or an editor of the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/orgs/:orgId/office/files/:fileId/threads/:threadId/comments/:commentId
Edits your own comment (body).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
:commentId | Comment id (icm_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
body | string | Yes | 1–8,000 characters |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/orgs/:orgId/office/files/:fileId/threads/:threadId/comments/:commentId
Deletes a comment: your own, or any as an editor of the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
:commentId | Comment id (icm_…). |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/mentions
People @mentioned who can't open the file yet (the commenter is asked to share first).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
userIds | string[] | Yes | up to 50 items; each up to 64 characters |
Response 200
{
withoutAccess: string[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/files/:fileId/lock
Editing locks (Studio: one editor at a time; renew every minute).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
{
lock: {
lockedBy?: string
lockedName?: string
lockUntil?: number
mine: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/files/:fileId/lock
Takes or renews the editing lock for one-at-a-time editing (renew every minute). 423 with who has it when someone else does.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 200
{
lock: {
lockedBy?: string
lockedName?: string
lockUntil?: number
mine: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/orgs/:orgId/office/files/:fileId/lock
Gives up the editing lock.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/templates
The template gallery for kind: Blank, the organization's own templates you can read, then the built-ins.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | No |
Response 200
{
templates: {
templateId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
name: string
category?: string
fileId?: string
builtIn: boolean
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/templates
Makes a file (fileId) one of the organization's templates, with an optional name and category. Editors of the file; not in personal spaces.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
name | string | No | up to 120 characters |
category | string | No | up to 60 characters |
Response 201
{
template: {
templateId: string
fileId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
name: string
category?: string
builtIn: false
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/orgs/:orgId/office/templates/:fileId
Takes a file off the organization's templates (the file stays).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:fileId | File id, as returned when the upload was created. |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/imports
Opens a Word, Excel, PowerPoint, OpenDocument, CSV or Markdown file as a native one beside it (a job).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
itemId | string | Yes | 3–64 characters |
Response 202
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/exports
Downloads a file in another format (a job; ask GET /jobs/:jobId until it's done, then follow result.url).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
format | string | Yes | up to 10 characters |
versionId | string | No | up to 64 characters |
sheetId | string | No | up to 40 characters |
slideId | string | No | up to 40 characters |
Response 202
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/jobs/:jobId
An import or export job: status (queued, running, done, failed) and, when done, the new file or a download link.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:jobId | Job id: an agent job (job_…), under pipelines a pipeline job (pjb_…), or under crm an import or export (cjb_…); under marketing a list import (mkj_…). |
Response 200
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/recent
The person's files of a kind: recently opened first (view: recent, shared, starred or all).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | Yes | |
view | "recent" | "shared" | "starred" | "all" | No |
Response 200
{
items: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/orgs/:orgId/office/search
Files whose content holds every word of q (and that the person can open), with a snippet.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
q | string | Yes | 1–200 characters |
kind | "document" | "spreadsheet" | "presentation" | "video" | No | |
limit | integer | No | 1–100; coerced from a string |
Response 200
{
results: {
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}
kind: "document" | "spreadsheet" | "presentation" | "video"
snippet: string
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/orgs/:orgId/office/assist
Writing, formula and slide help for the file's editor (a model call; counted per day).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
task | string | Yes | up to 40 characters |
input | string | Yes | 1–20,000 characters |
context | string | No | up to 20,000 characters |
Response 200
{
model: string
data?: {
[key: string]: unknown
}
task: string
text: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files
A new document, spreadsheet or presentation (blank, a built-in template or one of the org's), in parentId or My Drive.
Auth: user access token or platform agent key · Scope: drive:read
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | Yes | |
parentId | string | No | 3–64 characters |
name | string | No | 1–255 characters |
templateId | string | No | 3–64 characters |
locale | string | No | up to 20 characters |
today | string | No | matches ^\d{4}-\d{2}-\d{2}$ |
meeting | object | No | |
meeting.title | string | No | up to 200 characters |
meeting.time | string | No | up to 60 characters |
meeting.guests | string[] | No | up to 50 items; each up to 120 characters |
Response 201
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId
A document, spreadsheet or presentation: its Drive item, kind, what you may do (rights: edit, comment, share) and where it is.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/copy
Makes a copy ("Copy of …", or name) in parentId or beside it, with its pictures; versionId copies an earlier version.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | 1–255 characters |
parentId | string | No | 3–64 characters |
versionId | string | No | up to 64 characters |
withProxies | boolean | No |
Response 201
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
path: {
itemId: string
name: string
}[]
drive: {
driveId: string
kind: "user" | "shared"
name: string
}
capabilities: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
shares?: {
principalId: string
type: "user" | "team"
role: "viewer" | "commenter" | "editor"
inherited?: {
itemId: string
name: string
}
}[]
link: {
scope: "org" | "anyone" | "restricted"
role: "viewer" | "commenter" | "editor"
expiresAt?: number
hasPassword: boolean
url?: string
}
personal: boolean
}
kind: "document" | "spreadsheet" | "presentation" | "video"
app: "video" | "documents" | "sheets" | "slides"
path: string
rights: {
view: boolean
comment: boolean
edit: boolean
share: boolean
delete: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/collab
The shared document with the caller's rights and a socket ticket (ticket=0 without; state=0 for a ticket alone, on reconnects).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
ticket | "0" | "1" | No | |
state | "0" | "1" | No | |
tab | string | No | up to 64 characters |
device | string | No | up to 60 characters |
Response 200
{
epoch: null | string
seq: number
state: null | string
base: string | number
canWrite: boolean
canComment?: boolean
socket: null | {
url: string
ticket: null | string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/collab/seed
Sets up a file nobody has edited yet: the first update (base64 Yjs) on the version base. 409 when it's already set up.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
undefinedErrors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
413 | Too large. |
POST /v1/me/office/files/:fileId/collab/updates
Sends an edit (update, base64 Yjs) at epoch; answers its seq. For edits too large for the socket (over 90 KB). 409 when the epoch is stale: reload the state.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body (up to 2,936,012.8 bytes)
| Field | Type | Required | Notes |
|---|---|---|---|
epoch | string | Yes | 1–64 characters |
update | string | Yes | at least 1 character |
Response 200
{
seq: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
413 | Too large. |
GET /v1/me/office/files/:fileId/collab/updates
Edits after after at epoch, or { reset: true } when the file was replaced since (a restore or an upload): reload the state.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
epoch | string | Yes | 1–64 characters |
after | integer | Yes | ≥ 0; coerced from a string |
Response 200
{
reset: true
} | {
reset: false
updates: {
seq: number
update: string
}[]
state?: null | string
seq?: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/checkpoint
Saves a checkpoint now (a Drive version): on leaving, every 10 minutes of editing, or named.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
reason | "interval" | "leave" | "named" | Yes | |
name | string | No | up to 200 characters |
Response 200
{
saved: boolean
seq: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/media
A picture into the file: a one-part upload link, then …/complete; GET a one-hour link to it.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | 1–255 characters |
size | integer | Yes | ≥ 1 |
mime | string | Yes | up to 100 characters |
Response 201
{
mediaId: string
url: string
method: "PUT"
expiresIn: number
uploadId: string
partSize: number
partCount: number
urls: {
[key: number]: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/media/:mediaId/complete
Finishes a picture's upload (after the PUT to the link POST …/media answered).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
mediaId: string
size: number
mime: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/media/:mediaId
A short-lived link to a picture in the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:mediaId | A picture's or other media's id in a document, spreadsheet, presentation or video project (med_…): pictures, Video's proxies, its poster and transcription mixdowns. |
Response 200
{
url: string
mime: string
size: number
expiresIn: number
canEdit: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/versions
Versions (Drive's, newest first) with names and pins, whether you may manage them, and how many changes aren't in a version yet (unsaved).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
{
versions: {
versionId: string
name: string
size: number
mime: string
checksum?: string
uploadedBy: string
createdAt: number
current: boolean
restoredFrom?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
label?: string
pinned?: boolean
}[]
canManage: boolean
unsaved: number
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/versions/:versionId/content
An earlier version's state (base64 Yjs) for viewing. Editors only, as in Drive.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Response 200
{
versionId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
state: null | string
createdAt: number
uploadedBy: string
label?: string
pinned: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/me/office/files/:fileId/versions/:versionId
Names (name, null to clear) or pins (pinned) a version. Pinned versions aren't pruned.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | up to 200 characters; can be null |
pinned | boolean | No |
Response 200
{
versionId: string
label?: string
pinned: boolean
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/versions/:versionId/restore
Makes an earlier version current again (a new version with its content); open editors reload.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:versionId | Version id: a saved page version, as listed by the page history, an issue space's version (release, ver_…), or a Drive file's version (fvr_…). |
Response 200
{
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}
versionId: string
restoredFrom: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/threads
Comment threads on the file, with their anchors (text, cell, slide element or point) and authors' names.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
{
threads: {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/threads
Starts a thread at anchor with body (Markdown; @[Name](usr_…) mentions notify). Commenters and up.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
anchor | object | object | object | object | object | object | Yes | |
body | string | Yes | 1–8,000 characters |
Response 201
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/threads/:threadId/comments
Replies to a thread (and reopens it if it was resolved).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
body | string | Yes | 1–8,000 characters |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/me/office/files/:fileId/threads/:threadId
Resolves or reopens a thread (resolved). Anyone who can comment.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
resolved | boolean | Yes |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/me/office/files/:fileId/threads/:threadId
Deletes a thread. Its author, or an editor of the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
PATCH /v1/me/office/files/:fileId/threads/:threadId/comments/:commentId
Edits your own comment (body).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
:commentId | Comment id (icm_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
body | string | Yes | 1–8,000 characters |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/me/office/files/:fileId/threads/:threadId/comments/:commentId
Deletes a comment: your own, or any as an editor of the file.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
:threadId | Conversation id (thr_…), or in Mirage a thread id (mth_…). |
:commentId | Comment id (icm_…). |
Response 200
{
thread: null | {
id: string
createdAt: number
updatedAt: number
comments: {
id: string
authorId: string
authorName?: string
body: string
createdAt: number
editedAt?: number
}[]
resolved: boolean
resolvedBy?: string
resolvedAt?: number
anchor: {
type: "text"
from: string
to: string
quote?: string
} | {
type: "cell"
sheetId: string
rowId: string
colId: string
label?: string
} | {
type: "element"
slideId: string
elementId: string
} | {
type: "point"
x: number
y: number
} | {
type: "time"
sequenceId: string
t: number
duration?: number
x?: number
y?: number
} | {
type: "file"
}
mentions?: string[]
metadata?: {
[key: string]: unknown
}
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/mentions
People @mentioned who can't open the file yet (the commenter is asked to share first).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
userIds | string[] | Yes | up to 50 items; each up to 64 characters |
Response 200
{
withoutAccess: string[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/files/:fileId/lock
Editing locks (Studio: one editor at a time; renew every minute).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
{
lock: {
lockedBy?: string
lockedName?: string
lockUntil?: number
mine: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/files/:fileId/lock
Takes or renews the editing lock for one-at-a-time editing (renew every minute). 423 with who has it when someone else does.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 200
{
lock: {
lockedBy?: string
lockedName?: string
lockUntil?: number
mine: boolean
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/me/office/files/:fileId/lock
Gives up the editing lock.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/templates
The template gallery for kind: Blank, the organization's own templates you can read, then the built-ins.
Auth: user access token or platform agent key · Scope: drive:read
| Query parameter | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | No |
Response 200
{
templates: {
templateId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
name: string
category?: string
fileId?: string
builtIn: boolean
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/templates
Makes a file (fileId) one of the organization's templates, with an optional name and category. Editors of the file; not in personal spaces.
Auth: user access token or platform agent key · Scope: drive:read
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
name | string | No | up to 120 characters |
category | string | No | up to 60 characters |
Response 201
{
template: {
templateId: string
fileId: string
kind: "document" | "spreadsheet" | "presentation" | "video"
name: string
category?: string
builtIn: false
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
DELETE /v1/me/office/templates/:fileId
Takes a file off the organization's templates (the file stays).
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:fileId | File id, as returned when the upload was created. |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/imports
Opens a Word, Excel, PowerPoint, OpenDocument, CSV or Markdown file as a native one beside it (a job).
Auth: user access token or platform agent key · Scope: drive:read
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
itemId | string | Yes | 3–64 characters |
Response 202
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/exports
Downloads a file in another format (a job; ask GET /jobs/:jobId until it's done, then follow result.url).
Auth: user access token or platform agent key · Scope: drive:read
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
format | string | Yes | up to 10 characters |
versionId | string | No | up to 64 characters |
sheetId | string | No | up to 40 characters |
slideId | string | No | up to 40 characters |
Response 202
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/jobs/:jobId
An import or export job: status (queued, running, done, failed) and, when done, the new file or a download link.
Auth: user access token or platform agent key · Scope: drive:read
| Path parameter | Description |
|---|---|
:jobId | Job id: an agent job (job_…), under pipelines a pipeline job (pjb_…), or under crm an import or export (cjb_…); under marketing a list import (mkj_…). |
Response 200
{
job: {
jobId: string
type: "import" | "export" | "render"
status: "queued" | "done" | "failed" | "running"
result?: {
[key: string]: unknown
}
error?: string
}
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/recent
The person's files of a kind: recently opened first (view: recent, shared, starred or all).
Auth: user access token or platform agent key · Scope: drive:read
| Query parameter | Type | Required | Notes |
|---|---|---|---|
kind | "document" | "spreadsheet" | "presentation" | "video" | Yes | |
view | "recent" | "shared" | "starred" | "all" | No |
Response 200
{
items: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/me/office/search
Files whose content holds every word of q (and that the person can open), with a snippet.
Auth: user access token or platform agent key · Scope: drive:read
| Query parameter | Type | Required | Notes |
|---|---|---|---|
q | string | Yes | 1–200 characters |
kind | "document" | "spreadsheet" | "presentation" | "video" | No | |
limit | integer | No | 1–100; coerced from a string |
Response 200
{
results: {
item: {
itemId: string
driveId: string
parentId?: string
kind: "file" | "folder"
name: string
type: "text" | "code" | "archive" | "folder" | "audio" | "document" | "spreadsheet" | "presentation" | "pdf" | "image" | "video" | "other"
mime?: string
size: number
versions: number
versionId?: string
checksum?: string
children?: number
description?: string
createdBy: string
createdAt: number
modifiedBy: string
modifiedAt: number
ownerId?: string
role: null | "owner" | "viewer" | "commenter" | "editor" | "manager"
starred: boolean
shared: boolean
trashedAt?: number
trashedBy?: string
thumbnailUrl?: string
media?: {
width?: number
height?: number
takenAt?: number
make?: string
model?: string
lat?: number
lon?: number
altitude?: number
orientation?: number
}
stripMetadata: boolean
spaceId: string
contentMatch?: string
}
kind: "document" | "spreadsheet" | "presentation" | "video"
snippet: string
}[]
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
POST /v1/me/office/assist
Writing, formula and slide help for the file's editor (a model call; counted per day).
Auth: user access token or platform agent key · Scope: drive:read
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
fileId | string | Yes | matches ^fil_[0-9a-z]{6,40}$ |
task | string | Yes | up to 40 characters |
input | string | Yes | 1–20,000 characters |
context | string | No | up to 20,000 characters |
Response 200
{
model: string
data?: {
[key: string]: unknown
}
task: string
text: string
}Errors
| Status | Message |
|---|---|
403 | Personal files are only for the person, signed in. |
403 | This key has no person behind it, so it can't open Drive files. |
403 | The person who made this key isn't in the organization any more. |
GET /v1/office/config
Limits for Documents, Sheets, Slides and Studio, and the download formats each kind offers now.
Auth: user access token or platform agent key
Response 200
{
limits: {
"office.fileMb": number
"office.sheetCells": number
"office.sheets": number
"office.chartsPerWorkbook": number
"office.pivotsPerWorkbook": number
"office.slides": number
"office.mediaMb": number
"office.importMb": number
"office.exportsPerHour": number
"office.assistPerDay": number
"office.threadsPerFile": number
"studio.maxPixels": number
"studio.maxLayers": number
"studio.psdMb": number
"studio.historyMb": number
}
fonts: {
family: string
category: "serif" | "mono" | "display" | "sans"
}[]
fontsUrl: null | string
catalog: {
id: "office.fileMb" | "office.sheetCells" | "office.sheets" | "office.chartsPerWorkbook" | "office.pivotsPerWorkbook" | "office.slides" | "office.mediaMb" | "office.importMb" | "office.exportsPerHour" | "office.assistPerDay" | "office.threadsPerFile" | "studio.maxPixels" | "studio.maxLayers" | "studio.psdMb" | "studio.historyMb"
label: "Largest file (MB of editing state)" | "Cells per workbook" | "Sheets per workbook" | "Charts per workbook" | "Pivot tables per workbook" | "Slides per presentation" | "Largest picture (MB)" | "Largest file to import (MB)" | "Downloads as other formats per person per hour" | "Writing and formula help per person per day" | "Comment threads per file" | "Largest canvas (pixels)" | "Layers per image" | "Largest Photoshop file (MB)" | "Undo history (MB)"
}[]
exports: {
[key: string]: {
format: "pdf" | "csv" | "png" | "txt" | "docx" | "odt" | "md" | "xlsx" | "ods" | "tsv" | "pptx" | "odp"
label: string
available: boolean
}[]
}
imports: {
[key: string]: string[]
}
}