<a id="5820b09ec19842d3b46500556ff75f35"></a><a id="5820b09e-c198-42d3-b465-00556ff75f35"></a>

> <strong>If you do not have technical knowledge you can take advantage of this integration through Zapier: </strong>[<strong>https://zapier.com/apps/padma-da67847/integrations</strong>](https://zapier.com/apps/padma-da67847/integrations)

## <a id="para-integração-com-sites-forms-etc" data-help-heading="true"></a>For integration with websites, forms, etc.

To create a contact and register an interaction. If the contact already exists, the interaction will be added to the found record. For contacts with status `student` at the school, the record is a comment; in other cases, it is a communication.

The communication is created with the current date. “NOW” respecting the school's time zone.

To identify an existing contact, PADMA first searches by email and, if not found, by phone, always within the same school. The search considers valid phones sent in `mobile`, `telephone` or `business_phone`. Name, RG, CPF and DNI are not used to locate the existing record. Without a match, a new contact may be created; so keep email and phone consistent across submissions.

### ENDPOINT

<strong>POST https://crm.derose.app/api/v1/form\_integration</strong>

For this integration, use an API key with access `form_integration`, linked to an enabled school. Keys `full_access` and `automations` also allow sending; `single_read` does not allow. The school key determines the destination account, without the need to send `account_name`.

Send the fields at the root of the JSON or the form, without wrapping them in `form_integration`, `contact` or `comment`.

<strong>Response</strong>

- `202` — `{"message":"QUEUED"}`: submission accepted for background processing. Does not confirm that the contact and interaction have already been recorded, nor returns the contact ID.
- `200` — `{"message":"DUPLICATE"}`: the same content was received again within the two-minute window and was not queued again.
- `400` — `{"message":"INVALID"}`: the form did not pass initial validation.
- `401` — text `access denied`: unauthorized access.
- `429` — `{"message":"RATE_LIMITED"}`, with `Retry-After: 60`: school limit exceeded. Wait at least 60 seconds before trying again.

A `200 DUPLICATE` does not prove that the previous submission was valid or processed.

### <a id="limites-de-requisições" data-help-heading="true"></a>Request limits

The endpoint allows <strong>120 authorized requests per school in a 60-second window</strong>, starting at the first counted request. All keys of the same school share this limit. Repeated submissions and invalid forms also count.

When the limit is exceeded, the response is <strong>HTTP 429</strong>, with body `{"message":"RATE_LIMITED"}` and header `Retry-After: 60`. The rejected submission is not queued nor recorded in the duplicate filter. Wait at least 60 seconds before trying again and distribute imports in batches over time. Avoid multiple simultaneous attempts after a 429.

### <a id="argumentos" data-help-heading="true"></a>Arguments

### <a id="obrigatorio" data-help-heading="true"></a>Required

- <strong>api\_key ( </strong>[How to generate and manage your school's API keys](/help/automatizaciones-e-integraciones-7cc61a2e/derose-app-api-keys-569af84e) )

The API key can be sent in `api_key` or in the header `X-API-KEY`. If both are present, `api_key` takes precedence.

Preferably provide `first_name`. If the name is absent, the system uses `friendly_name` or the part before the `@` of `email`. For submissions with only email, use a valid address. A phone alone is not sufficient.

### <a id="opcionais" data-help-heading="true"></a>Optional

> Only one value per field should be sent.

- <strong>first\_name, firstname, name</strong>

The contact's first name.

- <strong>friendly\_name, alias, aka</strong>

Contact's display name. Also used as the name when `first_name` not provided.

- <strong>last\_name, lastname</strong>

The contact's last name.

- <strong>email, e-mail</strong>

The contact's email

If invalid, it will be saved as custom data named 'invalid-email'

- <strong>telephone, telefone</strong>

The contact's phone

If invalid, it will be saved as custom data named `invalid-telephone`.

- <strong>mobile, mobile\_phone, mobile\_telephone, phone\_mobile</strong>

Cell phone. Invalid values are saved as `invalid-mobile`.

- <strong>business\_phone</strong>

Business phone. Invalid values are saved as `invalid-business_phone`.

- <strong>telephone\_country, phone\_country, country\_code, country\_name</strong>

Country used in phone interpretation. Prefer a code like `BR`. When omitted, the school's country is used.

- <strong>coefficient</strong>

Contact coefficient.

Accepted values: perfil, pmas, pmenos, fp, unknown

Default: 'unknown'

- <strong>tags, new\_tags, new\_tag\_names</strong>

Tags to add to the contact

- <strong>title, subject</strong>

Default: ‘contact through the website’

- <strong>message</strong>

Content of the interaction notes. When provided, it is combined with the title in the format `título: mensagem`. Without a message, the notes contain only the title.

- <strong>padma\_username</strong>

User to whom the interaction will be assigned. Default: `system`.

- <strong>birthday, aniversario, cumpleaños</strong>

Date of birth. Prefer `YYYY-MM-DD`. Also accepted are `birthday_day`, `birthday_month` and `birthday_year`. A date that cannot be interpreted is saved as `invalid-birthday`. A different existing date is preserved.

- <strong>marketing\_method\_names</strong>

Marketing methods separated by commas, associated with the communication. They do not apply when the interaction is recorded as a comment.

- <strong>rg, id\_rg; cpf, id\_cpf; dni, id\_dni</strong>

Identification documents. Send each document in its corresponding field.

- <strong>identification, identification\_label</strong>

Generic document and its type. The default type is `dni`.

- <strong>address, address\_street, address\_street\_name</strong>

Address. Provide one of these fields so that the complements are interpreted as part of the address: `address_street_number`, `address_door`, `address_postal_code`, `address_city`, `address_neighborhood`, `address_state`, `address_country` and `address_label` (or `address_category`).

- <strong>occupation, profession</strong>

Contact's profession.

- <strong>Any other word</strong>

Any other parameter sent will be saved as a custom data in the contact.

### <a id="assinaturas-e-metadados-opcionais" data-help-heading="true"></a>Optional signatures and metadata

`legal_signatures` accepts a list of objects with `title`, `signed_document_text`, `signature_data`, `signature_date`, `longitude`, `latitude` and `browser`. The signatory's name and email are obtained from the contact's fields. This list is an exception to the guideline of sending a single value per field.

`ip_address` (or `remote_ip`, `ip`) and `user_agent` (or `user-agent`, `ua`) are used as metadata for these signatures.

### <a id="exemplo-de-envio" data-help-heading="true"></a>Example of submission

```bash
curl --request POST 'https://crm.derose.app/api/v1/form_integration' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: SUA_CHAVE_DA_ESCOLA' \
  --data '{"first_name":"Ana","last_name":"Silva","email":"ana@example.com","tags":"baila","title":"Compra confirmada","message":"Evento: aula aberta. Pedido: EXEMPLO-123."}'
```