# Criar campanha

Criação de uma nova campanha com nome e alias. O alias da campanha deve ser um nome simple para facilitar o uso com a API. Recomenda-se que seja curto e não utilize caracteres especiais.

`POST https://apigw.wavy.global/api/v1/campaigns`

#### Parâmetros do JSON <a href="#par-metros-do-json" id="par-metros-do-json"></a>

\* Campo obrigatório

| Campo  | Detalhes                                         | Tipo   |
| ------ | ------------------------------------------------ | ------ |
| name\* | Nome da campanha                                 | String |
| alias  | Identificador da campanha para utilização na API | String |

> Exemplo de criação de uma campanha:

{% tabs %}
{% tab title="cURL" %}

```
curl -X POST \
  https://apigw.wavy.global/api/v1/campaigns \
  -H 'Content-Type: application/json' \
  -H 'authenticationToken: <authentication_token>' \
  -H 'userName: <e-mail>' \
  -d '{
        "campaign" : {
          "name": "My Campaign",
          "alias": "mycampaign"
        }
      }'
```

{% endtab %}
{% endtabs %}

Resposta

{% tabs %}
{% tab title="cURL" %}

```
{
    "status": {
        "error": false
    },
    "campaign": {
        "name": "My Campaign",
        "id": 1234,
        "alias": "mycampaign"
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
    "status": {
        "error": false
    },
    "campaign": {
        "name": "My Campaign",
        "id": 1234,
        "alias": "mycampaign"
    }
}
```

{% endtab %}

{% tab title="Python" %}

```
{
    "status": {
        "error": false
    },
    "campaign": {
        "name": "My Campaign",
        "id": 1234,
        "alias": "mycampaign"
    }
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
    "status": {
        "error": false
    },
    "campaign": {
        "name": "My Campaign",
        "id": 1234,
        "alias": "mycampaign"
    }
}
```

{% endtab %}

{% tab title="Java" %}

```
{
    "status": {
        "error": false
    },
    "campaign": {
        "name": "My Campaign",
        "id": 1234,
        "alias": "mycampaign"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-pt.sinch.com/apidecampanhas/instrucoes-e-boas-praticas/criar-campanha.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
