API changes

History of the Conta Ovos API changes, from the most recent to the oldest, and what they mean for those who already have an integration in production.

/en-us/apiBack to reference

Compatibility Policy

The API does not have URL versioning. Instead, we follow three rules so that integrations already in production don't stop working without warning:

  • New behavior gets new URL. When the data format changes, the old endpoint continues to respond exactly as before and the change goes the other way.
  • Fields can be added at any time. Treat the answer as an open object: ignore what you don't know rather than break it.
  • Discontinued endpoints remain online. They leave the reference, but continue responding — the list below shows the replacement for each one.
Do you have questions about any changes or do you need a deadline to migrate? Write to contaovosdengue@gmail.com.

Discontinued endpoints

They all continue to work and return exactly the same content as before. They just don't receive new fields.

EndpointUse in placeReason
/api/getmunicipalityblockspublic/api/getmunicipalityblocksvisitpublicThe name said blocks, but the return was always from visits to them.
/api/getmunicipalityedlvisitspublic/api/getmunicipalityedlmaintenancepublicEDLs receive maintenance, not visits; the fields went from edl_visit_* to edl_maintenance_*.

Change history

2026-09-11

Datas e coordenadas impossíveis passam a ser recusadas

Behavior change
  • Toda data de registro (instalação e coleta da leitura, visita, manutenção e instalação de EDL) precisa estar entre 01/01/1900 e hoje. Antes, a data de coleta só tinha o formato conferido, e um ano digitado com três dígitos, como 0202-08-14, era gravado. Carga retroativa de qualquer ano a partir de 1900 continua aceita.
  • Latitude ou longitude exatamente zero passam a ser recusadas em todos os endpoints: é posição que não foi registrada, não um lugar.
  • A resposta é 400 com a frase dizendo qual campo e por quê, por exemplo "Data de coleta: 0202-08-14 é anterior a 01/01/1900 — confira o ano."
Quem já manda datas e coordenadas reais não precisa mudar nada. Um envio que antes era aceito com data impossível ou coordenada zerada passa a receber 400 em vez de 200.

2026-09-11

Edição de registros, chave no cabeçalho e correções

News
  • Novos/api/posteditovitrap, /api/posteditcounting, /api/posteditblock, /api/posteditaction, /api/posteditedl, /api/posteditedlmaintenance e /api/posteditplace — editam registros existentes, com edição parcial, troca de código ou data e cópia opcional do endereço novo para as leituras antigas (atualizar_desde).
  • A chave pode ir no cabeçalho Authorization: Bearer SUA_CHAVE, em todos os endpoints. O ?key= continua aceito.
  • /api/postdeleteaction respondia erro 500 em toda chamada que achava o quarteirão; agora apaga a visita, inclusive as criadas pela própria API.
  • /api/postcounting: quando a coordenada da ovitrampa muda, os campos de endereço que não vieram no pedido passam a ser mantidos. Antes eram apagados.
  • Apagar uma leitura, visita ou manutenção pela API passou a recalcular a média do registro (ovos da ovitrampa, visitas do quarteirão, água da EDL).
Nenhuma integração existente precisa mudar. A única diferença visível para quem já integrou é a do /api/postcounting: um endereço que antes era apagado agora é mantido.

2026-08-01

Correct names for blocks and EDL maintenance

NewsDiscontinuation
  • New/api/getmunicipalityblocksvisitpublic — visits carried out in blocks, with one record per visit. Same content as the old one /api/getmunicipalityblockspublic, now with the right name.
  • New/api/getmunicipalityblockspublic-2 — the blocks themselves, one record per block, with polygon, total properties by type and average shares.
  • New/api/getmunicipalityedlmaintenancepublic — EDL maintenance, with the fields renamed from edl_visit_* to edl_maintenance_*.
  • Discontinued/api/getmunicipalityblockspublic e /api/getmunicipalityedlvisitspublic — are still on the air, with the same feedback as always.
No existing integrations need to change. Migration is only recommended for those who want the correct field names or block data separated from visits.

2026-07-30

Rural ovitrap and correction of the epidemiological week

News
  • /api/postcounting began to accept ovitrap_type_id when installing an ovitrap: 1 for urban (standard, when the field is not sent) and 2 for rural. Any other value returns 400 "Tipo de ovitrampa inválido".
  • Validation of the epidemiological week of /api/postcounting e /api/postaction started comparing year and week together. Previously, a date from a future year with a low number of weeks could be wrongly accepted.

2026-07-28

New public endpoints for EDLs, ovitraps and strategic points

News
  • /api/getmunicipalityedlspublic — EDLs registered by municipality.
  • /api/getmunicipalityovitrapspublic — registered ovitraps, with coordinates and average number of eggs.
  • /api/getmunicipalityplacespublic — strategic points, with type, subtype and area.
  • Everyone accepts country, state, municipality e page, like other public endpoints.

2026-04-23

Sending visits in blocks

News
  • New/api/postaction — records a visit with the properties worked on and the deposits found by class (a1, a2, b, c, d1, d2, e).
  • Sending block_group_id instead of block_id, the block is automatically created within the key's municipality.
  • Specific answers: 403 when the block is from another municipality and 409 when there is already a visit for that block, year and week.

2026-03-27

The key is now read from the URL

Behavior change

On all private endpoints, the key started to be read exclusively from the query string (?key=SUA_CHAVE), including in POST. Integrations that only sent the key in the form body start receiving 404 "Wrong key" — just move the key to the URL, keeping the other fields in the body.

2026-02-24

Removal of visits and blocks

News
  • /api/postdeleteaction — removes the visit from a block, identified by block_group_id e date.
  • /api/postdeleteblock — remove the block.

2026-02-04

Filter by period in private counts

News

/api/lastcounting began to accept date_start e date_end, allowing you to cut counts by date range instead of scrolling through every page.

2025-10-19

Incremental sync on public counts

News

/api/lastcountingpublic began to accept id (only occurrences from that identifier), date (inclusion date) e date_collect (data de coleta). These filters allow you to maintain a mirrored base without downgrading your entire history.

2025-03-18

Filter by period in public counts

News

/api/lastcountingpublic began to accept date_start e date_end.

2025-03-06

Ovitrap removal

News

/api/postdeleteovitrap — removes an ovitrap from the ovitrap_group_id, within the municipality of Chave.