Skip to content
CARP Docs
Ask AISystemLightDark
On this page

Backend API

The REST API of CARP Web Services (CAWS), generated from the OpenAPI document of its server.

Copy MarkdownOpen inOpen in GitHubView as MarkdownOpen in Scira AIOpen in ChatGPTOpen in ClaudeOpen in Cursor

The CARP Web Services (CAWS) REST API is how clients work with CARP's server. It manages studies, protocols and deployments, and receives the data that participants' phones upload.

Apps built with CARP Mobile Sensing (CAMS) call the API through the carp_webservices package. For the app side, see CARP Web Services.

The endpoint pages are generated from the OpenAPI document of the CAWS server at https://dev.carp.dk each time the docs are built, so they describe the API as deployed there.

Authentication

Endpoints need an access token from CARP's Keycloak server, sent in the Authorization header as Bearer <token>. The OpenAPI document describes the OAuth 2.0 password flow, with the token URL https://dev.carp.dk/auth/realms/Carp/protocol/openid-connect/token.

The self-signup endpoint is public: it creates an anonymous participant account from a study code.

Service endpoints

CAWS hosts the application services of CARP Core. Each service takes all of its requests at one endpoint, as a CARP Core request object such as CreateStudy, and its page lists the response that each request returns:

ServiceEndpointRequests
Study servicePOST /api/study-serviceCreate and configure studies, and set them live
Recruitment servicePOST /api/recruitment-serviceAdd participants and invite participant groups
Protocol servicePOST /api/protocol-serviceAdd study protocols and their versions
Protocol factory servicePOST /api/protocol-factory-serviceCreate a custom protocol
Deployment servicePOST /api/deployment-serviceCreate study deployments and register devices
Participation servicePOST /api/participation-serviceGet invitations and participant data
Data stream servicePOST /api/data-stream-serviceOpen, append to, read and close data streams

Handle compressed data takes the data stream requests gzip-compressed, at POST /api/data-stream-service-zip. For how request objects work, see Request objects in CARP Core.

The other groups hold resource endpoints, such as documents, collections, files and exports.

API playground

Each endpoint page has a playground that sends the request from your browser. CAWS rejects the CORS preflight request of every endpoint that needs a token, so from this site the playground reaches only the public self-signup endpoint. To send other requests, use the Swagger UI on the server or your own client.

Next steps

CARP Web Services

Upload data to CAWS from a CARP Mobile Sensing app.

Study service

Create, configure and manage studies.

Architecture

How the CARP components fit together, from protocol to upload.

Quick links

Page · DocumentationCARP DocumentationPage · DocumentationIntroductionPage · DocumentationQuickstartPage · DocumentationTerminologyPage · DocumentationArchitecture