Profiles API

Run your Profiles project programmatically and check its run status.
Available Plans
  • enterprise

You can use the Profiles API to programmatically run your Profiles project and check its run status.

Prerequisites

  • Set up a Profiles project in the RudderStack dashboard. Then, note down the Profiles project ID from the URL:
Profiles project ID from the URL
ResourcePermissions
ProfilesEdit

Token permissions for legacy RBAC system

If you are on the legacy Permissions Management (RBAC) system, your workspace-level Service Access Token should have minimum Editor permissions.

See this documentation for more information on generating the token.

workspace-level Service Access Token with Editor permission

Authentication

The Profiles API uses Bearer authentication in the following format:

Authorization: Bearer <SERVICE_ACCESS_TOKEN>

Base URL

Use the base URL for your API requests depending on your region:

Run project

You can trigger the run of a Profiles project using the below endpoint:

POST
/sources/<profilesID>/start
info

When you trigger a run through this API endpoint, RudderStack always fetches the latest code from your connected Git repository. You don’t need to use the Fetch latest button in the dashboard before triggering an API run.

The Fetch latest button on the Settings page of your Profiles project only applies to the RudderStack dashboard. RudderStack caches the project details (like the number of features) to power the UI. If you have recently pushed changes to your Git repository and want to see them reflected in the dashboard immediately, use this setting to refresh the cache.

Fetch latest button

Path parameters

profilesID
Required
String
ID of the Profiles project for which you want to trigger a run.

Request body

parameters
Optional
Array
Specify the parameters and their associated values to be passed for running the project. Multiple parameters can be passed. Each parameter and its associated value is a single string. Allowed parameters:

  • --model_refs
  • --begin_time
  • --end_time
  • --rebase_incremental

Example request

Example response

{
  "runId": "<run_id>"
}

Response codes

CodeDescription
200Run started for the Profiles project. RudderStack also returns a run ID for the project.
409Profiles project is already running for the specified source ID.

Get run status

You can get the run status of your Profiles project using the below endpoint:

GET
/sources/{profilesID}/runs/{runId}/status

Path parameters

profilesID
Required
String
ID of the Profiles project for which you want to trigger a run.
runId
Required
String
ID of the Profiles project’s run.

info
You can obtain the runId as the response of the above API endpoint (/sources/<profilesID>/start).

Example request

Example response

{
  "jobId": "string",
  "jobRunId": "string",
  "status": "running",
  "startedAt": "2024-05-31T06:48:08.228Z",
  "finishedAt": "2024-05-31T06:48:08.228Z",
  "tasks": [{
    "taskId": "string",
    "taskRunId": "string",
    "startedAt": "2024-05-31T06:48:08.228Z",
    "finishedAt": "2024-05-31T06:48:08.228Z"
  }]
}

Response parameters

ParameterTypeDescription
statusStringCurrent status of the run. Valid values are running and finished.
errorStringPresent only when the run finishes with errors. Contains the error details.

Response codes

CodeDescription
200Successfully retrieved the run status of the project.

Questions? We're here to help.

Join the RudderStack Slack community or email us for support