> For the complete documentation index, see [llms.txt](https://docs.adsecure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adsecure.com/docs/guides/create-a-project.md).

# Create a Project

In this guide we're going to see how you can programmatically create some [analysis](/docs/development/concepts.md#analysis) over time.

> If you're not familiar with GraphQL, please have a look at its [dedicated section](/docs/graphql/overview.md) in this documentation.

The AdSecure platform is able to generate [analysis](/docs/development/concepts.md#analysis) at a defined interval based on your settings. This feature will help you to monitor some of your ads over time.

In this guide we're going to set up a complete [project](/docs/development/concepts.md#project). As it relies on concepts already covered in other guides, please be sure that you're already comfortable with them:

* [Select a specific Location](/docs/guides/select-a-specific-location.md)
* [Select a specific Device](/docs/guides/select-a-specific-device.md)
* [Configuring the Notification Service](/docs/guides/notification-service.md)
* [Managing Custom Alert Rules](/docs/guides/custom-alert-rules.md)

## Prerequisites

Before starting this guide, please be sure that you're ready to use our service by following the steps illustrated in the [Quickstart](/docs/development/quickstart.md) section.

## Simple case

For the purpose of this example, we're going to analyse a simple web page:

```bash
https://examples.adsecure.com/simple
```

In order to ask the AdSecure's [crawler](/docs/development/concepts.md#crawler) to analyse this content, we need to create a new [`Project`](/api/graphql/project.md) entry.

When you create a new [`Project`](/api/graphql/project.md), the AdSecure generate for you the corresponding [`Analysis`](/api/graphql/analysis.md) entries at regular interval of time. The [crawler](/docs/development/concepts.md#crawler) is then informed that a new task needs to be handled and start analysing the provided content.

For creating a new project we need to send a payload that contains the following fields:

* The `name` that's going to help us to easily remember the scope of this project. This value is also going to be used to generate the project's login.
* The list of `locations` that are going to be used (ref: [Select a specific Location](/docs/guides/select-a-specific-location.md)).
* The list of `notifications` that are going to be used (ref: [Configuring the Notification Service](/docs/guides/notification-service.md)).
* The list of `devices` that are going to be used (ref: [Select a specific Device](/docs/guides/select-a-specific-device.md)).
* The `alertRule` that you want to apply (ref: [Managing Custom Alert Rules](/docs/guides/custom-alert-rules.md)).
* The `interval` between two iterations of the project. The allowed values in milliseconds (`ms`) are: `900000`, `1800000`, `3600000`, `7200000`, `14400000`, `28800000`, `43200000` and `86400000`.
* The `maxIterations` that defines the amount of time the project has to be run before being stopped (max: `30`). When set to `0` (default value), the iterations don't stop automatically.
* The `content` which represent the content that you'll like to analyse.

**Query**

```bash
mutation {
  createProject(
    input: {
      name: "My automated project",
      content: "https://google.com"
      locations: [
        {
          login: "USA",
          type: STANDARD,
          provider: "OTHER"
        },
        {
          login: "USA",
          type: RESIDENTIAL,
          provider: "OTHER"
        },
        {
          login: "USA",
          type: MOBILE,
          provider: "T-MOBILE"
        }
      ],
      devices: [
        "google_pixel_2_chrome"
      ],
      alertRule: "landing_page_error",
      notifications: "notify-me-on-violation"
      interval: 900000
      maxIterations: 5
    }
  ) {
    id
    status
  }
}
```

**Response**

```json
{
  "data": {
    "createProject": {
      "id": "YW5hbHlzaXN8YThiYzk0M2ItNTY3ZS00NzA5LWIwOWItMTI1YmMzNGMxMjUwfDIwMTgtMDktMDI=",
      "status": "RUNNING"
    }
  }
}
```

This [project](/docs/development/concepts.md#project) is going to launch 3 analysis (one for each [location](/docs/development/concepts.md#location)) emulating a Google Pixel 2 each 15 minutes. After 5 iteration, the project is going to be paused.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adsecure.com/docs/guides/create-a-project.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
