Opérations
Importer un lot d'operations externes
Accepte jusqu’à 500 opérations, 10 000 notes et 20 Mio par requête. Le job est durable et chaque élément possède son propre résultat. category dans les notes est une chaine libre de 1 a 80 caracteres.
Scope requis : operations:write. Scopes et délégation.
Idempotence : header Idempotency-Key obligatoire. Pour reprendre la même mutation, réutiliser la même clé et le même contenu. Écritures et idempotence.
Importer un lot d'operations externes
curl --request POST \
--url https://partner-api.marko.fr/v1/operations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"operations": [
{
"external_id": "CF-OP-001",
"name": "Clubfunding Demo Deal",
"status": "instruction",
"data": {
"adresse": "12 rue de la Paix, Paris"
},
"kpi_snapshot": {
"date_reference": "2026-07-15",
"crd_total": 2500000
},
"notes": [
{
"external_id": "CF-NOTE-001",
"date": "2026-07-15T09:30:00Z",
"text": "Pièces complémentaires attendues.",
"category": "call"
}
]
}
]
}
'import requests
url = "https://partner-api.marko.fr/v1/operations/batch"
payload = { "operations": [
{
"external_id": "CF-OP-001",
"name": "Clubfunding Demo Deal",
"status": "instruction",
"data": { "adresse": "12 rue de la Paix, Paris" },
"kpi_snapshot": {
"date_reference": "2026-07-15",
"crd_total": 2500000
},
"notes": [
{
"external_id": "CF-NOTE-001",
"date": "2026-07-15T09:30:00Z",
"text": "Pièces complémentaires attendues.",
"category": "call"
}
]
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://partner-api.marko.fr/v1/operations/batch';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operations: [
{
external_id: 'CF-OP-001',
name: 'Clubfunding Demo Deal',
status: 'instruction',
data: {adresse: '12 rue de la Paix, Paris'},
kpi_snapshot: {date_reference: '2026-07-15', crd_total: 2500000},
notes: [
{
external_id: 'CF-NOTE-001',
date: '2026-07-15T09:30:00Z',
text: 'Pièces complémentaires attendues.',
category: 'call'
}
]
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operations: [
{
external_id: 'CF-OP-001',
name: 'Clubfunding Demo Deal',
status: 'instruction',
data: {adresse: '12 rue de la Paix, Paris'},
kpi_snapshot: {date_reference: '2026-07-15', crd_total: 2500000},
notes: [
{
external_id: 'CF-NOTE-001',
date: '2026-07-15T09:30:00Z',
text: 'Pièces complémentaires attendues.',
category: 'call'
}
]
}
]
})
};
fetch('https://partner-api.marko.fr/v1/operations/batch', 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://partner-api.marko.fr/v1/operations/batch",
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([
'operations' => [
[
'external_id' => 'CF-OP-001',
'name' => 'Clubfunding Demo Deal',
'status' => 'instruction',
'data' => [
'adresse' => '12 rue de la Paix, Paris'
],
'kpi_snapshot' => [
'date_reference' => '2026-07-15',
'crd_total' => 2500000
],
'notes' => [
[
'external_id' => 'CF-NOTE-001',
'date' => '2026-07-15T09:30:00Z',
'text' => 'Pièces complémentaires attendues.',
'category' => 'call'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"job_id": "88888888-8888-8888-8888-888888888888",
"status": "accepted",
"status_url": "/v1/import-jobs/88888888-8888-8888-8888-888888888888",
"results_url": "/v1/import-jobs/88888888-8888-8888-8888-888888888888/items",
"received_counts": {
"operations": 1,
"notes": 1
},
"idempotency_key": "client-nightly-2026-07-15-001",
"replayed": false
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Idempotency-Key must contain at most 255 visible ASCII characters without spaces.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "A valid bearer token is required.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The API key does not allow this operation.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "The idempotency key payload, external reference, target, or source conflicts with an existing write.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Unprocessable Content",
"status": 422,
"detail": "The request payload or parameters are invalid.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Precondition Required",
"status": 428,
"detail": "The Idempotency-Key header is required.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request rate limit was exceeded.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected server error occurred.",
"request_id": "req_example_partner_call"
}Authorizations
Headers
Body
application/json
Response
Successful response
⌘I
Importer un lot d'operations externes
curl --request POST \
--url https://partner-api.marko.fr/v1/operations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"operations": [
{
"external_id": "CF-OP-001",
"name": "Clubfunding Demo Deal",
"status": "instruction",
"data": {
"adresse": "12 rue de la Paix, Paris"
},
"kpi_snapshot": {
"date_reference": "2026-07-15",
"crd_total": 2500000
},
"notes": [
{
"external_id": "CF-NOTE-001",
"date": "2026-07-15T09:30:00Z",
"text": "Pièces complémentaires attendues.",
"category": "call"
}
]
}
]
}
'import requests
url = "https://partner-api.marko.fr/v1/operations/batch"
payload = { "operations": [
{
"external_id": "CF-OP-001",
"name": "Clubfunding Demo Deal",
"status": "instruction",
"data": { "adresse": "12 rue de la Paix, Paris" },
"kpi_snapshot": {
"date_reference": "2026-07-15",
"crd_total": 2500000
},
"notes": [
{
"external_id": "CF-NOTE-001",
"date": "2026-07-15T09:30:00Z",
"text": "Pièces complémentaires attendues.",
"category": "call"
}
]
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://partner-api.marko.fr/v1/operations/batch';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operations: [
{
external_id: 'CF-OP-001',
name: 'Clubfunding Demo Deal',
status: 'instruction',
data: {adresse: '12 rue de la Paix, Paris'},
kpi_snapshot: {date_reference: '2026-07-15', crd_total: 2500000},
notes: [
{
external_id: 'CF-NOTE-001',
date: '2026-07-15T09:30:00Z',
text: 'Pièces complémentaires attendues.',
category: 'call'
}
]
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operations: [
{
external_id: 'CF-OP-001',
name: 'Clubfunding Demo Deal',
status: 'instruction',
data: {adresse: '12 rue de la Paix, Paris'},
kpi_snapshot: {date_reference: '2026-07-15', crd_total: 2500000},
notes: [
{
external_id: 'CF-NOTE-001',
date: '2026-07-15T09:30:00Z',
text: 'Pièces complémentaires attendues.',
category: 'call'
}
]
}
]
})
};
fetch('https://partner-api.marko.fr/v1/operations/batch', 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://partner-api.marko.fr/v1/operations/batch",
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([
'operations' => [
[
'external_id' => 'CF-OP-001',
'name' => 'Clubfunding Demo Deal',
'status' => 'instruction',
'data' => [
'adresse' => '12 rue de la Paix, Paris'
],
'kpi_snapshot' => [
'date_reference' => '2026-07-15',
'crd_total' => 2500000
],
'notes' => [
[
'external_id' => 'CF-NOTE-001',
'date' => '2026-07-15T09:30:00Z',
'text' => 'Pièces complémentaires attendues.',
'category' => 'call'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"job_id": "88888888-8888-8888-8888-888888888888",
"status": "accepted",
"status_url": "/v1/import-jobs/88888888-8888-8888-8888-888888888888",
"results_url": "/v1/import-jobs/88888888-8888-8888-8888-888888888888/items",
"received_counts": {
"operations": 1,
"notes": 1
},
"idempotency_key": "client-nightly-2026-07-15-001",
"replayed": false
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Idempotency-Key must contain at most 255 visible ASCII characters without spaces.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "A valid bearer token is required.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The API key does not allow this operation.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "The idempotency key payload, external reference, target, or source conflicts with an existing write.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Unprocessable Content",
"status": 422,
"detail": "The request payload or parameters are invalid.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Precondition Required",
"status": 428,
"detail": "The Idempotency-Key header is required.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request rate limit was exceeded.",
"request_id": "req_example_partner_call"
}{
"type": "about:blank",
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected server error occurred.",
"request_id": "req_example_partner_call"
}