Share a notebook

September 29, 2026

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

Change who can open a notebook, the same as saving the Share dialog of the Gemini Notebook web app. One call can combine all four changes:

  • people adds a person as a viewer or editor, changes their role, or removes them (remove).
  • link opens the notebook to anyone with the link (public) or limits it to the people listed (restricted).
  • allowCopies sets whether people who open the public link may copy the notebook. It applies to a public link only, so it cannot be sent with link: "restricted". Switching the link to restricted resets it to allowed, as the web app does.
  • viewLevel sets what viewers of the shared notebook get: the full notebook (full) or its chat only (chat). Google allows it on paid plans only, and a free account answers 403.

The owner (the account the notebook lives on) cannot be changed. Listing the owner in people returns 400.

By default Google emails every person you add or change, like the “Notify people” box in the web app. Send notify: false to skip the email.

The response is the notebook’s sharing after the change, in the shape of GET /sharing. Google’s sharing read does not include the view level, so viewLevel is in the response only when you set it, echoing the value you sent.

https://api.useapi.net/v1/gemini-notebook/sharing

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
  "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
  "people": [
    { "email": "[email protected]", "role": "editor" }
  ],
  "link": "public",
  "allowCopies": false,
  "notify": false
}
  • notebook is required, the notebook id returned by POST /notebooks or GET /notebooks. The id names its account, so no email is needed.
  • people is optional, an array of 1 to 50 { email, role } objects.
    role supported values: viewer, editor, remove.
  • link is optional, the link access.
    Supported values: public, restricted.
  • allowCopies is optional, true or false, whether people with the public link may copy the notebook. Not accepted together with link: "restricted".
  • notify is optional, false skips Google’s share email to the people in people.
    Default: true.
  • viewLevel is optional, what viewers of the shared notebook can open. Paid Google plans only.
    Supported values: full (the whole notebook), chat (chat only).

Provide people, link, allowCopies, viewLevel or any combination.

Responses
  • 200 OK

    The sharing after the change.

    {
      "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
      "people": [
        {
          "email": "[email protected]",
          "role": "owner",
          "name": "Jane Doe"
        },
        {
          "email": "[email protected]",
          "role": "editor",
          "name": "colleague"
        }
      ],
      "link": "public",
      "allowCopies": false
    }
    
  • 400 Bad Request

    A missing or malformed parameter, nothing to change, allowCopies with a restricted link, or a change to the owner. With nothing to change the message is Provide people, link, allowCopies and/or viewLevel.

    {
      "error": "[email protected] owns this notebook; its role cannot change",
      "code": 400
    }
    
    {
      "error": "allowCopies applies to a public link only",
      "code": 400
    }
    
    {
      "error": "Parameter people role of [email protected] must be one of editor, viewer, remove",
      "code": 400
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 403 Forbidden

    The notebook id was issued to a different API token, or Google does not allow the change on the account’s plan. viewLevel is refused on a free account.

    {
      "error": "Not allowed on account [email protected]'s plan (Google s0tc2d grpc 7)",
      "code": 403
    }
    
    {
      "error": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55 does not belong to this API token",
      "code": 403
    }
    
  • 404 Not Found

    The notebook was deleted, or its account is no longer configured.

    {
      "error": "Account [email protected] of user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55 is not configured",
      "code": 404
    }
    
  • 596 Account Error

    Google reported the account as signed out. While we re-check it, the answer is the first message below. Retry in about a minute. If it stays signed out, the account is paused, you receive an email, and the answer becomes the second message until you re-add it via Setup Gemini Notebook.

    {
      "error": "Google reported this account as signed out. We are re-checking it — please retry in about a minute. If it stays signed out, you will receive a re-add email.",
      "code": 596
    }
    
    {
      "error": "Account [email protected]: Google signed this account out. Re-add it at https://useapi.net/docs/start-here/setup-gemini-notebook",
      "code": 596
    }
    
  • 503 Service Unavailable

    Google is temporarily unavailable or is challenging our network. Retry in a few minutes. A 502 means Google answered with an unexpected error.

    {
      "error": "Google is temporarily unavailable (QDyure grpc 14), please retry",
      "code": 503
    }
    
Model

The sharing, as in GET /sharing.

{ // TypeScript, all fields are optional
  notebook: string
  people: {
    email: string
    role: string               // owner | editor | viewer
    name: string | null        // the person's Google display name
  }[]
  link: 'public' | 'restricted'
  allowCopies: boolean
  viewLevel?: 'full' | 'chat'  // only when set in this call, echoing the request
  error: string                // error responses only
  code: number                 // error responses only, the HTTP status
}
Examples
  • curl -X POST "https://api.useapi.net/v1/gemini-notebook/sharing" \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer …" \
       -d '{
         "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
         "people": [{ "email": "[email protected]", "role": "viewer" }]
       }'
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/gemini-notebook/sharing";
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${token}`,
      },
      body: JSON.stringify({
        notebook: "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
        link: "restricted",
        people: [{ email: "[email protected]", role: "remove" }]
      })
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v1/gemini-notebook/sharing"
    headers = {
        "Content-Type": "application/json",
        "Authorization" : f"Bearer {token}"
    }
    data = {
        "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
        "link": "public",
        "allowCopies": False
    }
    response = requests.post(apiUrl, headers=headers, json=data)
    print(response, response.json())
    
Try It