Files: generateIds

Stay organized with collections Save and categorize content based on your preferences.

Generates a set of file IDs which can be provided in create or copy requests. Try it now.


HTTP request



Parameter name Value Description
Optional query parameters
count integer The number of IDs to return. Acceptable values are 1 to 1000, inclusive. (Default: 10)
fields string The paths of the fields you want included in the response. If not specified, the response includes a default set of fields specific to this method. For development you can use the special value * to return all fields, but you'll achieve greater performance by only selecting the fields you need. For more information, see Return specific fields for a file.
space string The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive')
type string The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files')


This request requires authorization with at least one of the following scopes:


Some scopes are restricted and require a security assessment for your app to use them. For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.


If successful, this method returns a response body with the following structure:

  "kind": "drive#generatedIds",
  "space": string,
  "ids": [
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
space string The type of file that can be created with these IDs.
ids[] list The IDs generated for the requesting user in the specified space.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.