> ## Documentation Index
> Fetch the complete documentation index at: https://docs.menuia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Criar Aplicativo

## Descrição

Este endpoint permite criar um novo aplicativo (gerando um `appkey`), associando-o a um dispositivo especificado. O nome do aplicativo é definido pelo usuário, e o dispositivo ao qual ele será associado é indicado por seu ID ou nome.

### Parâmetros

<ParamField body="authkey" type="string" required>
  Chave de autenticação do usuário.
</ParamField>

<ParamField body="message" type="string" required>
  Nome do aplicativo a ser criado.
</ParamField>

<ParamField body="criarApp" type="string" required>
  ID ou nome do dispositivo ao qual o aplicativo será associado.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://chatbot.menuia.com/api/developer \
    -H "Content-Type: application/json" \
    -d '{
      "authkey": "SUA_AUTHKEY_AQUI",
      "message": "Nome do App",
      "criarApp": "ID_OU_NOME_DO_DISPOSITIVO"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://chatbot.menuia.com/api/developer', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      authkey: 'SUA_AUTHKEY_AQUI',
      message: 'Nome do App',
      criarApp: 'ID_OU_NOME_DO_DISPOSITIVO'
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://chatbot.menuia.com/api/developer',
      json={
          'authkey': 'SUA_AUTHKEY_AQUI',
          'message': 'Nome do App',
          'criarApp': 'ID_OU_NOME_DO_DISPOSITIVO'
      }
  )
  ```

  ```php PHP theme={null}
  $response = Http::post('https://chatbot.menuia.com/api/developer', [
      'authkey' => 'SUA_AUTHKEY_AQUI',
      'message' => 'Nome do App',
      'criarApp' => 'ID_OU_NOME_DO_DISPOSITIVO'
  ]);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Sucesso theme={null}
  {
    "status": 200,
    "message": "Aplicativo criado com sucesso.",
    "appkey": "APPKEY_GERADA"
  }
  ```

  ```json 401 - Erro de validação theme={null}
  {
    "status": 401,
    "message": "validation.required"
  }
  ```

  ```json 404 - Dispositivo não encontrado theme={null}
  {
    "status": 404,
    "message": "Nenhum dispositivo encontrado."
  }
  ```
</ResponseExample>
