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 insert or copy requests. Try it now.


HTTP request



Parameter name Value Description
Optional query parameters
maxResults integer Maximum number of IDs to return. Acceptable values are 1 to 1000, inclusive. (Default: 10)
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 This is always 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.