POST Create company

Changed on

Com este endpoint, você pode criar uma subconta e, a partir disso, manipular a conta utilizando o seu respectivo token.

Esse processo permite que você gerencie subcontas de forma independente dentro do sistema.

Disponível apenas para contas revendedoras (outras contas recebem 501).

Regras:

  • company_brand e company_icon são imagens (PNG ou JPG) e exigem multipart/form-data; quando omitidas, a subconta herda a logo e o ícone da revendedora.
  • email precisa ser único entre empresas e usuários da plataforma.
  • Sem password, a plataforma gera uma senha e a envia por e-mail ao administrador; com password, nenhum e-mail é enviado.
  • Padrões: can_login = 1, editablevalidate = 1, unlimited = 0. O administrador é criado com status Active.
  • A subconta recebe um token de API de 337 caracteres (campo token da resposta e company.access.token), vinculado à sua revendedora.
  • limits só pode ser enviado por uma conta revendedora principal; uma subconta que tenta definir limites recebe 403.
post/api/companies

Request

  • Base URL
    https://app.plugsign.com.br
  • URL
    https://app.plugsign.com.br/api/companies
  • Auth
    API key in header Authorization

Request body

namestring required

Primeiro nome do administrador da empresa (até 100 caracteres).

last_namestring required

Sobrenome do administrador da empresa.

company_namestring required

Nome da empresa cadastrada (2 a 255 caracteres).

emailstring required

E-mail da empresa e do administrador da conta. Precisa ser único entre empresas e usuários da plataforma. O e-mail da empresa pode ser alterado depois; o do administrador não.

phonestring required

Telefone da empresa, somente números com DDD (10 a 15 caracteres). Se for um celular com WhatsApp, será usado para notificações.

company_brandstring binary

Logo da empresa (imagem PNG ou JPG, multipart/form-data). Se omitida, herda a logo da revendedora.

company_iconstring binary

Ícone da empresa (imagem PNG ou JPG, multipart/form-data). Se omitido, herda o ícone da revendedora.

cnpjstring required

CNPJ da empresa devidamente formatado ou apenas números.

addressstring required

Endereço da empresa.

passwordstring

Senha de acesso do administrador. Se omitida, a plataforma gera uma senha e a envia por e-mail; se informada, nenhum e-mail é enviado.

recive_whatsapp0 | 1 | 2

Recebimento de mensagens de WhatsApp pelo administrador: 0 = não recebe nada, 1 = recebe tudo, 2 = recebe somente solicitações.

recive_email0 | 1 | 2

Recebimento de e-mails pelo administrador: 0 = não recebe nada, 1 = recebe tudo, 2 = recebe somente solicitações.

mail_hoststring

Host do seu provedor de e-mails.

mail_fromstring

Qual endereço de e-mail está enviando a mensagem.

mail_usernamestring

Usuário de e-mail para autenticação (Na maioria dos casos é o mesmo do mail_from).

mail_passwordstring

Senha do e-mail.

mail_encryptionstring

Tipo de criptografia do SMTP. Valores aceitos: ssl ou tsl (use tsl para STARTTLS).

mail_portinteger

Porta de saída do provedor, somente números.

can_loginboolean

true/1 se a empresa está autorizada a acessar a plataforma, false/0 se não. Padrão: 1.

payment_endstring

Fim de vigência no formato d/m/Y (ex.: 31/12/2026). Precisa ser posterior à data atual.

plugzapi_instancestring

Instância do PlugZapi.

plugzapi_tokenstring

Token do PlugZapi.

plugzapi_account_tokenstring

Account token do PlugZapi.

editablevalidateinteger

1 - QR Code no topo do documento (Sem página final). <br><br> Ao solicitar a assinatura na última página, sem posicioná-la, a página final será sempre gerada automaticamente. <br><br> 2 - Sem QR Code no topo, apenas página no final. <br><br> 3 - Página final de validação e QR Code no cabeçalho (Criaremos páginas extras). <br><br> 4 - QR Code no rodapé do documento (Sem página final). <br><br> 5 - Página final de validação e QR Code no rodapé (Criaremos páginas extras). <br><br> 6 - QR Code (Texto) na lateral esquerda. <br><br> 7 - QR Code (Texto) na lateral direita. <br><br>

unlimitedboolean

Quando true/1, nenhum limite personalizado é aplicado à subconta. Padrão: 0.

webhook_header_namestring

Nome do header customizado que é enviado no envio dos webhook para a URI cadastrada.

webhook_header_valuestring

Valor do header customizado que é enviado no envio dos webhook para a URI cadastrada.

reseller_loginboolean

Define se a empresa revendedora está autorizada a realizar login na subconta para fins de suporte. Quando habilitado (true), o administrador da revendedora poderá acessar a conta da parceira de forma ilimitada. Quando desabilitado (false), esse acesso é bloqueado.

Response

200

messagestring

Mensagem de confirmação retornada pela API.

token_typestring

Tipo do token de autenticação gerado.

tokenstring

Token de API da subconta criada (337 caracteres). Use-o no header Authorization para operar em nome dela.

Example response

{
  "message": "Cliente cadastrado com sucesso!",
  "token_type": "Bearer",
  "token": "Ab3dEf...token de 337 caracteres...Xy9Z",
  "company": {
    "id": 148,
    "name": "Empresa XYZ",
    "email": "exemplo@teste.com.br",
    "phone": "11999999999",
    "cnpj": "11.111.111/1111-11",
    "address": "Rua dos anjos, 123, Centro, São Paulo",
    "company_name": "Empresa Exemplo LTDA",
    "can_login": 1,
    "editablevalidate": 1
  }
}

Changes

    • breaking

      request property was restricted to a list of enum values

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the request property's minLength was increased from 0 to 2

    • breaking

      the request property's minLength was increased from 0 to 10

    • breaking

      the request property type changed from string to integer

    • breaking

      the request property type changed from string to integer

    • breaking

      the request property type changed from integer to boolean, and format from int32 to no format

    • warning

      the request property's maxLength was set to 255

    • warning

      the request property's maxLength was set to 100

    • warning

      the request property's maxLength was set to 15

    • warning

      the request property's max was set to 7.00

    • warning

      the request property's min was set to 1.00

    • warning

      removed the optional property / from the response with the status

    • info

      the request property default value true was added

    • info

      the request property default value 1 was added

    • info

      the request property default value false was added

    • info

      added the new 0.00 enum value to the request property

    • info

      added the new 0.00 enum value to the request property

    • info

      added the new 1.00 enum value to the request property

    • info

      added the new 1.00 enum value to the request property

    • info

      added the new 2.00 enum value to the request property

    • info

      added the new 2.00 enum value to the request property

    • info

      added the new files_total enum value to the request property //

    • info

      added the new whatsapp enum value to the request property //

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property to the response with the status