---
title: "Create a filter for a dashboard in a scheduled email"
method: POST
path: "/gdc/md/{project_id}/obj/"
tags: ["automatic-emailing"]
---

# Create a filter for a dashboard in a scheduled email

`POST /gdc/md/{project_id}/obj/`

## Request

- Base URL: `https://secure.gooddata.com`
- URL: `https://secure.gooddata.com/gdc/md/{project_id}/obj/`
- Auth: none declared

When [scheduling an email with dashboards and reports](#section/Use-Cases/Schedule-an-email), you can choose to filter the dashboards before they are exported to PDF and sent to subscribers.
Filters are defined in an execution context object, and you have to have this object created in your project before scheduling an email.

When defining a filter in an execution context object, you will need the attribute ID, the displayForm ID (label ID), and the attribute value IDs.
For more information about those entities and how to find them, see [Determine the Attribute Value ID](https://help.gooddata.com/display/doc/Determine+the+Attribute+Value+ID).

Once you have an execution context object, you can add an `executionContext` parameter to the request body of the API call for scheduling an email and set it to the execution context URI:

```
"executionContext": "/gdc/md/{project_id}/obj/{execution_context_id}"
```

For more information about scheduling emails, see [Schedule an email](#section/Use-Cases/Schedule-an-email).

**Request body parameters**

* `dashboard` (string) specifies the dashboard for which the execution context object is created.

* `id` (string) specifies the identifier of a filter in the execution context object. Choose the identifier that makes sense for your project. Example: `daily.reports.exec.context`

## Path parameters

- `project_id` string, required

## Request body

- ExecutionContext
  - `executionContext` object, required
    - `filters` ExecutionFilterWithId[], required
      - `uri` string, uri, required
      - `promptUri` string, uri
      - `constraint` object
        - `type` string, required
        - `elements` string[]
        - `from` integer
        - `to` integer
      - `id` string, required
    - `dashboard` string, uri, required: dashboard URI
    - `user` string, uri: URI of the user's profile
    - `type` 'MdExecutionContextType' | 'MongoExecutionContextType', required
    - `name` string: name of the saved execution context

## Response `200`

_

- Uri: URI containing mandatory root key
  - `uri` string, uri, required

---

[API](https://skmtc.dev/gooddata/apis/gooddata-api-documentation.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/revisions/e5dc0ee6ab00?raw)
