TenkaTenka
Sign in

Tenka Help Center › Developer area › Batch create /clientes (up to 200)

Batch

Batch create /clientes (up to 200)

POST/api/v1/clientes/lote

Creates several records in one call. Each item is independent: an invalid item does not undo the batch. The response tells, item by item, what went in and why the rest did not: 201 when everything went in, 207 when partial.

Key scope

Requires a read-write key (READ_WRITE) with a responsible user.

Parameters

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer followed by the key. Alternative: X-API-Key header.
Idempotency-KeyheaderstringnoIdempotency key (kept 24h, body up to 2 MB). Same key + same body returns the stored original response; same key + different body gets 409; same key while the first run is still going gets 409 with Retry-After: 5. A 5xx does not freeze the key.

Request body

Each item has the same body as the single creation: POST /api/v1/clientes. Limit: 200.

application/json
[ {…}, {…} ]  ·  { "itens": [ {…}, {…} ] }
NameTypeRequiredDescription
nomestringyesName.
emailstringnoE-mail.
cpfCnpjstringnoBrazilian tax id (CPF or CNPJ), as registered.
telefonestringnoPhone.

Response fields

NameTypeDescription
totalintegerTotal items.
criadosintegerItems created.
falhasintegerItems refused.
resultadosarrayOne result per item, in the order sent.
resultados[].indiceintegerItem position in the batch (starts at 0).
resultados[].statusstringcriado or erro.
resultados[].registroobjectThe created record (when status is criado).
resultados[].errostringThe refusal reason (when status is erro).

Status codes

HTTPDescription
201All items created
207Partial batch — see resultados[].erro
413Batch above 200 items

Error messages

HTTPMessage (erro field)When it happens
401chave de API ausente ou inválidaNo key header, revoked key or typo.
401chave sem empresa vinculadaThe key exists but is not linked to an account. Create another one in Settings › API.
403conta de demonstração: a API pública está desligada na vitrineThe call reached the demo account, where the public API is turned off.
403identidade da chave de API irregularThe account refuses keys with irregular identity (deactivated person or ownerless key). The body brings motivo and comoResolver.
429limite de requisições excedido (120/min)The key went over its per-minute limit. Wait for Retry-After.
403esta chave é somente leitura — gere uma chave com escopo de escritaWrite with a read-only key.
409a chave não tem usuário responsável; recrie a chave em Configurações → API para que os registros criados tenham autoriaThe write key has no responsible user: without authorship nothing is saved.
400Idempotency-Key é obrigatória em escrita desde 2026-12-01 (aviso publicado em 2026-09-01): sem ela, um retry de rede cria o registro duas vezes. Envie um valor único por operação no cabeçalho Idempotency-Key.Write without Idempotency-Key after the mandatory date.
409Idempotency-Key já usada com um corpo DIFERENTE — gere uma chave nova por operaçãoThe same Idempotency-Key came with another body.
409requisicao com esta Idempotency-Key ainda em processamento — aguarde e repitaThe same Idempotency-Key arrived while the first call was still running. Retry after Retry-After.
400lote vazioThe batch has no items.
413lote com {n} itens; o teto é 200 por chamadaThe batch exceeds the per-call item ceiling.
400envie um array de itens: [{...}] ou {"itens":[{...}]}The body is neither an array of items nor an object with itens.
207 · resultados[].erronome é obrigatórioCustomer or lead batch: nome missing or empty (the item comes back with status erro).