> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.muchau.com.br/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.muchau.com.br/_mcp/server.

# Criar um link de cadastro

POST https://dev.muchau.com.br/api/signup-links/
Content-Type: application/json

Cria uma URL pública compartilhável que direciona usuários finais pelo fluxo de Embedded Signup do WhatsApp. Quando completado, o número do usuário é automaticamente conectado à sua conta.

Reference: https://docs.muchau.com.br/api/reference/signup-links/criar-um-link-de-cadastro

## Authentication

- `Authorization` header (bearer token, required) — API Key in the format `mk_live_<43-chars>`. Obtain from the Dashboard or `POST /auth/api-keys`.

## Request

### Body (application/json)

This endpoint expects an object.

- `name` (string, required) — Display name for the signup link
- `slug` (string, optional) — URL-friendly identifier for the link. Auto-generated from name if not provided
- `maxUsages` (integer, optional) — Maximum number of times this link can be used. Unlimited if not set
- `expiresAt` (datetime, optional) — ISO 8601 datetime after which the link becomes inactive
- `customMessage` (string, optional) — Custom message displayed to end-users on the signup page
- `redirectUrl` (string, optional) — URL to redirect end-users to after completing the signup flow

## Response

### 201

Default Response

- `id` (string, required) — Unique identifier of the signup link
- `slug` (string, required) — URL-friendly slug used in the public link URL
- `name` (string, required) — Display name of the signup link
- `url` (string, required) — Full public URL for the signup link
- `active` (boolean, required) — Whether the signup link is currently active and accepting signups
- `usageCount` (double, required) — Number of times this link has been used
- `maxUsages` (double, required, nullable) — Maximum allowed usages, or null for unlimited
- `expiresAt` (string, required, nullable) — Expiration datetime in ISO 8601 format, or null if no expiration
- `customMessage` (string, required, nullable) — Custom message shown to end-users, or null if not set
- `redirectUrl` (string, required, nullable) — Redirect URL after signup completion, or null if not set
- `createdAt` (string, required) — ISO 8601 datetime when the signup link was created
- `updatedAt` (string, required) — ISO 8601 datetime when the signup link was last updated

## Errors

### 400 Bad Request Error

Default Response

- `error` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaError, required)

### 401 Unauthorized Error

Default Response

- `error` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaError, required)

### 409 Conflict Error

Default Response

- `error` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaError, required)

## Types

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaError

- `code` (string, required) — Machine-readable error code (e.g., UNAUTHORIZED, NOT_FOUND, VALIDATION_ERROR)
- `message` (string, required) — Human-readable error description
- `status` (integer, required) — HTTP status code
- `meta` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorMeta, optional)
- `error_shield` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield, optional)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorMeta

- `meta_code` (integer, required)
- `meta_message` (string, required)
- `meta_subcode` (integer, required, nullable)
- `type` (string, required, nullable)
- `fbtrace_id` (string, required, nullable)
- `error_data` (any, optional)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield

- ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield0
- ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield1

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield0

- `matched` (boolean, required)
- `entry_id` (string, required)
- `category` (enum, required)
  - Allowed values: `template`, `number`, `messaging`, `flow`, `permission`, `rate_limit`, `other`
- `severity` (enum, required)
  - Allowed values: `informational`, `recoverable`, `blocking`, `critical`
- `actor` (enum, required)
  - Allowed values: `developer`, `end_client`, `muchau`
- `human_message` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0HumanMessage, required)
- `action` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0Action, required)
- `action_url` (string, required, nullable)
- `docs_url` (string, required)
- `copy_text` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0CopyText, required)
- `version` (integer, required)
- `last_updated` (string, required)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShield1

- `matched` (boolean, required)
- `note` (ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf1Note, required)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0HumanMessage

- `pt` (string, required)
- `en` (string, required)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0Action

- `pt` (string, required)
- `en` (string, required)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf0CopyText

- `pt` (string, required, nullable)
- `en` (string, required, nullable)

### ApiSignupLinksPostResponsesContentApplicationJsonSchemaErrorErrorShieldOneOf1Note

- `pt` (string, required)
- `en` (string, required)

## Examples

**Request**

```json
{
  "name": "Cadastro WhatsApp Promoção"
}
```

**Response**

```json
{
  "id": "a1b2c3d4-e5f6-7890-ab12-cd34ef56gh78",
  "slug": "cadastro-whatsapp-promocao",
  "name": "Cadastro WhatsApp Promoção",
  "url": "https://dev.muchau.com.br/signup/cadastro-whatsapp-promocao",
  "active": true,
  "usageCount": 12,
  "maxUsages": 100,
  "expiresAt": "2024-12-31T23:59:59Z",
  "customMessage": "Bem-vindo! Complete seu cadastro para receber ofertas exclusivas.",
  "redirectUrl": "https://www.empresaexemplo.com/obrigado",
  "createdAt": "2024-06-01T10:00:00Z",
  "updatedAt": "2024-06-10T15:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://dev.muchau.com.br/api/signup-links/"

payload = { "name": "Cadastro WhatsApp Promoção" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://dev.muchau.com.br/api/signup-links/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Cadastro WhatsApp Promoção"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://dev.muchau.com.br/api/signup-links/"

	payload := strings.NewReader("{\n  \"name\": \"Cadastro WhatsApp Promoção\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://dev.muchau.com.br/api/signup-links/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Cadastro WhatsApp Promoção\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://dev.muchau.com.br/api/signup-links/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Cadastro WhatsApp Promoção\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://dev.muchau.com.br/api/signup-links/', [
  'body' => '{
  "name": "Cadastro WhatsApp Promoção"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://dev.muchau.com.br/api/signup-links/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Cadastro WhatsApp Promoção\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["name": "Cadastro WhatsApp Promoção"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://dev.muchau.com.br/api/signup-links/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```