Create source labels

September 29, 2026

Table of contents

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

Create labels for a notebook’s sources in one of two ways:

  • auto lets Google group the sources by topic, the “Auto-label your sources” action of the Gemini Notebook web app. auto: "all" labels every source and replaces all existing labels, so every label gets a new id. auto: "unlabeled" labels only the sources that have no label yet and keeps the existing labels as they are.
  • name (with an optional emoji) adds one empty label of your own. Add sources to it with POST /labels/label.

The response is the notebook’s whole label set after the change, in the shape of GET /labels. The API does not retry this call, so after a 502, 503 or 504 check GET /labels before you try again.

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

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
  "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
  "auto": "all"
}
{
  "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
  "name": "The landing",
  "emoji": "🚀"
}
  • notebook is required, the notebook id. The id names its account, so no email is needed.
  • auto is optional, let Google label the sources by topic.
    Supported values: all (every source, replacing all labels), unlabeled (only sources without a label).
  • name is optional, the name of a new label of your own.
    Length: 1 to 100 characters.
  • emoji is optional, with name only, an emoji shown before the label’s name.
    Length: 1 to 16 characters.

Provide either auto or name, not both.

Responses
  • 201 Created

    The notebook’s labels after the change.

    {
      "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
      "labels": [
        {
          "label": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55:01a0466f-bd9f-48ab-a27d-5ae84181aa42",
          "name": "Apollo 11 Mission",
          "sources": [
            "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55:1761af94-f5aa-47f3-9539-0b4ebcd547f8",
            "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55:2744eb7c-399a-4573-bd32-126143ba9514"
          ]
        },
        {
          "label": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55:5973ba2b-845e-41b5-97b2-ef855d5746ad",
          "name": "The landing",
          "emoji": "🚀",
          "sources": []
        }
      ]
    }
    
  • 400 Bad Request

    A missing or invalid parameter, both auto and name, or emoji with auto.

    {
      "error": "Provide auto (all | unlabeled), or name for a label of your own",
      "code": 400
    }
    
    {
      "error": "emoji applies to a named label",
      "code": 400
    }
    
  • 401 Unauthorized

    Invalid API token.

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

    The id was issued to a different API token.

    {
      "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": "Not found on account [email protected] (Google agX4Bc grpc 5)",
      "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 (agX4Bc grpc 14), please retry",
      "code": 503
    }
    
Model
{ // TypeScript, all fields are optional
  notebook: string
  labels: {
    label: string              // user:<id>-<email>-label:<notebook uuid>:<label uuid>
    name: string
    emoji?: string
    sources: string[]          // source ids with this label
  }[]
  error: string                // error responses only
  code: number                 // error responses only, the HTTP status
}
Examples
  • curl -X POST "https://api.useapi.net/v1/gemini-notebook/labels" \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer …" \
       -d '{ "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55", "auto": "unlabeled" }'
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/gemini-notebook/labels";
    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",
        auto: "all"
      })
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v1/gemini-notebook/labels"
    headers = {
        "Content-Type": "application/json",
        "Authorization" : f"Bearer {token}"
    }
    data = {
        "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
        "name": "The landing",
        "emoji": "🚀"
    }
    response = requests.post(apiUrl, headers=headers, json=data)
    print(response, response.json())
    
Try It