SuccessFactors OData API

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

When a company keeps its employee records in SAP SuccessFactors, other programs still need to read them: a payroll system wants the current job of every employee, a badge system wants new hires, a report wants last year’s managers. They do this through an application programming interface (API), a set of web addresses that answer requests with data. The SuccessFactors API for the core HR application, Employee Central, follows the OData standard: a request is an ordinary web address plus a few options, and the answer is a list of records. This page explains which records (entities) hold the person, the employment and the job, how the API handles the fact that an employee’s job changes over time (effective dating), how to write records with the upsert operation, how to send several requests at once, how to page through long answers, how a program proves who it is (OAuth 2.0), and what the newer OData v4 API changes. It is written against SAP SuccessFactors release 2H 2026 (version 2611) and applies to SuccessFactors only. Every request shown needs a SuccessFactors tenant (a customer’s own instance of the cloud service) and an account that is allowed to call the API, so no SuccessFactors request on this page was run. The one listing that was run is a small local model built with the SAP Cloud Application Programming Model (CAP), which only imitates how effective dates behave and is not SuccessFactors.

Before you read

Key terms

  • SuccessFactors: SAP’s cloud suite for human resources.

  • Employee Central: the core human resources application of SuccessFactors, which stores employee, employment and organization data.

  • Tenant: one customer’s own instance of a cloud service; API requests are addressed to the server of a tenant.

  • Effective dating: keeping a record as a series of time slices, each valid from a start date to an end date.

  • Upsert: one operation that updates a record when it exists and creates it when it does not.

  • OAuth 2.0: a standard in which a program first obtains a short-lived token and sends the token, not a password, with each request.

  • Pagination: returning a long answer in pages that the client fetches one after another.

The example used on this page

The page uses the HR example of this section: Example Trading Co. with Ana Torres (Sales Manager, hired 01.03.2024), Ben Okoye (Sales Clerk, hired 01.09.2024) and Chloe Martin (Warehouse Clerk, hired 15.01.2025). All values are invented. In SuccessFactors a person is identified by a person ID (property personIdExternal) and every employment by a user ID (property userId). The example borrows the personnel numbers 00001234, 00001235 and 00001236 as those identifiers so that the page matches the rest of the section. A real tenant assigns its own identifiers, and personnel numbers belong to SAP HCM, not to SuccessFactors. The page extends the example with one invented change: from 01.01.2026 a data change is recorded on Ana’s job, with the same title, so that the job has two time slices to query.

What the API is

The Employee Central OData API is described in SAP’s reference guide for OData v2 as the way to reach the data of Employee Central. SAP groups that data into three kinds of objects:

  • Employee objects hold personal and employment details. Personal objects are exposed as entities whose names start with Per, employment objects as entities whose names usually start with Emp.

  • Foundation objects hold the organization, pay and job structure of a company and are exposed as entities whose names start with FO.

  • Metadata Framework (MDF) objects extend the delivered foundation objects. Predelivered and custom MDF generic objects can be exposed as OData entities.

The version 2 API (OData v2) is the main Employee Central API. A request goes to an address of the pattern https://<api-server>/odata/v2/<Entity>, where the server is the API server of the tenant, and the description of one entity is served at https://<api-server>/odata/v2/<Entity>/$metadata. SAP also offers the Employee Central Compound Employee API, a SOAP-based API for extracting employee data for replication, which this page does not cover (a later page on Employee Central Payroll covers replication). The API Center in the Admin Center of the tenant has a data dictionary for every entity.

Two modes decide what a caller may see and do. In user mode, the permissions that were assigned to the caller (role-based permissions) decide which entities can be viewed and changed. In admin mode the caller has full access to the Employee Central OData entities and operations and overrides those permissions; SAP says it is used in a limited number of cases, mostly technical integrations. The upsert operation needs an additional permission. For the general rules see Users, Roles and Authorizations.

The four entities of the example

The official reference lists these four entities for people and jobs. The table shows what each page states about them.

Entity What it holds Key facts from the reference

User

An employment: organizational information such as department, division, location, job code and manager, plus some personal information such as name and email.

Not effective-dated: it cannot be used to query historical or future dates and only reflects the current state. A person can have more than one user but only one login account. Supports query, insert, merge or replace, and upsert.

PerPerson

Biographical information such as date and place of birth and date of death. HRIS element personInfo.

Business key personIdExternal. Not effective-dated. Supports query and upsert. Navigation properties include personalInfoNav and employmentNav.

EmpEmployment

The employment of a person: one row for each employment contract.

Business keys personIdExternal and userId. Not effective-dated. Navigation properties include personNav, jobInfoNav and userNav.

EmpJob

The job information of an employment: manager, department, job code, job title, position, company, cost center, pay grade, standard hours and more. HRIS element jobInfo.

Business keys userId, startDate and seqNumber. Effective-dated, and it supports multiple changes per day. Supports query and upsert.

Source: the pages for the User, PerPerson, EmpEmployment and EmpJob entities of the reference guide, linked under References.

The entities are connected by navigation properties, the OData way to follow a link from one record to a related one. The diagram shows the path that the official pages describe: a person has employments, an employment has job slices, and employment-related entities such as EmpJob can navigate to the User entity.

flowchart LR P["PerPerson
personIdExternal
not effective-dated"] E["EmpEmployment
personIdExternal + userId
not effective-dated"] J["EmpJob
userId + startDate + seqNumber
effective-dated"] U["User
current state only"] P -- "employmentNav" --> E E -- "personNav" --> P E -- "jobInfoNav" --> J J -- "employmentNav" --> E E -- "userNav" --> U

Figure: the entities of the example and the navigation properties between them that appear on the official entity pages. For EmpJob the page states that it can navigate to User without naming the property in the part read for this page.

For Ana the path is: the PerPerson record with personIdExternal equal to 00001234 has one EmpEmployment (hired 01.03.2024), whose jobInfoNav leads to the EmpJob time slices that describe her job.

Effective dating

A job changes over time, and a payroll run for March 2024 must see the job as it was then, not as it is today. The API therefore stores EmpJob as a series of time slices. Each slice has a start date and an end date, and SAP’s effective-dating page states the rules:

  • A record becomes effective between its start date and its end date. Effective dating ensures that there is no time gap between records.

  • When a new record is inserted, the end date of the previous record is automatically set to the day before the start date of the new record, and the new record is automatically assigned the end date 31.12.9999 (written 12-31-9999 on the page).

  • The request must not contain an end date. The system assigns end dates, and a different end date makes the system reject the record with errors. The start date must not carry a time, because any time in a date field is read as 00:00:00.

  • Effective-dated entities usually have the business key startDate; a few, such as EmpCostDistribution, name it effectiveStartDate.

For Ana the job then looks like this. The first slice is the hire; the second is the invented data change of the example.

userId startDate endDate eventReason

00001234

2024-03-01

2025-12-31

HIRNEW

00001234

2026-01-01

9999-12-31

DATACHG

The end date of the first slice is 2025-12-31 because inserting the second slice, starting 2026-01-01, closed it on the day before. The values HIRNEW and DATACHG are the event reasons that the official EmpJob examples use; the reasons available in a tenant are part of its configuration.

asOfDate, fromDate and toDate

Three URI parameters choose which slices a query returns. They are global Employee Central parameters, not standard OData options, so they are not preceded by a dollar sign. A query uses either asOfDate or the pair fromDate and toDate, never both, and the dates must be written YYYY-MM-DD or errors occur.

Parameter What the reference says

asOfDate

Returns the one record that is effective on the given date. When neither asOfDate nor a date range is given, asOfDate is today: a query of EmpJob made on 2021-03-29 returns the record effective on 2021-03-29.

fromDate and toDate

A date range query: returns the records effective between the two dates.

When a query uses $expand, the date parameters apply to the root entity and to the expanded entities too. For a picklist field the navigated entity is PicklistValue, which is not effective-dated, so the picklist’s own effectiveStartDate and effectiveEndDate are used.

For Ana’s two slices, the arithmetic of which slice answers which question is only date comparison. A date is effective in a slice when . For d = 2025-06-30 the first slice answers (2024-03-01 is not after 2025-06-30, and 2025-06-30 is not after 2025-12-31). For d = 2026-01-01 the second slice answers. A range from 2025-11-01 to 2026-02-28 touches both slices, because the range overlaps the first slice’s last two months and the second slice’s first two.

When an employee’s job changes several times on one day, EmpJob supports multiple changes per day. The boolean property effectiveLatestChange used as a filter in a date range query returns only the last updated record for each day.

A local model of effective dating (run)

The effect of the three rules above can be tried without any SuccessFactors tenant, with a small CAP project. It is a local teaching model. It is not SuccessFactors, it has no asOfDate parameter, and its function asOf is invented for this page. It shows only what "effective on a date" and "the previous record ends the day before" mean in practice.

The listings were run in a copy of the SAP lab on 2026-11-13 (CAP Node.js, @sap/cds 10.2.2, in-memory SQLite). The model has one entity with the key userId and startDate.

namespace local.hr;

entity JobRecords {
  key userId    : String(20);
  key startDate : Date;
  endDate       : Date;
  jobTitle      : String(40);
  eventReason   : String(10);
}

The service exposes the entity and a function that returns the records effective on a date. A handler closes the previous record the day before a new one starts and gives the new record the end date 9999-12-31.

import cds from '@sap/cds'

export default class JobService extends cds.ApplicationService {
  init() {
    const { JobRecords } = cds.entities('local.hr')

    this.before('CREATE', 'JobRecords', async (req) => {
      const rec = req.data
      const prev = await SELECT.one.from(JobRecords)
        .where({ userId: rec.userId, endDate: '9999-12-31' })
      if (prev) {
        const d = new Date(rec.startDate + 'T00:00:00Z')
        d.setUTCDate(d.getUTCDate() - 1)
        await UPDATE(JobRecords)
          .set({ endDate: d.toISOString().slice(0, 10) })
          .where({ userId: prev.userId, startDate: prev.startDate })
      }
      rec.endDate = '9999-12-31'
    })

    this.on('asOf', async (req) => {
      const { userId, date } = req.data
      return SELECT.from(JobRecords).where({
        userId,
        startDate: { '<=': date },
        endDate: { '>=': date }
      })
    })
    return super.init()
  }
}

The seed data holds the three hires of the example, each with end date 9999-12-31 and event reason HIRNEW. The requests below add Ana’s data change and then query. Source: the CAP documentation linked under References describes the before handler, cds.ql queries and OData functions used here.

curl -X POST http://localhost:4004/odata/v4/job/JobRecords \
  -H 'Content-Type: application/json' \
  -d '{"userId":"00001234","startDate":"2026-01-01","jobTitle":"Sales Manager","eventReason":"DATACHG"}'

The answer shows the new record with "endDate":"9999-12-31". Asking for all of Ana’s records ordered by start date shows that the first record was closed by the handler:

[
  { "userId": "00001234", "startDate": "2024-03-01", "endDate": "2025-12-31", "jobTitle": "Sales Manager", "eventReason": "HIRNEW" },
  { "userId": "00001234", "startDate": "2026-01-01", "endDate": "9999-12-31", "jobTitle": "Sales Manager", "eventReason": "DATACHG" }
]

The "as of" questions are answered by the function:

curl "http://localhost:4004/odata/v4/job/asOf(userId='00001234',date=2025-06-30)"
curl "http://localhost:4004/odata/v4/job/asOf(userId='00001234',date=2026-01-01)"

The first returns the slice with startDate 2024-03-01 and eventReason HIRNEW; the second returns the slice with startDate 2026-01-01 and eventReason DATACHG. A range question is a filter on the same two fields:

curl "http://localhost:4004/odata/v4/job/JobRecords?\$filter=userId eq '00001234' and startDate le 2026-02-28 and endDate ge 2025-11-01"

It returns both slices. Asking asOf for Ben on 2024-08-31, the day before he was hired, returns an empty list, which is what a query of a date outside any slice should show.

The outputs above are real output of this local model. Nothing on this page claims that SuccessFactors answers the same way beyond what the official pages state.

Querying with SuccessFactors syntax

The next listings use the syntax of the official reference. They require an SAP SuccessFactors system; not run here. <api-server> stands for the API server of a tenant.

Ana’s job slices from the start of 2024 to the end of 2026, selecting a few of the properties that the EmpJob page lists:

GET https://<api-server>/odata/v2/EmpJob?$filter=userId eq '00001234'&fromDate=2024-01-01&toDate=2026-12-31&$select=userId,startDate,endDate,eventReason,jobTitle,position,managerId&$format=JSON

The same job as it is on a single day, using asOfDate instead of a range:

GET https://<api-server>/odata/v2/EmpJob?$filter=userId eq '00001234'&asOfDate=2025-06-30&$format=JSON

Source: the effective-dated query page and the EmpJob page of the reference guide.

The person with the employment and the job, following navigation properties, uses $expand with the PerPerson entity. employmentNav and jobInfoNav are navigation properties named on the official PerPerson and EmpEmployment pages; a path through several of them is written with slashes, the style that the official EmpJob example shows in $select.

GET https://<api-server>/odata/v2/PerPerson?$filter=personIdExternal eq '00001234'&$expand=personalInfoNav,employmentNav/jobInfoNav&asOfDate=2026-03-01&$format=JSON

Because the date parameters also apply to expanded entities, the expanded jobInfoNav records are the slices effective on 2026-03-01, which for Ana is the slice that starts 2026-01-01. The sizes of the answer depend on the tenant’s data and on the caller’s permissions, so no response is shown.

Writing with upsert

The upsert operation is a custom function import that updates a record when it exists and inserts it when it does not. It is called with the HTTP method POST and, in the reference examples, the address https://<api-server>/odata/v2/upsert. The payload names the entity and key in __metadata and carries the properties. This is the shape of the official EmpJob example, adapted to Ana’s invented data change. The reference states that the required property eventReason must be included.

POST https://<api-server>/odata/v2/upsert
Content-Type: application/json

{
  "__metadata": {
    "uri": "EmpJob(seqNumber=1L,startDate=datetime'2026-01-01T00:00:00',userId='00001234')",
    "type": "SFOData.EmpJob"
  },
  "userId": "00001234",
  "seqNumber": "1",
  "eventReason": "DATACHG",
  "jobTitle": "Sales Manager"
}

Requires an SAP SuccessFactors system; not run here. Source: Use Case 2 of the EmpJob page of the reference guide. In the official example the response lists, for each record, a status of OK and an editStatus of UPSERTED.

The reference lists these rules for upsert:

  • An invalid property value makes that record fail, and the failure of one record does not affect the others.

  • For an effective-dated entity, the failure of one time slice makes all other time slices of the same external code fail.

  • Deleting is done with the upsert operation and the property operation set to DELETE; the property is only for upsert payloads.

  • The User entity supports upsert, PerPerson supports upsert with an incremental purge, and EmpJob supports incremental load.

Before inserting or updating employee information through the API, the reference advises checking whether an HRIS sync job is running in the instance: an active job can overwrite the values of certain fields, such as username, and cause inconsistent data.

Batch requests

A batch request sends several operations in one HTTP request. It is a multipart message with query requests and change sets. The reference states these processing rules:

  • The parts of a batch are processed one after another and independently of each other.

  • Every change set follows the all-or-nothing rule: if one operation in it fails, no change of that change set is applied.

  • Upserts in a change set follow the same rule. If several records are processed by one upsert in a change set, one failed record makes all the others fail, and the upsert parameter strictTransactionIsolate is ignored in a change set.

  • Each change set is processed independently, so a failed change set does not affect the others.

  • By default only the first upsert error of a change set is returned. Setting the parameter enableUpsertResponseExtensionInChangeset to true in the request returns all error messages.

  • An insert in a change set can carry a Content-ID header, and later requests in the same change set refer to the new entity with the Content-ID value prefixed with a dollar sign.

For a hire of Ana and Ben in one change set this means that if Ben’s record is invalid, neither person is created. A payroll interface that prefers partial success sends one change set per person instead.

The general mechanics of $batch are explained on OData and SAP Gateway.

Pagination

One query can return at most 1,000 records. The OData standard adds a __next link to an answer when more data exists, and the SuccessFactors API offers several ways to continue. Pagination works for entity sets only, not for function imports.

Method What the reference says

Client-side

The client sets $top (default and maximum 1,000) and $skip: $skip=2000&$top=500 returns the fifth page when the page size is 500. Every page re-runs the query, a page might hold fewer records than $top because of dirty data or business rule validation, and adding $orderby avoids data problems. It works well for UI5 lists and allows scrolling backwards.

Server-side, cursor

Switched on with &paging=cursor. The server keeps a database cursor and continues with the $skiptoken value in the __next link. Faster than client offset pagination and free of data loss and duplication, but sorting with $orderby is not supported, there is no going backwards, and (as the page states) it is currently supported for the EmpJob and User entities, MDF generic objects and most Employee Central foundation objects.

Server-side, snapshot

Switched on with &paging=snapshot. The server keeps the list of all business keys of the result. It fully supports $filter and $orderby and "last modified since" queries, but the first page can be slow because the full query runs for it, and it does not go backwards. If an entity does not support it, the server falls back to client offset pagination.

Do not change the __next URL: a modified link can give unexpected results. In Atom answers the ampersand is encoded as & and must be decoded before the link is opened, which is why JSON is the simpler format for a program. The page size can be customized with the parameter customPageSize; the default and maximum is 1,000. The trade-offs in the table are the ones the reference lists; for a full extract of all EmpJob slices the choice is between cursor and snapshot pagination. As of the 1H 2020 release, SAP lists PerPersonal, EmpJob, EmpEmployment, FOLocation and FOPayGrade among the Employee Central entities optimized for snapshot pagination.

Authentication

Every call needs credentials. SAP SuccessFactors supports OAuth 2.0 to authenticate API users and describes it as more secure than HTTP Basic authentication because it does not require the user’s password during authentication. The process overview on the OAuth page has five steps:

  1. Register the client application in SuccessFactors to obtain an API key.

  2. Obtain a SAML assertion from a trusted identity provider (recommended, for example Microsoft Azure) or use the sample code to generate one.

  3. Pass the SAML assertion and the API key (in the client_id field) with other information to generate an OAuth token.

  4. Use the generated token to call the API.

  5. Optionally check whether the access token has expired.

OAuth 2.0 also allows a third-party identity provider to be used for user management and provisioning. HTTP Basic authentication, in which the header is built from user name, company ID and password, is deprecated and SAP says it will soon be retired, recommending OAuth and OpenID Connect (OIDC), and, for a technical user, OIDC-based authentication where the calling application supports it. SAP Note 3666719 is the reference for the deprecation. A new integration should not use Basic authentication. The page Security: XSUAA and Cloud Identity Services explains the same idea of tokens on SAP Business Technology Platform (BTP).

OData v4

SAP also offers an OData v4 API framework for the SuccessFactors suite, built on the OASIS OData protocol version 4.01. Its addresses follow the pattern https://<api-server>/odatav4/<accessing-mode>/<namespace>/<service>/<version>/, for example a calibration service at https://<api-server>/odatav4/cal/CalSession.svc/. The metadata of a service is served by appending $metadata to its root. The differences to the version 2 API that matter to a newcomer:

Topic OData v2 (Employee Central) OData v4

Create, update, delete

Insert, merge, replace, delete and upsert.

Query with GET, create with POST, update with PATCH (merge) or PUT (replace), delete with DELETE. The upsert operation is no longer supported.

System query options

$filter, $select, $expand, $orderby, $top, $skip and more, plus the global parameters asOfDate, fromDate and toDate for Employee Central entities.

$format, $count, $orderby, $top, $skip and $expand are listed as supported, with built-in functions such as contains, startswith, year and tolower.

Preferences

Not described on the pages read for this one.

The Prefer request header with continue-on-error, include-annotations, maxpagesize, omit-values and return=representation or return=minimal.

Limits

Pagination of up to 1,000 records per query.

Framework limits that a module may override: URL length 8,000 characters, query and expand page size 200, expand depth 2, at most 3 expanded entities in total, filter depth 1, 20 filter parameters, total batch request size 50, inline insert depth 3.

Source: the supported features and access limits pages of the reference. The pages read for this one do not describe effective-dating parameters for v4, so the page does not say how a v4 service handles them; check the reference of the service you call. SAP describes OData v4 as the latest version of the OData protocol, which offers more features and capabilities; the entity pages read for this one (EmpJob, PerPerson, EmpEmployment) are documented with version 2 addresses.

Actions and functions are a v4 concept: a function has no side effects and returns a result, an action may change the database state. Both can be bound to an entity or an entity set and are called with the entity in the address, for example POST /LeaveRequest(4)/Reject in the official example of a bound action.

Choosing between the options

Question Answer that the official pages support

I need Ana’s job as it was on a past date.

Query EmpJob with asOfDate, or use fromDate and toDate for a range. User shows only the current state.

I need to create or change a job slice.

Upsert on EmpJob with an eventReason, in one change set per person if partial success is wanted.

I need all records of a large entity.

Use server-side cursor or snapshot pagination and follow __next without changing it.

I need to authenticate a program.

OAuth 2.0 with a registered client application, not HTTP Basic authentication.

I need the data replicated to a payroll system.

SAP names the Compound Employee API for extracting employee data for replication; later pages on Employee Central Payroll and the integration to SAP S/4HANA cover it.

Summary

  • The Employee Central OData API exposes people as Per* entities, employments as Emp* entities, foundation objects as FO* entities and extensions as MDF objects.

  • PerPerson and EmpEmployment are not effective-dated, EmpJob is, and User only shows the current state.

  • A new effective-dated record closes the previous one on the day before its start date and gets the end date 31.12.9999; the request never carries an end date.

  • asOfDate returns the record effective on one date and fromDate with toDate returns a range; they are not OData $ options, have the format YYYY-MM-DD, and apply to expanded entities as well.

  • upsert updates or inserts with POST; failures in a change set are all-or-nothing.

  • One query returns at most 1,000 records; use client-side, cursor or snapshot pagination and never edit the __next link.

  • Use OAuth 2.0; HTTP Basic authentication is deprecated.

  • OData v4 has no upsert (use POST, PATCH, PUT, DELETE) and has its own framework limits.

Try it

To do this by hand, follow the guide Query Effective-Dated Employee Data: it queries effective-dated employee data with as-of and range queries.