curl --request POST \
--url https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attachmentUrl": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z",
"fileName": "Contrato_pdf",
"fileSize": "1346",
"description": "Contrato de prestaçao - assinado"
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments"
payload = {
"attachmentUrl": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z",
"fileName": "Contrato_pdf",
"fileSize": "1346",
"description": "Contrato de prestaçao - assinado"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attachmentUrl: 'https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z',
fileName: 'Contrato_pdf',
fileSize: '1346',
description: 'Contrato de prestaçao - assinado'
})
};
fetch('https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attachmentUrl' => 'https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z',
'fileName' => 'Contrato_pdf',
'fileSize' => '1346',
'description' => 'Contrato de prestaçao - assinado'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments"
payload := strings.NewReader("{\n \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments")
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 \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\n}"
response = http.request(request)
puts response.read_body{
"id": "685c39fcc2523944ecd171f7",
"createdAt": "2025-06-25T18:03:40.172Z",
"updatedAt": "2025-06-25T18:03:40.172Z",
"deletedAt": "2025-06-25T18:03:40.172Z",
"fileName": "my-product-175087",
"mimeType": "image/jpeg",
"url": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/f514f655-4897-416e-b5c1-bbc19aac0805",
"type": "IMAGE",
"size": "7642"
}Anexar arquivo ao lead
Adicionar um novo arquivo anexo ao lead
curl --request POST \
--url https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attachmentUrl": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z",
"fileName": "Contrato_pdf",
"fileSize": "1346",
"description": "Contrato de prestaçao - assinado"
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments"
payload = {
"attachmentUrl": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z",
"fileName": "Contrato_pdf",
"fileSize": "1346",
"description": "Contrato de prestaçao - assinado"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attachmentUrl: 'https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z',
fileName: 'Contrato_pdf',
fileSize: '1346',
description: 'Contrato de prestaçao - assinado'
})
};
fetch('https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attachmentUrl' => 'https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z',
'fileName' => 'Contrato_pdf',
'fileSize' => '1346',
'description' => 'Contrato de prestaçao - assinado'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments"
payload := strings.NewReader("{\n \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/{leadId}/attachments")
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 \"attachmentUrl\": \"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z\",\n \"fileName\": \"Contrato_pdf\",\n \"fileSize\": \"1346\",\n \"description\": \"Contrato de prestaçao - assinado\"\n}"
response = http.request(request)
puts response.read_body{
"id": "685c39fcc2523944ecd171f7",
"createdAt": "2025-06-25T18:03:40.172Z",
"updatedAt": "2025-06-25T18:03:40.172Z",
"deletedAt": "2025-06-25T18:03:40.172Z",
"fileName": "my-product-175087",
"mimeType": "image/jpeg",
"url": "https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/f514f655-4897-416e-b5c1-bbc19aac0805",
"type": "IMAGE",
"size": "7642"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Url do documento
"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/lead-attachments/d129a692-e5ab-42b3-b0e4-90ad9a12b068_2025-06-20T18%3A45%3A22.125Z"
Nome do documento
"Contrato_pdf"
Tamanho do documento
"1346"
Descrição do documento
"Contrato de prestaçao - assinado"
Response
ID do anexo
"685c39fcc2523944ecd171f7"
Data de envio do anexo
"2025-06-25T18:03:40.172Z"
Data de atualizacao do anexo
"2025-06-25T18:03:40.172Z"
Data de exclusão do anexo
"2025-06-25T18:03:40.172Z"
Nome do anexo
"my-product-175087"
Formato do anexo
"image/jpeg"
URL do anexo
"https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/f514f655-4897-416e-b5c1-bbc19aac0805"
Tipo do anexo
"IMAGE"
Tamanho do anexo
"7642"