TenkaTenka
Sign in

Tenka Help Center › Developer area › Create /leads

CRM

Create /leads

POST/api/v1/leads

Creates a record. Requires a read-write key with a responsible user; send Idempotency-Key so you can retry without duplicates. Creation fires the account's webhooks and automations, just like the screen.

Today the API records the created lead's source as API.

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

NameTypeRequiredDescription
nomestringyesName.
emailstringnoE-mail.
telefonestringnoPhone.
origemstringnoLead source.
campanhastringnoSource campaign.

Response fields

NameTypeDescription
idintegerRecord identifier. Use it in by-id calls.
codigointegerRecord code as shown on screen.
nomestringName.

Status codes

HTTPDescription
201Created
401Missing or invalid key
403Key without write scope

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.
400JSON inválidoThe body is not a valid JSON object.
422nome é obrigatórionome is missing or empty.
422não foi possível criar: {detalhe}The write was refused (for example, a value longer than the field allows). Details in the message.