Skip to main content
This page walks through a complete setup using Prophecy’s REST and GraphQL APIs with curl. You create a team and add people to it, create a Prophecy In Memory fabric, store secrets and add connections, create a project and pipeline, publish a release, and then deploy and run pipelines. Each step links to the full API reference for the call it uses. Several calls return an ID that a later call needs, so keep a note of the values you collect as you go.

Before you start

Choose a terminal

The commands on this page use bash syntax, such as export, $(...), <<'EOF', and single-quoted JSON.
Windows PowerShell and Command Prompt do not run these commands as written. In Windows PowerShell, curl is a different command. Use Git Bash or WSL instead.

Set your Prophecy URL and token

Generate a personal access token, then run these two lines once in each new terminal window. Every command on this page reads them.
Check that both are set. This command prints the URL and the token’s length, never the token itself:

Read the examples

  • Anything in angle brackets, such as <FABRIC_ID>, is a placeholder. Replace the brackets too: <FABRIC_ID> becomes 3, not <3>.
  • REST calls go to $PROPHECY_URL/api/.... GraphQL calls all go to $PROPHECY_URL/api/md/graphql. See GraphQL API for the request format.
  • Responses come back on one line. The reference pages show them formatted. IDs and other values in example responses are samples.
  • In macOS Terminal, a % after a response is not part of the response. It marks that the response did not end with a new line.
To also see the HTTP status of any call, add -w '\nHTTP %{http_code}\n' after curl -sS.

Values you collect

Several calls return an ID that a later call needs. Keep a note of these as you go:

Set up users and teams

  1. Get your user ID with the get current user API. The call identifies you from your token.
    The response’s type tells you whether you are a Prophecy administrator for the whole instance (ClusterAdmin).
  2. Create a team with the GraphQL addTeam mutation. You become its admin. Save data.addTeam._id as <TEAM_ID>. Teams cannot be renamed later.
  3. Add people who already have a Prophecy account to the team with the add users to teams API. Use the team’s name, not its ID. (Replace <USER_EMAIL> and <TEAM_NAME> with actual values.)
    To invite people who don’t have an account yet, send "createUser": true, omit invitationStatus, and set isRequesterGlobalAdmin to true only if your account type is ClusterAdmin.
  4. Confirm the team’s members with the Team query.

Create a fabric

Create a Prophecy In Memory fabric with the create fabric API. A Prophecy In Memory fabric runs on DuckDB, needs no warehouse of your own, and creates its own default warehouse connection. Save data.id as <FABRIC_ID>.
The description is optional. Other provider values include databricks and bigquery, which also need a warehouse connection.

Add secrets and connections

A connection never holds a password or key directly. Store each one as a secret on the fabric first, then reference the secret from the connection.
  1. Store a secret with the add secret to fabric API. Save data.id as <SECRET_ID>. A connection refers to a secret by this ID and its name.
    Prophecy never returns the stored value again. If the value contains a single quote ('), it ends the JSON text early; write it as '\''.
  2. Add a connection with the add connection to fabric API. (Replace <FABRIC_ID>, <CONNECTION_NAME>, <PG_HOST>, <PG_PORT>, <PG_DATABASE>, <PG_USERNAME>, <SECRET_ID>, and <SECRET_NAME> with actual values.) For example, this request adds a PostgreSQL connection that references the secret holding the database user’s password:
    Keep the quotes around <PG_PORT>; the port is sent as text. Prophecy tests that it can reach the database before saving the connection. To skip the test, add "shouldTest": false.
For other connection types, use the matching properties object:
  • PostgreSQL (kind: postgres) needs one secret for the password.
  • SharePoint (kind: sharepoint) uses an Azure Active Directory (Microsoft Entra ID) app registration and needs one secret for the app’s client secret.
  • OneDrive (kind: onedrive) uses an Azure Active Directory (Microsoft Entra ID) app registration and needs two secrets: the app’s client secret and the OneDrive user name.

Create a project and release it

  1. Create a SQL project with the addProject mutation. Use the team’s ID, not its name. Save data.addProject._id as <PROJECT_ID>. (Replace <PROJECT_NAME>, <TEAM_ID>, <PROJECT_ID>, and other placeholders with actual values.)
    The project uses Simple Git on a Prophecy-managed repository. Everyone works on one dev branch, and publishing merges it into main.
  2. Add an empty pipeline with the create pipeline API. (Replace <PROJECT_ID> and <PIPELINE_NAME> with actual values.) Then build its steps in Prophecy.
  3. Commit the changes to dev with the commit mutation. (Replace <PROJECT_ID>, <COMMIT_MESSAGE>, and other placeholders with actual values.)
  4. Publish a release with the publish mutation. (Replace <PROJECT_ID>, <VERSION>, and <RELEASE_NOTES> with actual values.) This merges dev into main and tags the release <PROJECT_NAME>/<VERSION>. Each release needs a new version, for example 0.1.0.
  5. To confirm the exact version name, list the project’s releases with the Versions query. Entries with versionType Published are releases.

Deploy and run

  1. To run the pipelines on their schedules, deploy the release to a fabric with the deploy project API. Use the project and fabric names, not their IDs. (Replace <PROJECT_NAME>, <FABRIC_NAME>, and <VERSION> with actual values.) Skip this step if you only want to run pipelines on demand.
  2. Start a run with the trigger pipeline run API. (Replace <FABRIC_ID>, <PIPELINE_NAME>, <PROJECT_ID>, <VERSION>, and <BRANCH_NAME> with actual values.) Send fabricId as a number without quotes and projectId in quotes. Add "version": "<VERSION>" to run the published release, or "branch": "<BRANCH_NAME>" to run a branch. Without either, the run uses the project’s current working state. Save runId as <RUN_ID>.
  3. Check the run with the get pipeline run status API. Repeat the call until runStatus is SUCCEEDED or ERROR. On ERROR, errorMessage says what failed.
  4. To stop a run that is still in progress, use the cancel pipeline run API. (Replace <RUN_ID> and <FABRIC_ID> with actual values.)

Troubleshooting