curl --request POST \
--url https://app.eloout.com/api/v1/opportunities/batch-upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"pipelineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"value": 123,
"contact": {
"phone": "<string>",
"name": "<string>"
},
"client": {
"externalId": "<string>",
"taxId": "<string>",
"name": "<string>",
"legalName": "<string>"
},
"customFields": {},
"applyToClosed": true,
"lines": [
{
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"unitPrice": 123,
"lineTotal": 123,
"externalLineId": "<string>"
}
],
"discount": 123,
"source": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
pipelineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>',
stageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
value: 123,
contact: {phone: '<string>', name: '<string>'},
client: {
externalId: '<string>',
taxId: '<string>',
name: '<string>',
legalName: '<string>'
},
customFields: {},
applyToClosed: true,
lines: [
{
sku: '<string>',
name: '<string>',
quantity: 123,
unitPrice: 123,
lineTotal: 123,
externalLineId: '<string>'
}
],
discount: 123,
source: '<string>'
}
]
})
};
fetch('https://app.eloout.com/api/v1/opportunities/batch-upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.eloout.com/api/v1/opportunities/batch-upsert"
payload = { "items": [
{
"pipelineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"value": 123,
"contact": {
"phone": "<string>",
"name": "<string>"
},
"client": {
"externalId": "<string>",
"taxId": "<string>",
"name": "<string>",
"legalName": "<string>"
},
"customFields": {},
"applyToClosed": True,
"lines": [
{
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"unitPrice": 123,
"lineTotal": 123,
"externalLineId": "<string>"
}
],
"discount": 123,
"source": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"data": {
"results": [
{
"ok": true,
"status": 201,
"data": {
"id": "4f5a6b7c-8d9e-4f0a-9b2c-3d4e5f6a7b8c",
"result": "created",
"stageId": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"stageChange": null,
"protectedFields": []
}
},
{
"ok": false,
"status": 422,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request is not valid",
"details": {
"fieldErrors": {
"pipelineId": [
"Required"
]
}
}
}
}
]
}
}{
"ok": false,
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid or revoked API key"
}
}{
"ok": false,
"error": {
"code": "FORBIDDEN",
"message": "This API key lacks the opportunities:write scope",
"details": {
"requiredScope": "opportunities:write"
}
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request is not valid",
"details": {
"fieldErrors": {
"limit": [
"At most 100"
]
}
}
}
}{
"ok": false,
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests for this API key or its organization"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Create or update up to 50 opportunities by external ID
Each item is validated and runs in its own transaction, and gets its own result (ok, status, data or error); a failing or invalid item never rolls back or fails the others, and the request as a whole answers 200. A body that is not { items: [1–50 items] } is a 422 for the whole request, like the other request-level 422s (for example an invalid dryRun or a reused Idempotency-Key).
Requires the opportunities:write permission.
curl --request POST \
--url https://app.eloout.com/api/v1/opportunities/batch-upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"pipelineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"value": 123,
"contact": {
"phone": "<string>",
"name": "<string>"
},
"client": {
"externalId": "<string>",
"taxId": "<string>",
"name": "<string>",
"legalName": "<string>"
},
"customFields": {},
"applyToClosed": true,
"lines": [
{
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"unitPrice": 123,
"lineTotal": 123,
"externalLineId": "<string>"
}
],
"discount": 123,
"source": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
pipelineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>',
stageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
value: 123,
contact: {phone: '<string>', name: '<string>'},
client: {
externalId: '<string>',
taxId: '<string>',
name: '<string>',
legalName: '<string>'
},
customFields: {},
applyToClosed: true,
lines: [
{
sku: '<string>',
name: '<string>',
quantity: 123,
unitPrice: 123,
lineTotal: 123,
externalLineId: '<string>'
}
],
discount: 123,
source: '<string>'
}
]
})
};
fetch('https://app.eloout.com/api/v1/opportunities/batch-upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.eloout.com/api/v1/opportunities/batch-upsert"
payload = { "items": [
{
"pipelineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"value": 123,
"contact": {
"phone": "<string>",
"name": "<string>"
},
"client": {
"externalId": "<string>",
"taxId": "<string>",
"name": "<string>",
"legalName": "<string>"
},
"customFields": {},
"applyToClosed": True,
"lines": [
{
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"unitPrice": 123,
"lineTotal": 123,
"externalLineId": "<string>"
}
],
"discount": 123,
"source": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"data": {
"results": [
{
"ok": true,
"status": 201,
"data": {
"id": "4f5a6b7c-8d9e-4f0a-9b2c-3d4e5f6a7b8c",
"result": "created",
"stageId": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"stageChange": null,
"protectedFields": []
}
},
{
"ok": false,
"status": 422,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request is not valid",
"details": {
"fieldErrors": {
"pipelineId": [
"Required"
]
}
}
}
}
]
}
}{
"ok": false,
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid or revoked API key"
}
}{
"ok": false,
"error": {
"code": "FORBIDDEN",
"message": "This API key lacks the opportunities:write scope",
"details": {
"requiredScope": "opportunities:write"
}
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request is not valid",
"details": {
"fieldErrors": {
"limit": [
"At most 100"
]
}
}
}
}{
"ok": false,
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests for this API key or its organization"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Autorizaciones
Encabezados
1 to 255 printable ASCII characters without spaces, scoped to the API key. A retry of the same request (method, path, query and body) within 24 h gets the stored answer with Idempotent-Replayed: true and does not run again; the same key with another request is 422; while the first runs, 409. Answers of 500 and above are not stored: the key is released and a retry runs the write again. Ignored on a dry run.
255