Call it
curl https://api.peume.com/v1/call/create-a-hosted-google-picker-session \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"mimeTypes": [
"image/png",
"image/jpeg",
"application/pdf"
],
"multiselect": true
}
}'const res = await fetch("https://api.peume.com/v1/call/create-a-hosted-google-picker-session", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"mimeTypes": [
"image/png",
"image/jpeg",
"application/pdf"
],
"multiselect": true
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/create-a-hosted-google-picker-session",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"mimeTypes": [
"image/png",
"image/jpeg",
"application/pdf"
],
"multiselect": True
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: create-a-hosted-google-picker-session.
Parameters
accountIdRequiredstringA Google account connected with `scopes=files`.
redirectUrlstringWhere the browser goes when the user finishes. Absolute `http(s)` URL or a custom app scheme (`myapp://...`); relative, protocol-relative and script URLs are refused. Optional when you rely on the `file.picked` webhook.
fileIdsarrayDrive file ids to show the user first (Google Picker `DocsView.setFileIds`), for example to ask for access to files your app already knows about. Pre-navigation only: the user still has to pick them.
mimeTypesarrayOnly show files of these exact media types.
Example: ["image/png","image/jpeg","application/pdf"]
multiselectbooleanfalse limits the pick to one file.
Example: true
