Skip to main content
POST
/
integrations
/
external
/
files
/
batches
Upload de arquivos para lead ou negócio
curl --request POST \
  --url https://api.wegly.com.br/integrations/external/files/batches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form crm_lead_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
  --form crm_deal_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
  --form 'lead_code=<string>' \
  --form 'deal_code=<string>' \
  --form 'title=<string>' \
  --form 'note=<string>' \
  --form file='@example-file' \
  --form 'files=<string>' \
  --form files.items='@example-file'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "title": "<string>",
  "note": "<string>",
  "files_count": 123,
  "total_size": 123,
  "created_by": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "avatar": "<string>"
  },
  "crm_lead": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "title": "<string>"
  },
  "crm_deal": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "title": "<string>"
  },
  "crm_delivery": {},
  "files": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created_by": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      },
      "file_url": "<string>",
      "file_name": "<string>",
      "mime_type": "<string>",
      "size": 123,
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.

Body

multipart/form-data

Payload multipart para criação de lote público de arquivos.

crm_lead_id
string<uuid>

UUID do lead que receberá os arquivos.

crm_deal_id
string<uuid>

UUID do negócio que receberá os arquivos.

lead_code
string

Código numérico interno do lead que receberá os arquivos.

deal_code
string

Código numérico interno do negócio que receberá os arquivos.

title
string

Título opcional do lote.

Maximum string length: 150
note
string

Observação opcional do lote.

file
file

Campo alternativo para envio de um único arquivo.

files
file[]

Campo principal para envio de um ou vários arquivos.

Response

Lote criado com sucesso e já vinculado ao lead ou negócio informado.

id
string<uuid>
source
enum<integer>

Fonte do lote fixa em API.

Available options:
1
title
string | null
note
string | null
files_count
integer
total_size
integer
created_by
object
crm_lead
object
crm_deal
object
crm_delivery
object

Sempre null nesta rota pública.

files
object[]
created_at
string<date-time>
updated_at
string<date-time>