Skip to content
Connect an agent

Organisations

Place a library diagram in a Google Slides deck or a Google Doc

Puts the picture on the chosen slide or at the end of the Doc.

POST/orgs/{org}/documents

TL;DR

QuestionAnswer
What does it do?Place a library diagram in a Google Slides deck or a Google Doc.
What does it take?A JSON body of type DocumentPlaceBody.
What does it return?Status 201 with a body of type DocumentPlacementAnswer.
What can go wrong?400 a field is not valid (documents.invalid); details.field names it; 401 not signed in; 403 not the owner or an admin (orgs.forbidden), the plan does not include it (plan.documents_not_included), or the origin may not make changes; 404 no such organisation, diagram, placement or file, or the caller is not a member; 409 google Drive is not connected (documents.no_drive), the diagram may not leave the library (documents.confidential, documents.restricted, documents.pending), or the organisation has 200 placements (documents.limit); 429 too many requests; 502 google refused or could not be reached (documents.google_failed); 503 placing diagrams in documents is not available on this server (documents.unavailable). Every failure uses the one error envelope.

What it does

Puts the picture on the chosen slide or at the end of the Doc. Each new version of the diagram then replaces it in place.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type DocumentPlaceBody.

FieldTypeRequiredDescription
diagramIdstringyesThe library diagram.
kind"slides" | "docs"yesslides for a Google Slides deck, docs for a Google Doc.
fileIdstringyesThe deck or Doc, as the Google Picker gave it. pattern ^[A-Za-z0-9_-]{10,200}$.
fileNamestringyesThe file's name, for the portal to show. at least 1 character; at most 300 characters.
pageIdstringnoThe slide to place the picture on. Required for a deck. pattern ^[A-Za-z0-9_.:-]{1,200}$.

Responses

StatusMeaningBody
201The placement.DocumentPlacementAnswer
400A field is not valid (documents.invalid); details.field names it.ErrorResponse
401Not signed in.ErrorResponse
403Not the owner or an admin (orgs.forbidden), the plan does not include it (plan.documents_not_included), or the origin may not make changes.ErrorResponse
404No such organisation, diagram, placement or file, or the caller is not a member.ErrorResponse
409Google Drive is not connected (documents.no_drive), the diagram may not leave the library (documents.confidential, documents.restricted, documents.pending), or the organisation has 200 placements (documents.limit).ErrorResponse
429Too many requests.ErrorResponse
502Google refused or could not be reached (documents.google_failed).ErrorResponse
503Placing diagrams in documents is not available on this server (documents.unavailable).ErrorResponse

Response body

A 201 answer has the type DocumentPlacementAnswer.

FieldTypeRequiredDescription
placementDocumentPlacementyes
placement.idstringyes
placement.diagramIdstringyes
placement.diagramNamestring | nullyes
placement.kind"slides" | "docs"yesslides for a Google Slides deck, docs for a Google Doc.
placement.fileIdstringyes
placement.fileNamestringyes
placement.pageIdstring | nullyesThe slide, for a deck; null for a Doc.
placement.status"ok" | "failing" | "gone"yesok, failing (the last send failed; lastError says why) or gone (the file or the picture is no longer there).
placement.lastErrorstring | nullyes
placement.lastSentAtinteger | nullyes
placement.currentbooleanyesWhether the file shows the library's current version.
placement.createdAtintegeryes
placement.linkstringyesThe file in Google.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools