Getting started with Setyl’s API
This guide will assist you in getting started with Setyl’s API. To begin utilizing our API, please follow these steps:
Activate API for your company
To enable access to Setyl’s API, please contact Setyl support.
Note: Please note that you can only proceed with the subsequent steps once your company has been granted access to Setyl’s API.
Generate an API Key
To access Setyl’s API, you will need to obtain an API Key and a Consumer ID. To generate your API Key, please visit the Company Settings page.
Note: Please ensure that your Setyl account has the Owner role in order to access the page.
Click on the Add New API Key button to create a new API Key.
Note: Please make sure not to close the page before copying the Private API Key and Consumer ID. Once the page is closed, you will not be able to retrieve them again.
You have the flexibility to create multiple API Keys and utilize them to access your Setyl data through the API. In the event that your API Key is compromised, you can regenerate it by using the Rotate API Key option or, alternatively, delete the existing key and generate a new one.
Note: Keep your API Keys private!
Make your first call to API
You now have all the necessary steps completed to make your first call to Setyl’s API. Here’s an example of a curl command to the People API to help you get started. Remember to include the API Key as an Authorization: Bearer header and the Consumer ID as an X-Setyl-Consumer-ID header (refer to the example below).
curl -X GET \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Setyl-Consumer-ID: YOUR_CONSUMER_ID" \
https://app.setyl.com/api/v1/people
Replace YOUR_API_KEY with your actual API Key and YOUR_CONSUMER_ID with your Consumer ID in the curl command.
Note: It is essential to ensure that API calls to Setyl’s API are made server-side to prevent any potential token leakage.
Extras
Paging Data
List endpoints use cursor pagination. The People API returns at most 50 people per page. Start with GET /api/v1/people without a cursor, then pass the response’s cursor token as a query parameter to retrieve the next page. A response containing JSON "cursor": null marks the last page; stop there. Do not send null or the string "null" as the next request’s cursor.
Below is an example curl command for the People API that includes a cursor parameter to request the next page:
curl --get 'https://app.setyl.com/api/v1/people' \
--header 'X-Setyl-Consumer-ID: YOUR_CONSUMER_ID' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-urlencode 'cursor=CURSOR-TO-REQUEST-NEXT-PAGE'
Replace the credentials and cursor placeholders. --get puts the cursor in the URL query string, and --data-urlencode encodes the token, including characters such as +, / and =. Treat cursors as opaque strings: pass the returned token unchanged and let your HTTP client encode it once. The API also accepts a JSON cursor in a GET body, but query parameters work with clients and proxies that do not preserve GET bodies.
People and archived records
The main People endpoints return non-archived people, including people in onboarding, active and offboarding states. They exclude archived, removed, merged and internal support records.
| Request | Behaviour |
|---|---|
GET /api/v1/people | Lists non-archived people, with pagination. |
GET /api/v1/people/{uuidOrEmail} | Reads a non-archived person. Returns 404 for an archived person. |
PATCH /api/v1/people/{uuidOrEmail} | Updates a non-archived person. Returns 404 for an archived person. |
DELETE /api/v1/people/{uuidOrEmail} | Archives a person and returns their profile with state_name: "archived". Repeating the request returns 404. |
GET /api/v1/archives/people | Lists archived people, with pagination. |
GET /api/v1/archives/people/{uuidOrEmail} | Reads an archived person. |
PATCH /api/v1/people/{uuidOrEmail}/reinstate | Restores an archived person. An omitted, null or empty state_event defaults to mark_as_active; mark_as_onboarding and mark_as_offboarding are also supported. Returns 404 if the person is not archived. |
Archived profiles are read-only. Reinstate a person before updating their profile through the main endpoints.
Email addresses in paths
You can identify a person by UUID or email. Both /api/v1/people/alex@example.com and /api/v1/people/alex%40example.com are supported. Encode the email as a single URL path segment, especially when it contains reserved characters such as #, ? or /. Do not encode an already encoded value again.
Updating People fields
Send changes inside a person object. Use Content-Type: application/json for explicit JSON null; the string "null" is a string value, not a clearing instruction. Multipart requests are also supported, including avatar file uploads.
The following table describes PATCH /api/v1/people/{uuidOrEmail}. An omitted field usually keeps its current value. For creation, first_name, last_name, email and role_name must be supplied; optional fields can be omitted.
| Field | Omitted on PATCH | JSON null | Empty string "" |
|---|---|---|---|
first_name, last_name, email | Keeps the value | 422, required field | 422, required field |
phone, address, personal_identifier, notes, job_title, login_username, personal_email | Keeps the value | Clears to null | Clears to an empty string |
join_date, leave_date | Keeps the date | Clears the date | Clears the date to null |
location_type, contract_type | Keeps the value | Resets to none | Resets to none |
role_name | Keeps the role | Keeps the role | Keeps the role |
department_name, location_name, legal_entity_name | Keeps the assignment | Removes the assignment | Keeps the assignment |
manager_uuid | Uses manager_email only if supplied in this request | Removes the manager, even if manager_email is also supplied | Uses manager_email only if supplied in this request |
manager_email | Keeps the manager unless manager_uuid changes it | Removes the manager unless a non-empty manager_uuid is supplied | Keeps the manager unless manager_uuid changes it |
state_event | No explicit state transition | No explicit state transition | No explicit state transition |
avatar | Keeps the avatar | Removes the avatar | Removes the avatar |
custom_fields | Keeps all custom values | Not a valid map; returns 422 | Not a valid map; returns 422 |
A UUID key inside custom_fields | Keeps that field’s value | Clears that field | Depends on the field type; use null to clear |
For location_type, supported values are none, office_based, hybrid, home_based and field_based. For contract_type, they are none, employee, contractor, consultant, temporary and service_provider. Dates use YYYY-MM-DD. Existing automatic status rules based on dates still apply.
Relationship fields accept UUIDs or names; the manager accepts a UUID or email. Non-empty references must resolve to eligible records in the same company. Unknown, archived or foreign references return 422 and reject the entire request, including any requested clearing or other profile changes.
When creating or updating a person through OAuth MCP, these lookups are also limited to records accessible to the connected user. An inaccessible reference produces the same field-specific validation message as an unknown reference, such as Department name not found, and rejects the entire operation. MCP reports this as a tool error without returning the inaccessible record. API-key requests retain access to eligible records throughout the company.
For the two manager inputs, a non-empty manager_uuid or explicit manager_uuid: null takes precedence and ignores manager_email. If manager_uuid is omitted or an empty string, only the manager_email supplied in the same request is used. Omitting both fields preserves the manager; the stored manager email is never used as a fallback. Assigning a manager also updates the stored email, and clearing a manager removes both the assignment and stored email.
For example, this JSON PATCH body clears the manager and department while preserving the location and legal entity:
{
"person": {
"manager_uuid": null,
"department_name": null
}
}
Compatibility change: JSON null now clears these relationships; previously it preserved them. Clients that send null for unknown or unavailable data must omit those fields to preserve existing assignments. Empty strings continue to preserve assignments. Successful changes retain the normal audit trail and downstream processing.
In responses, optional text, dates, manager identifiers and avatar_url can be null. Unassigned department, location and legal_entity objects are also null. Empty text values can be returned as ""; clients should handle both representations.
People API errors
Read both the HTTP status and the message value. People validation errors use an array of strings; other errors such as 404 use a string.
| Situation | Status | Example response |
|---|---|---|
| Create or update using an email already used by another person in the company, including an archived person | 422 | {"message":["Company Email has already been taken or belongs to an archived person"]} |
| Unknown, archived or foreign relationship reference | 422 | {"message":["Department name not found"]} |
Unknown non-empty role_name on create or update | 422 | {"message":["Role name not found"]} |
Missing, null or empty role_name on create | 422 | {"message":["Role name is required"]} |
| Archived person requested through main GET, PATCH or DELETE | 404 | {"message":"Record not found"} |
Reinstate with a disallowed state_event, such as archive or remove | 422 | {"message":["Status is reserved"]} |
Reinstate with an unknown state_event | 422 | {"message":["Status is invalid"]} |
Role error compatibility change: invalid roles previously returned 404 with a string message. They now return 422 with a message array, without creating a person or saving any requested changes. A person that cannot be found still returns 404. On PATCH, omitted, null or empty role_name preserves the role while applying other valid changes.
Reinstatement can also fail other profile validations. Keep the complete message array when reporting an error; do not assume it contains only one item. Valid role titles include the company’s custom roles; use the exact title configured in the company.
Rate limiting
To ensure proper usage and protect the platform, Setyl’s API endpoints have rate limits in place. There are two types of rate limits: one based on the number of requests from a single IP address and another based on the total number of requests to Setyl’s API. These rate limits are calculated per minute.
Here are the rate limits:
- Per IP: 50 requests
- All requests: 500 requests
If these limits are exceeded, an HTTP status code of 429 will be returned. In such cases, you should retry the request after waiting for a while. The exact waiting time in milliseconds can be obtained from the RateLimit-Reset header, which is included in all responses with the 429 status code.
AI MCP Connector
If you want to connect Setyl to Claude, ChatGPT or another MCP-compatible AI client, you do not need an API key. Use the AI MCP Connector guide instead.