How to use Salú Public API
This guide explains:- What the Public API is
- The difference between environments (
devandprd) - How to obtain and use your API Key (
x-api-key) - How to navigate the documentation (tabs, endpoints, examples)
- How to test an endpoint using the API Playground and
curl - How to interpret common responses and errors
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)
2. Environments: dev vs prd
There are two main environments:
- dev → development / staging environment
- prd → production environment (real data)
BASE_URL.
Endpoints follow the pattern:
For example, to list sectors:BASE_URL+path
3. Authentication and API Key
Most Public API routes require a header calledx-api-key.
3.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.
3.2. How to obtain your API Key
API Keys are managed through your organization’s Salú portal. Typical flow:- A user with the appropriate permissions logs into the Salú Portal.
- Navigate to the Integrations / Public API section (label may vary).
- Click Create new API Key.
- Provide a descriptive name for the key (e.g.
erp-payroll-integration) and, if applicable, select environment/scope. - The portal generates the key and shows the full value once.
- Copy the key and configure it in the system that will call the API (backend, Postman, Insomnia, etc.).
- Store the key securely (ideally in a vault or environment variable).
- If a key is exposed or compromised, revoke and generate a new one in the portal.
- You can have multiple active keys (for different systems or environments).
3.3. Example curl request
Assuming you are using the dev environment:
4. How to navigate the documentation
On the top of the site you will find several tabs. The most relevant here are:- API reference → generic examples
- Public API → Salú’s public API documentation
- The Public API overview page
- Optional links to additional guides or overview pages
- Branches
- Positions
- Sectors
- Employees
- Organizations
4.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
5. 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
5.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.).
5.2. Testing with curl
Pattern:
6. Understanding common responses and errors
6.1. Success responses
200 OK→ request succeeded (e.g. list, fetch)201 Created→ resource created successfully (onPOST)
6.2. Authentication errors
Common examples: Missing or invalid API Key- Status:
401or403 - Possible messages:
- That the
x-api-keyheader is being sent - No extra spaces or stray characters were copied
- You are using the correct key for the selected environment (dev vs prd)
6.3. Validation errors (422)
When a parameter is missing or invalid, you might see:
6.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. 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)?