Table of contents
- 1. What is the Public API?
- 1.1. How company hierarchy works in Brazil (Branch / Sectot / Position) — Occupational Health context
- 2. Environments: dev vs prd
- 3. What is the client_integration_code?
- 4. Authentication and API Key
- 5. How to navigate the documentation
- 6. How to test an endpoint in practice
- 7. Understanding common responses and errors
- 8. Pagination and sorting on list endpoints
- 9. Quick checklist
- 10. Versioning, limits and best practices
- 11. Support and changes
1. What is the Public API?
The Public API is a set of HTTP routes that allow external systems to integrate with Salú.- You make an HTTP request (for example,
GET /v0/sector) - The API responds with data in JSON (lists, objects, etc.)
- Access is protected with authentication (
x-api-keyheader)
1.1. How company hierarchy works in Brazil (Branch / Sector / Position) — Occupational Health context
In Brazil, companies commonly organize employees using a simple three-level hierarchy: Branch (Unit / Worksite / Facility) → Sector (Area / Department) → Position (Job Role / Job Title) This structure is especially important in occupational health, because legal requirements (exposure risks, mandatory medical exams, surveillance programs, etc.) depend on where the employee works and what they do.Branch (Unit / Worksite / Facility)
What it means: A physical or legal location where people work. Why it matters in occupational health: Different units can have completely different exposure profiles, even within the same company. Examples: São Paulo Office Rio de Janeiro Factory Belo Horizonte Warehouse The unit answers: “Where does the employee work?”Sector (Area / Department)
What it means: A functional area inside a unit that groups people doing similar activities. Why it matters in occupational health: Two departments in the same building may involve very different risks (e.g., administration vs. maintenance vs. laboratory). Examples: Administration Production Maintenance Laboratory HR The department answers: “In which area do they work?”Position (Job Role / Job Title)
What it means: The specific function the employee performs. Why it matters in occupational health: This is usually the most important layer for defining: occupational risks (noise, chemicals, biological exposure, ergonomics, etc.) required medical exams health surveillance rules Examples: Administrative Assistant Machine Operator Welder Nurse Forklift Driver The job role answers: “What does the employee do?”Putting it all together
In Brazilian occupational health, requirements are typically defined by combining: Where the person works (Branch) + their work environment (Sector) + what they do (Position) Example: Two employees may work for the same company and even the same unit, but if they are in different departments and job roles, they may have completely different exposure risks and mandatory exams.2. Environments: dev vs prd
There are two main environments:
- dev → development / staging environment
- prd → production environment (real data)
The dev environment is intended for tests and validations and may present instability, as it receives frequent updates and new functionality continuously.
Therefore, we do not guarantee full (100%) availability in this environment.
Additionally, the dev environment is available Monday to Friday, from 9:00 to 20:00 (local time).
BASE_URL.
Endpoints follow the pattern:
For example, to list sectors:BASE_URL+path
3. What is the client_integration_code?
To make client integrations easier, we provide a string field called client_integration_code on some core entities — Branch, Sector, Position, and Employee.
You can use this field to store your own internal identifier, allowing you to map records from your system to records in our platform. This makes integrations simpler, safer, and more traceable.
Additionally, this same field is available in the list filters for these entities and can be used as a search parameter, which helps with data retrieval and synchronization during integrations.
4. Authentication and API Key
Most Public API routes require a header calledx-api-key.
4.1. Important headers
x-api-key→ required: identifies the client calling the API
x-api-key, or if it is invalid/expired, the API will return an authentication error.
4.2. How to obtain your API Key
API Keys are managed by your organization in the Salú Portal. Typical flow:- A user with the appropriate permissions accesses the Salú Portal.
- Navigate to Settings / Api Key.
- Click New Api.
- Provide a descriptive name for the key (e.g.
erp-payroll-integration). - Select the organizations the API will have access to, when applicable.
- The portal generates the key and displays the full value once.
- Copy the key and configure it in the system that will make the calls (backend, Postman, Insomnia, etc.).
- Store the key in a secure place (ideally a vault or environment variable).
- If the key is exposed/compromised, revoke it and generate a new one in the portal.
- You can have multiple active keys (for different systems or environments).
4.3. Example curl request
Assuming you are using the dev environment:
4.4. Example of a creation (POST) with JSON body
5. How to navigate the documentation
On the left side of the site you will see some sections. The most important here are:- How to use → general API context
- Endpoints → Salú Public API specific documentation
- The Salú Public API overview page
- Branches
- Positions
- Sectors
- Employees
- Organizations
- Pendencies
5.1. What each endpoint page shows
On an endpoint page (for example Public List Sectors) you will typically see:- Endpoint title
- Method + path (e.g.
GET /v0/sector) - A description of what the route does
- Authentication info (e.g.
x-api-keyheader) - Parameters:
- Path parameters (e.g.
:sector_id) - Query parameters (e.g.
is_active,order_by) - Headers
- Path parameters (e.g.
- Example request (usually
curl) - Example response (JSON)
- The API Playground, where you can test the route directly in the docs
6. How to test an endpoint in practice
You have two main options:- Use the API Playground in the documentation
- Use tools such as Postman, Insomnia or
curlin your terminal
6.1. Testing via the API Playground
- Open the Public API section.
- Choose an endpoint (for example Public List Sectors).
- In the Playground header:
- Confirm the server/environment (dev or prd).
- In Headers, set:
x-api-key→ your key
- Fill in any parameters you want (query, path, etc.).
- Click Send.
- Inspect the JSON response in the response panel (status
200,4xx,5xx, etc.).
6.2. Testing with curl
Pattern:
7. Understanding common responses and errors
7.1. Success responses
200 OK→ request succeeded (e.g. list, fetch)201 Created→ resource created successfully (onPOST)
7.2. Authentication errors
Typical cases: Missing or invalid API Key- Status:
401or403. - Possible responses:
- That the
x-api-keyheader is being sent. - That there are no extra spaces/stray characters from copy-paste.
- That you are using the correct key for the selected environment (dev vs prd).
7.3. Validation errors (422)
When a parameter is missing or invalid, you may see something like:
- Check the docs for all required fields.
- Fix and try again.
7.4. Server errors (5xx)
If you receive a 500 or similar error:
- Retry after a few seconds.
- If the issue persists, collect:
- The endpoint called
- Environment (dev or prd)
- Approximate time
- The error response body
- Send these details to Salú support.
7.5. Rate limiting (429)
The API enforces rate limiting per API key to ensure stability, security, and fair usage of the service.
When the allowed number of calls within a given period is exceeded, the API returns HTTP 429 (Too Many Requests) with a response like:
- Limit: 300 requests every 5 minutes
- Criterion: combination of source IP + API key (
x-api-key) - Scope: applied only to configured public routes
- When the limit is exceeded, the API key is temporarily blocked for approximately 5 minutes.
- During this period, new requests receive a 429 response.
- In cases of repeated abuse, the API key may be permanently blocked, preventing any further use of the credential.
7.6. Not found (404) and bad request (400)
404 Not Found→ the requested resource does not exist (e.g., non-existent ID).400 Bad Request→ the request is invalid (e.g., inconsistent parameter combination). Inspect the JSON body for details.
8. Pagination and sorting on list endpoints
Most list endpoints support pagination and sorting via query parameters. Example request:page→ which page to fetch. If omitted, the default is0.limit→ number of items per page. If omitted, the default is20.order_by→ which field to sort by. The default is the creation date field (usuallycreated_at). You may use another field present in the resource schema (e.g.name,updated_at,status, etc.) as long as that field exists in that resource’s payload.order_dir→ sort direction. Acceptsasc(ascending) ordesc(descending).
total→ total number of records for the current filter.page→ current page (zero-based).page_size→ number of items returned per page.total_pages→ total number of available pages given thepage_size.next_page→ whether there is a next page (true/false).
- If you don’t send
pageandlimit, the defaults are used:page=0andlimit=20. - The
order_byvalue depends on the resource fields. Check the specific endpoint’s schema/structure to see which fields are available. - Typically,
order_by=created_atwithorder_dir=ascreturns items from oldest to newest; withorder_dir=desc, from newest to oldest.
page_size may appear as an alias for limit. When present, both have the same effect; we standardize on limit in this documentation.
9. Quick checklist
Before reporting a problem, verify:- Are you using the correct base URL (dev vs prd)?
- Are you sending the
x-api-keyheader? - Is the API Key for Salú Public API?
- Did you fill mandatory parameters?
- Did you read the error JSON (field
detail)?
10. Versioning, limits and best practices
- Versioning: paths use the
v0prefix. Backward-incompatible changes will result in a new version (v1,v2, …). We will communicate breaking changes in advance. - Rate limiting: respect the limits informed in the documentation. On
429, implement retries with exponential backoff. - Timeouts: use reasonable client-side timeouts. Requests can fail due to transient unavailability.
- Idempotency: for critical write operations, we recommend client-side idempotency (for example, avoiding sending the same command multiple times).
- Security: HTTPS only. Do not share your
x-api-key. Store it in vaults/environment variables. - Formats: JSON responses in UTF-8. Dates in ISO 8601; unless indicated otherwise, consider UTC timezone.
11. Support and changes
- Support: when opening a ticket, include the endpoint, environment (dev/prd), approximate time, payload, and the full response (including status and relevant headers).
- Changes and deprecations: follow announcements in the documentation. Deprecated endpoints will have a coexistence period whenever possible.