RAP API (v1)

Download OpenAPI specification:

OpenSAFELY Reproducible Analytic Pipeline (RAP) API

Backend status

Endpoints that provide information about backend status.

Get the status (flags) for all backends.

Get the status (flags) for all backends.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
Example

Backend 'test' operating normally

{
  • "backends": [
    ]
}

RAP Operations

Endpoints that perform operations on RAPs

Create a RAP with one or more actions

Create a RAP with one or more actions

Authorizations:
bearerAuth
Request Body schema: application/json
required
backend
required
string

The backend this RAP should run on

rap_id
required
string^[a-z0-9]{16}$

A unique identifier for this RAP

workspace
required
string[a-zA-Z0-9_-]+
repo_url
required
string
branch
required
string
commit
required
string^[0-9a-f]{40}$

commit sha

database_name
required
string
Enum: "default" "include_t1oo"
requested_actions
required
Array of strings non-empty

The explicitly requested actions to run as part of this RAP. Note that other actions may be run if they are unmet dependencies of the requested actions.

codelists_ok
required
boolean
force_run_dependencies
required
boolean
created_by
required
string

Username

project
required
string
orgs
required
Array of strings
object or null

Permissions and configuration to be applied to the execution of actions in this RAP.

Responses

Request samples

Content type
application/json
Example
{
  • "backend": "test",
  • "rap_id": "abcdefgh23456789",
  • "workspace": "test-study",
  • "branch": "main",
  • "commit": "07d5f283bb66f52a49933b016cf8dc144cfc7180",
  • "database_name": "default",
  • "requested_actions": [
    ],
  • "codelists_ok": true,
  • "force_run_dependencies": false,
  • "created_by": "test_user",
  • "project": "test-project",
  • "orgs": [
    ],
  • "analysis_scope": null
}

Response samples

Content type
application/json
Example

Jobs already created

{
  • "result": "No change",
  • "details": "Jobs already created for rap_id 'a1b2c3d4e5f6g7h8'",
  • "rap_id": "a1b2c3d4e5f6g7h8",
  • "count": 1
}

Cancel one or more actions.

Cancel one or more actions.

Authorizations:
bearerAuth
Request Body schema: application/json
required
rap_id
required
string^[a-z0-9]{16}$
actions
required
Array of strings non-empty

Responses

Request samples

Content type
application/json
Example
{
  • "rap_id": "a1b2c3d4e5f6g7h8",
  • "actions": [
    ]
}

Response samples

Content type
application/json

2 actions successfully cancelled

{
  • "result": "Success",
  • "details": "2 actions cancelled",
  • "count": 2
}

Get the status of RAPs

Get the status of RAPs

Authorizations:
bearerAuth
Request Body schema: application/json
required
rap_ids
required
Array of strings[ items^[a-z0-9]{16}$ ]

Responses

Request samples

Content type
application/json
Example
{
  • "rap_ids": [
    ]
}

Response samples

Content type
application/json
Example

success

{
  • "jobs": [
    ],
  • "unrecognised_rap_ids": [ ]
}