API Reference

CrewBrain REST-API Reference 

The CrewBrain REST API allows you to access the system data from outside and create new data or modify existing data. Many different functions are available for this, with which you can access base data (employees, freelancers, categories, etc.) as well as transaction data (jobs, etc.).

Table of content 

Authentification 

Communication with CrewBrain is only possible via encrypted SSL connections. CrewBrain provides two variants for authentication: HTTP basic authentication and an access token. The latter should be used preferably so that no password has to be stored in the API implementation.

Basic Authentication 

HTTP basic authentication is the simplest login method. For this, you simply provide a valid username and associated password with each call to the REST API.

Accesstoken 

By using an access or API token, the user"s password only needs to be requested once for initial authentication; the access token is used for further communication. These tokens have a validity of 14 days after the last use in CrewBrain and can be managed by each user under "My Account" > "Active Sessions".

All access tokens in CrewBrain are bound to a user and entitle to the same functions as the user is entitled to. To get an access token, the following GET request must be executed with Basic Authentication (username & password):

GET https://your-name.crewbrain.com/api/accesstoken

The response to this request is a JSON object that contains a valid access token. This can be used for further requests instead of the basic authentication. For this purpose the token is passed in the X-API-KEY header.

URI structure 

The CrewBrain REST API allows access to resources (data types) via URI paths. To use the REST API, your application must make an HTTP request and evaluate the response. The CrewBrain API uses the JSON format and HTTP status codes as the return format as well as the HTTP methods such as GET, POST, PUT and DELETE. URIs for the CrewBrain REST API have the following structure:

https://your-name.crewbrain.com/api/ressource-name

Technical IDs 

Each object is stored in the database of CrewBrain with a unique ID. This ID is stored in the ID field of the same name in each object and also serves to identify the objects in the API (e.g. as jobID, docID, etc.). Parallel to this the field FremdID exists in all base data objects, which can contain an ID of a foreign system with up to 32 characters. You can store the technical ID of external systems in this field. The corresponding objects can then also be selected directly in the API using the external ID:

https://your-name.crewbrain.com/api/ressource-name/FremdID:abcdefghijklmnopqrstuvwxyz

Date values 

The interface is based on the format ISO 8601 as the basis for the date values. A date is issued by the API in the form 2019-01-01, a date with a time in the form 20190101T235959Z. When you send data to the API, the interface also accepts the formats 20119-01-01T23:59:59Z and 2019-01-01T23:59:59+00:00 in addition to these formats. The values are automatically converted by the interface into the time zone stored in CrewBrain.

Encoding 

The encoding for all calls is UTF-8, both for the JSON object sent to the REST API and for the responses returned to the client.

Rate limits 

The following rate limitations apply to the use of our API::

If one of these limits is exceeded, the API responds with HTTP status code 429 - Too Many Requests.

Ressources 

Jobs & Projects 

api/calendar/ 

Provides access to a calendar view

> Get calendar POST api/calendar/
api/jobs/ 

Provides access to the jobs of the currently logged in user

> Get jobs GET api/jobs/
api/job/ 

Provides access to jobs and their information

> Read job GET api/job/{jobId}
> Create job POST api/job/
> Update job PUT api/job/{jobId}
> Delete job DELETE api/job/{jobId}
> Search jobs POST api/job/suche
> Get all documents GET api/job/{jobId}/dokumente/
> Read document GET api/job/{jobId}/dokument/{docId}
> Save document POST api/job/{jobId}/dokument/
> Update document PUT api/job/{jobId}/dokument/{docId}
> Delete document DELETE api/job/{jobId}/dokument/{docId}
> Get all categories GET api/job/{jobId}/kategorien/
> Get category GET api/job/{jobId}/kategorie/{kategorieId}
> Create category POST api/job/{jobId}/kategorie/
> Update category PUT api/job/{jobId}/kategorie/{kategorieId}
> Delete category DELETE api/job/{jobId}/kategorie/{kategorieId}
> Get employees GET api/job/{jobId}/mitarbeiter/{terminMitarbeiterId}
> Add employee POST api/job/{jobId}/mitarbeiter/
> Update employee PUT api/job/{jobId}/mitarbeiter/{terminMitarbeiterId}
> Delete employee DELETE api/job/{jobId}/mitarbeiter/{terminMitarbeiterId}
> Update employees PUT api/job/{jobId}/mitarbeiter/
> Get vehicles GET api/job/{jobId}/fahrzeug/{terminFahrzeugId}
> Add vehicle POST api/job/{jobId}/fahrzeug/
> Update vehicle PUT api/job/{jobId}/fahrzeug/{terminFahrzeugId}
> Delete vehicle DELETE api/job/{jobId}/fahrzeug/{terminFahrzeugId}
> Update vehicles PUT api/job/{jobId}/fahrzeug/
> Get Raum GET api/job/{jobId}/room/{terminRaumId}
> Create Raum POST api/job/{jobId}/room/
> Update Raum PUT api/job/{jobId}/room/{terminRaumId}
> Delete Raum DELETE api/job/{jobId}/room/{terminRaumId}
> Update rooms PUT api/job/{jobId}/room/
> Get scheduler GET api/job/{jobId}/disponent/{disponentenId}
> Add scheduler POST api/job/{jobId}/disponent/
> Update scheduler PUT api/job/{jobId}/disponent/{disponentenId}
> Delete scheduler DELETE api/job/{jobId}/disponent/{disponentenId}
> Get project manager GET api/job/{jobId}/projektleiter/{projektleiterId}
> Add project manager POST api/job/{jobId}/projektleiter/
> Update project manager PUT api/job/{jobId}/projektleiter/{projektleiterId}
> Delete project manager DELETE api/job/{jobId}/projektleiter/{projektleiterId}
> Get client contact person GET api/job/{jobId}/kundenansprechpartner/{ansprechpartnerId}
> Add client contact person POST api/job/{jobId}/kundenansprechpartner/
> Update client contact person PUT api/job/{jobId}/kundenansprechpartner/{ansprechpartnerId}
> Delete client contact person DELETE api/job/{jobId}/kundenansprechpartner/{ansprechpartnerId}
> Get location contact person GET api/job/{jobId}/locationansprechpartner/{ansprechpartnerId}
> Add location contact person POST api/job/{jobId}/locationansprechpartner/
> Update location contact person PUT api/job/{jobId}/locationansprechpartner/{ansprechpartnerId}
> Delete location contact person DELETE api/job/{jobId}/locationansprechpartner/{ansprechpartnerId}
> Get additional data GET api/job/{jobId}/zusatzdaten/{zusatzdatentypId}
> Update additional data PUT api/job/{jobId}/zusatzdaten/{zusatzdatentypId}
> Delete additional data DELETE api/job/{jobId}/zusatzdaten/{zusatzdatentypId}
> Get all comments GET api/job/{jobId}/kommentare/
> Read comment GET api/job/{jobId}/kommentar/{kommentarId}
> Create comment POST api/job/{jobId}/kommentar/
> Update comment PUT api/job/{jobId}/kommentar/{kommentarId}
> Delete comment DELETE api/job/{jobId}/kommentar/{kommentarId}
api/projekt/ 

Provides access to projects and their information

> Get project GET api/projekt/{projektId}
> Create project POST api/projekt/
> Update project PUT api/projekt/{projektId}
> Delete project DELETE api/projekt/{projektId}
> Search projects POST api/projekt/suche
> Get all documents GET api/projekt/{projektId}/dokumente/
> Read document GET api/projekt/{projektId}/dokument/{docId}
> Save document POST api/projekt/{projektId}/dokument/
> Update document PUT api/projekt/{projektId}/dokument/{docId}
> Delete document DELETE api/projekt/{projektId}/dokument/{docId}
> Get scheduler GET api/projekt/{projektId}/disponent/{disponentenId}
> Add scheduler POST api/projekt/{projektId}/disponent/
> Update scheduler PUT api/projekt/{projektId}/disponent/{disponentenId}
> Delete scheduler DELETE api/projekt/{projektId}/disponent/{disponentenId}
> Get project manager GET api/projekt/{projektId}/projektleiter/{projektleiterId}
> Add project manager POST api/projekt/{projektId}/projektleiter/
> Update project manager PUT api/projekt/{projektId}/projektleiter/{projektleiterId}
> Delete project manager DELETE api/projekt/{projektId}/projektleiter/{projektleiterId}
> Get client contact person GET api/projekt/{projektId}/kundenansprechpartner/{ansprechpartnerId}
> Add client contact person POST api/projekt/{projektId}/kundenansprechpartner/
> Update client contact person PUT api/projekt/{projektId}/kundenansprechpartner/{ansprechpartnerId}
> Delete client contact person DELETE api/projekt/{projektId}/kundenansprechpartner/{ansprechpartnerId}
> Get additional data GET api/projekt/{projektId}/zusatzdaten/{zusatzdatentypId}
> Update additional data PUT api/projekt/{projektId}/zusatzdaten/{zusatzdatentypId}
> Delete additional data DELETE api/projekt/{projektId}/zusatzdaten/{zusatzdatentypId}
> Get all comments GET api/projekt/{projektId}/kommentare/
> Read comment GET api/projekt/{projektId}/kommentar/{kommentarId}
> Create comment POST api/projekt/{projektId}/kommentar/
> Update comment PUT api/projekt/{projektId}/kommentar/{kommentarId}
> Delete comment DELETE api/projekt/{projektId}/kommentar/{kommentarId}
api/changedjobs/ 

Provides access to a list of jobs changed in a given time period

> Read jobs POST api/changedjobs/

Working hours & vacations 

api/arbeitszeit/ 

Provides access to working hours and their information

> Get working hour GET api/arbeitszeit/{zeitId}
> Create working hour POST api/arbeitszeit/
> Update working hour PUT api/arbeitszeit/{zeitId}
> Delete working hour DELETE api/arbeitszeit/{zeitId}
> Search working hours POST api/arbeitszeit/suche
api/urlaub/ 

Provides access to holidays and sick notes and their information

> Get holidays / sick notes GET api/urlaub/{urlaubId}
> Create holiday / sick note POST api/urlaub/
> Update holiday / sick note PUT api/urlaub/{urlaubId}
> Delete holiday / sick note DELETE api/urlaub/{urlaubId}
> Search holidays / sick notes POST api/urlaub/suche

Driver's logs 

api/driverslog/ 

Provides access to driverslogs entries and their information

> Read out driverslog entry GET api/driverslog/{driverslogId}
> Create driverslog entry POST api/driverslog/
> Update driverslog entry PUT api/driverslog/{driverslogId}
> Delete driverslog entry DELETE api/driverslog/{driverslogId}
> Search drivers logs POST api/driverslog/suche

Tasks 

api/task/ 

Provides access to tasks and their information

> Get task GET api/task/{taskId}
> Create task POST api/task/
> Update task PUT api/task/{taskId}
> Delete task DELETE api/task/{taskId}
> Search tasks POST api/task/suche
> Get task responsible GET api/task/{taskId}/responsible/{responsibleId}
> Create task responsible POST api/task/{taskId}/responsible/
> Update task responsible PUT api/task/{taskId}/responsible/{responsibleId}
> Delete task responsible DELETE api/task/{taskId}/responsible/{responsibleId}
> Get all documents GET api/task/{taskId}/dokumente/
> Read document GET api/task/{taskId}/dokument/{docId}
> Save document POST api/task/{taskId}/dokument/
> Update document PUT api/task/{taskId}/dokument/{docId}
> Delete document DELETE api/task/{taskId}/dokument/{docId}
> Get all comments GET api/task/{taskId}/comments/
> Read comment GET api/task/{taskId}/comment/{commentId}
> Create comment POST api/task/{taskId}/comment/
> Update comment PUT api/task/{taskId}/comment/{commentId}
> Delete comment DELETE api/task/{taskId}/comment/{commentId}
api/tasklist/ 

Provides access to task lists and their information

> Get list GET api/tasklist/{tasklistId}
> Create list POST api/tasklist/
> Update list PUT api/tasklist/{tasklistId}
> Delete list DELETE api/tasklist/{tasklistId}
> Get all tasks for a list POST api/tasklist/{tasklistId}/tasks/
> Get participant GET api/tasklist/{tasklistId}/participant/{participantId}
> Add participant POST api/tasklist/{tasklistId}/participant/
> Update participant PUT api/tasklist/{tasklistId}/participant/{participantId}
> Delete participant DELETE api/tasklist/{tasklistId}/participant/{participantId}
api/tasklistfolder/ 

Provides access to folders for task lists and their information

> Get folder GET api/tasklistfolder/{folderId}
> Create folder POST api/tasklistfolder/
> Update folder PUT api/tasklistfolder/{folderId}
> Delete folder DELETE api/tasklistfolder/{folderId}
api/tasklistfolders/ 

Creates a list of all task lists and folders of the user.

> Get all folders / lists GET api/tasklistfolders/

Account 

api/account/ 

Provides access to the data of the currently logged in user

> Get user GET api/account/
> Update user PUT api/account/
> Read profile picture GET api/account/image
> Save profile picture POST api/account/image
> Update profile picture PUT api/account/image
> Delete profile picture DELETE api/account/image
> Get contact person GET api/account/ansprechpartner/{ansprechpartnerId}
> Create contact person POST api/account/ansprechpartner/
> Update contact person PUT api/account/ansprechpartner/{ansprechpartnerId}
> Delete contact person DELETE api/account/ansprechpartner/{ansprechpartnerId}
> Get all contact persons GET api/account/ansprechpartners
> Get AccountDokument GET api/account/dokument/{empDocId}
> Create AccountDokument POST api/account/dokument/
> Get AccountDokumente GET api/account/dokumente
> Search AccountDokumente POST api/account/dokumente/suche

Filter favorites 

Certificates 

api/zertifikat/ 

Provides access to certificates stored for employees, freelancers and subcontractors.

> Read certificate GET api/zertifikat/{certificateId}
> Create certificate POST api/zertifikat/
> Edit certificate PUT api/zertifikat/{certificateId}
> Delete certificate DELETE api/zertifikat/{certificateId}
> Search certificates POST api/zertifikat/suche

Travel expenses 

Work accidents / entries in the electric first-aid book 

api/workaccident/ 

Provides access to work accidents stored in the electronic first-aid book.

> Get work accident GET api/workaccident/{accidentId}
> Create work accident POST api/workaccident/
> Update work accident PUT api/workaccident/{accidentId}
> Delete work accident DELETE api/workaccident/{accidentId}
> Search work accidents POST api/workaccident/suche

Work instructions / confirmations 

api/workinstruction/ 

Provides access to the work instructions and confirmations stored in the system.

> Read work instruction GET api/workinstruction/{instructionId}
> Search work instructions POST api/workinstruction/suche
> Read consent to a work instruction GET api/workinstruction/{instructionId}/acceptance
> Create consent to service instruction POST api/workinstruction/{instructionId}/acceptance

Covid-19 tests 

Work contract 

Base data 

api/stammdaten/mitarbeiter/ 

Provides access to employees and their information

> Get employee GET api/stammdaten/mitarbeiter/{mitarbeiterId}
> Create employee POST api/stammdaten/mitarbeiter/
> Update employee PUT api/stammdaten/mitarbeiter/{mitarbeiterId}
> Delete employee DELETE api/stammdaten/mitarbeiter/{mitarbeiterId}
> Search employees POST api/stammdaten/mitarbeiter/suche
> Assign user group POST api/stammdaten/mitarbeiter/{mitarbeiterId}/benutzergruppe
> Delete user group DELETE api/stammdaten/mitarbeiter/{mitarbeiterId}/benutzergruppe/{benutzergruppenId}
> Get category GET api/stammdaten/mitarbeiter/{mitarbeiterId}/kategorie/{kategorieId}
> Assign category POST api/stammdaten/mitarbeiter/{mitarbeiterId}/kategorie
> Update category PUT api/stammdaten/mitarbeiter/{mitarbeiterId}/kategorie/{kategorieId}
> Delete category DELETE api/stammdaten/mitarbeiter/{mitarbeiterId}/kategorie/{kategorieId}
> Get additional data GET api/stammdaten/mitarbeiter/{mitarbeiterId}/zusatzdaten/{zusatzdatentypId}
> Update additional data PUT api/stammdaten/mitarbeiter/{mitarbeiterId}/zusatzdaten/{zusatzdatentypId}
> Delete additional data DELETE api/stammdaten/mitarbeiter/{mitarbeiterId}/zusatzdaten/{zusatzdatentypId}
> Get MitarbeiterDokument GET api/stammdaten/mitarbeiter/{mitarbeiterId}/dokument/{empDocId}
> Create MitarbeiterDokument POST api/stammdaten/mitarbeiter/{mitarbeiterId}/dokument/
> Get MitarbeiterDokumente GET api/stammdaten/mitarbeiter/{mitarbeiterId}/dokumente
> Search MitarbeiterDokumente POST api/stammdaten/mitarbeiter/{mitarbeiterId}/dokumente/suche
api/stammdaten/freelancer/ 

Provides access to freelancers and their information

> Get freelancer GET api/stammdaten/freelancer/{freelancerId}
> Create freelancer POST api/stammdaten/freelancer/
> Update freelancer PUT api/stammdaten/freelancer/{freelancerId}
> Delete freelancer DELETE api/stammdaten/freelancer/{freelancerId}
> Search freelancers POST api/stammdaten/freelancer/suche
> Assign user group POST api/stammdaten/freelancer/{freelancerId}/benutzergruppe
> Delete user group DELETE api/stammdaten/freelancer/{freelancerId}/benutzergruppe/{benutzergruppenId}
> Get category GET api/stammdaten/freelancer/{freelancerId}/kategorie/{kategorieId}
> Assign category POST api/stammdaten/freelancer/{freelancerId}/kategorie
> Update category PUT api/stammdaten/freelancer/{freelancerId}/kategorie/{kategorieId}
> Delete category DELETE api/stammdaten/freelancer/{freelancerId}/kategorie/{kategorieId}
> Get additional data GET api/stammdaten/freelancer/{freelancerId}/zusatzdaten/{zusatzdatentypId}
> Update additional data PUT api/stammdaten/freelancer/{freelancerId}/zusatzdaten/{zusatzdatentypId}
> Delete additional data DELETE api/stammdaten/freelancer/{freelancerId}/zusatzdaten/{zusatzdatentypId}
> Get FreelancerDokument GET api/stammdaten/freelancer/{mitarbeiterId}/dokument/{empDocId}
> Create FreelancerDokument POST api/stammdaten/freelancer/{mitarbeiterId}/dokument/
> Get FreelancerDokumente GET api/stammdaten/freelancer/{mitarbeiterId}/dokumente
> Search FreelancerDokumente POST api/stammdaten/freelancer/{mitarbeiterId}/dokumente/suche