Tasks: lease

Acquires a lease on the topmost N unowned tasks in the specified queue. Try it now.

The developer's email address must be specified as a user_email in the acl element of queue.yaml.


HTTP request

POST https://www.googleapis.com/taskqueue/v1beta2/projects/project/taskqueues/taskqueue/tasks/lease


Parameter name Value Description
Path parameters
project string The project under which the queue lies.
taskqueue string The taskqueue to lease a task from.
Required query parameters
leaseSecs integer How long to lease this task, in seconds.
numTasks integer The number of tasks to lease.
Optional query parameters
groupByTag boolean When True, returns tasks of the same tag. Specify which tag by using the tag parameter. If tag is not specified, returns tasks of the same tag as the oldest task in the queue.
tag string Only specify tag if groupByTag is true. If groupByTag is true and tag is not specified, the tag is assumed to be that of the oldest task by ETA. I.e., the first available tag.


This request requires authorization with at least one of the following scopes (read more about authentication and authorization).


Request body

Do not supply a request body with this method.


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

  "kind": "taskqueue#tasks",
  "items": [
    tasks Resource
Property name Value Description Notes
kind string The kind of object returned, a list of tasks.
items[] list The actual list of tasks returned as a result of the lease operation.

Try it!

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

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

App Engine Documentation