List units
curl --request GET \
--url https://needalert.app/api/v1/establishments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://needalert.app/api/v1/establishments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://needalert.app/api/v1/establishments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://needalert.app/api/v1/establishments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": 123,
"tenant_id": 123,
"default_locale": "pt_BR",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"category": "bakery",
"phone": "<string>",
"address_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"is_public": true,
"latitude": 123,
"longitude": 123,
"logo_url": "<string>",
"timezone": "<string>",
"status": "active",
"tenant_status": "active",
"tenant_country_code": "<string>",
"tenant_currency": "<string>",
"is_owner": true,
"can_write_catalog": true,
"permissions": [
"create_items"
],
"created_at": "<string>",
"updated_at": "<string>"
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"current_page": 2,
"from": 2,
"last_page": 2,
"links": [
{
"url": "<string>",
"label": "<string>",
"active": true
}
],
"path": "<string>",
"per_page": 1,
"to": 2,
"total": 1
}
}{
"message": "<string>",
"code": "unauthenticated",
"errors": {}
}{
"message": "<string>",
"code": "forbidden",
"errors": {}
}{
"message": "<string>",
"code": "not_found",
"errors": {}
}{
"message": "<string>",
"code": "too_many_requests",
"errors": {}
}Establishments
List units
The units the key can act on, paginated. Each one carries tenant_id, which the credit endpoints take, and permissions, the key’s permissions in that unit.
GET
/
establishments
List units
curl --request GET \
--url https://needalert.app/api/v1/establishments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://needalert.app/api/v1/establishments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://needalert.app/api/v1/establishments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://needalert.app/api/v1/establishments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": 123,
"tenant_id": 123,
"default_locale": "pt_BR",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"category": "bakery",
"phone": "<string>",
"address_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"is_public": true,
"latitude": 123,
"longitude": 123,
"logo_url": "<string>",
"timezone": "<string>",
"status": "active",
"tenant_status": "active",
"tenant_country_code": "<string>",
"tenant_currency": "<string>",
"is_owner": true,
"can_write_catalog": true,
"permissions": [
"create_items"
],
"created_at": "<string>",
"updated_at": "<string>"
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"current_page": 2,
"from": 2,
"last_page": 2,
"links": [
{
"url": "<string>",
"label": "<string>",
"active": true
}
],
"path": "<string>",
"per_page": 1,
"to": 2,
"total": 1
}
}{
"message": "<string>",
"code": "unauthenticated",
"errors": {}
}{
"message": "<string>",
"code": "forbidden",
"errors": {}
}{
"message": "<string>",
"code": "not_found",
"errors": {}
}{
"message": "<string>",
"code": "too_many_requests",
"errors": {}
}Authorizations
An API key created by the chain owner in the panel (Integrações → Nova chave), sent as Authorization: Bearer <key>. The key (<id>|na_…) is shown once, at creation; rotate or revoke it on the same screen. It is a server secret: never ship it in browser or mobile code.
Headers
Language of message and of translated content such as item names (pt-BR or en). Without it, the chain's default language.
Available options:
pt-BR, en Your own correlation id (1–64 characters of A-Za-z0-9._-), echoed back; generated when absent. Quote it to support.
Required string length:
1 - 64Pattern:
^[A-Za-z0-9._-]{1,64}$Query Parameters
Page number.
Units per page, up to 100.