# PTV OptiFlow Resources API

The Resources API provides the resources necessary to create a planning.


Version: 1.30.1

## Servers

Resources API Production
```
https://api.conundra.eu/resource-management/v1
```

## Security

### clientCredentials

This API uses OAuth2 with the Client Credentials flow for M2M communication. Client ID ans secret should be provided as a HTTP Basic Auth header.


Type: oauth2
Token URL: https://auth.conundra.eu/auth/realms/prod/protocol/openid-connect/token
Scopes:

## Download OpenAPI description

 - [PTV OptiFlow Resources API](https://developer.conundra.eu/_bundle/apis/resource-management/resources-api.yaml)

## Health check

 - [GET /ping](https://developer.conundra.eu/apis/resource-management/resources-api/health/ping.md): The `ping`-endpoint can be used for validating a connection with the application. It will authenticate the caller and respond `pong` if everything is set-up correctly.
## Employee

 - [GET /employee](https://developer.conundra.eu/apis/resource-management/resources-api/employee/getpagedemployees.md): Retrieve employees in bulk using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal).
 - [PUT /employee/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee/upsertemployee.md): Create or update an `Employee`. A unique ID is required to identify the `Employee`. Calling this endpoint with an existing `id` will update the `Employee`. Modifying (or retrieving) an `Employee` will
 - [GET /employee/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee/getemployee.md): Get an existing Employee, defined by their `id`.
 - [DELETE /employee/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee/deleteemployee.md): Delete an Employee, defined by their `id`. Removing an `Employee` will remove all related sub-resources. **Note:** Deployed `ResourceCombinations` (eg: used in a released route in an optimization) wil
## Shift Schedule

 - [POST /employee/{employee_id}/shift-schedule](https://developer.conundra.eu/apis/resource-management/resources-api/shift-schedule/createshiftschedule.md): Endpoint to create a `ShiftSchedule`. An identifier will be generated by the application. This identifier can be retrieved from the `Location` header, or response body (if the `Prefer` header is set t
 - [GET /employee/{employee_id}/shift-schedule](https://developer.conundra.eu/apis/resource-management/resources-api/shift-schedule/getshiftschedulesbyemployeeid.md): Retrieve all `ShiftSchedules` for a given `Employee`, identified by their id.
 - [PUT /employee/{employee_id}/shift-schedule/{generated_id}](https://developer.conundra.eu/apis/resource-management/resources-api/shift-schedule/updateshiftschedule.md): Update an existing `ShiftSchedule` for an `Employee`. The `generated_id` is determined by the application and was returned on creation. A list of existing `ShiftSchedules` can be retrieved by using th
 - [DELETE /employee/{employee_id}/shift-schedule/{generated_id}](https://developer.conundra.eu/apis/resource-management/resources-api/shift-schedule/deleteshiftschedule.md): Update an existing `ShiftSchedule` for an `Employee`. The `generated_id` is determined by the application and was returned on creation. A list of existing `ShiftSchedules` can be retrieved by using th
## Availability

 - [GET /employee/{employee_id}/availability](https://developer.conundra.eu/apis/resource-management/resources-api/availability/getemployeeavailabilities.md): Retrieves all `Availabilities` for a single `Employee` (identified by their `id`) within an optional time range. This endpoint will return any **overlapping** `Availability`, so it is possible for the
 - [POST /employee/{employee_id}/availability](https://developer.conundra.eu/apis/resource-management/resources-api/availability/addemployeeavailability.md): Add an `Availability` for an `Employee`. An identifier will be generated by the application. This identifier can be retrieved from the `Location` header, or response body (if the `Prefer` header is se
 - [DELETE /employee/{employee_id}/availability](https://developer.conundra.eu/apis/resource-management/resources-api/availability/deleteemployeeavailabilities.md): Delete all existing `Employee` `Availabilities` that overlap using an open or closed a time range. Overlap is determined for the widest possible range on an `Availability, ie: `earliest_start`up until
 - [GET /employee/{employee_id}/availability/{generated_id}](https://developer.conundra.eu/apis/resource-management/resources-api/availability/getemployeeavailability.md): Retrieve an existing `Availability`, identified by its `generated_id`, for an `Employee`, identified by their `id`.
 - [PUT /employee/{employee_id}/availability/{generated_id}](https://developer.conundra.eu/apis/resource-management/resources-api/availability/updateemployeeavailability.md): Update a specific `Availability`, identified by its `generated_id`, for an `Employee`, identified by their `id`. The updated `Availability` should not overlap with existing `Availabilities`.
 - [DELETE /employee/{employee_id}/availability/{generated_id}](https://developer.conundra.eu/apis/resource-management/resources-api/availability/deleteemployeeavailability.md): Delete an existing `Availability`, identified by its `generated_id`, for an `Employee`, identified by their `id`. This will remove a `ResourceCombination` tied to this `Availability` if it was not dep
## Unavailability [EXPERIMENTAL]

 - [POST /employee/{employee_id}/unavailability](https://developer.conundra.eu/apis/resource-management/resources-api/employee-unavailability/createemployeeunavailability.md): Create an unavailability for an employee, without providing an identifier. The generated identifier will be available in the response's `Location` header, and/or response body if the appropriate `Pref
 - [GET /employee/{employee_id}/unavailability](https://developer.conundra.eu/apis/resource-management/resources-api/employee-unavailability/getemployeeunavailabilities.md): Get all Employee Unavailabilities by Employee id. When a `from` and `until` are provided, we match any `Unavailabilities` that overlap with this range.
 - [PUT /employee/{employee_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee-unavailability/upsertemployeeunavailability.md): Create or update an unavailability for an employee.
 - [DELETE /employee/{employee_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee-unavailability/deleteemployeeunavailability.md)
 - [GET /employee/{employee_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/employee-unavailability/getemployeeunavailability.md)
## Transport Resource

 - [GET /transport-resource](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource/getpagedtransportresources.md): Retrieve transport resources in bulk using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal).
 - [PUT /transport-resource/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource/upserttransportresource.md): Upsert a single `TransportResource`. As a `TransportResource` is considered to be always available unless a `TransportResourceUnavailability` says otherwise, its presence will result in the applicatio
 - [GET /transport-resource/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource/gettransportresource.md): Get an existing `TransportResource`
 - [DELETE /transport-resource/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource/deletetransportresource.md): Delete an existing `TransportResource`. Upon deleting, the application will also remove ResourceCombinations using this TransportResource and try to find replacements. All unavailabilities and relocat
## Unavailability [EXPERIMENTAL]

 - [POST /transport-resource/{id}/unavailability](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource-unavailability/addtransportresourceunavailability.md): This endpoint allows you to create an `Unavailability` with a **generated ID**. This can be used for *ad hoc* `Unavailabilities` or situations where the source system does not contain any unique IDs.
 - [GET /transport-resource/{id}/unavailability](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource-unavailability/gettransportresourceunavailabilities.md): Get all TransportResource Unavailabilities by TransportResource id. When a `from` and `until` are provided, we match any `Unavailabilities` that overlap with this range.
 - [PUT /transport-resource/{transport_resource_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource-unavailability/upserttransportresourceunavailability.md): Create or update a `TransportResourceUnavailability`. When a `TransportResource` becomes unavailable, the `ResourceCombinations` whose guaranteed working time overlapped with the unavailability are de
 - [DELETE /transport-resource/{transport_resource_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource-unavailability/deletetransportresourceunavailability.md)
 - [GET /transport-resource/{transport_resource_id}/unavailability/{unavailability_id}](https://developer.conundra.eu/apis/resource-management/resources-api/transport-resource-unavailability/gettransportresourceunavailability.md)
## Home Base [EXPERIMENTAL]

 - [GET /home-base](https://developer.conundra.eu/apis/resource-management/resources-api/homebase/getpagedhomebases.md): Retrieve home bases in bulk using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal).
 - [PUT /home-base/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/homebase/upserthomebase.md): Upsert a single `HomeBase`. Once it is created `Employees` and `Transport Resources` can make use of it.
 - [GET /home-base/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/homebase/gethomebase.md): Get a single `HomeBase`.
 - [DELETE /home-base/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/homebase/deletehomebase.md): Delete a single `HomeBase`. A `HomeBase` can only be deleted when there are no resources left referring to it.
## Forecast [EXPERIMENTAL]

 - [PUT /resource-overview/{date}/{location}/forecasts](https://developer.conundra.eu/apis/resource-management/resources-api/forecast/upsertforecast.md): Upsert a single `Forecast`
 - [GET /resource-overview/{date}/{location}/forecasts](https://developer.conundra.eu/apis/resource-management/resources-api/forecast/getforecast.md): Get a single `Forecast`.
 - [DELETE /resource-overview/{date}/{location}/forecasts](https://developer.conundra.eu/apis/resource-management/resources-api/forecast/deleteforecast.md): Delete a single `Forecast`.
## Deployment [EXPERIMENTAL]

 - [GET /deployment](https://developer.conundra.eu/apis/resource-management/resources-api/deployment/getpageddeployments.md): Retrieve deployments in bulk using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal). `Deployments` without a `planning_id` are externally managed `Deploy
 - [GET /deployment/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/deployment/getdeployment.md): Get an existing `Deployment`, defined by their `id`. `Deployments` without a `planning_id` are externally managed `Deployments`. `Deployments` with a `planning_id` are managed by releasing or unreleas
 - [PUT /deployment/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/deployment/upsertexternaldeployment.md): Create or update an external `Deployment`. A unique ID is required to identify the `Deployment`. Calling this endpoint with an existing `id` will update the `Deployment. External `Deployments` represe
 - [DELETE /deployment/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/deployment/deleteexternaldeployment.md): Delete an external `Deployment`, defined by their `id`. It is not possible to delete `Deployments` that are managed by the PTV OptiFlow platform. In order to remove these `Deployments`, you can use th
## Actual

 - [GET /means/{employee_id}/actual](https://developer.conundra.eu/apis/resource-management/resources-api/actual/getpagedemployeeactuals.md): Retrieve actuals for an employee in bulk using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal).
 - [PUT /means/{employee_id}/actual/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/actual/upsertactual.md): Upsert a single `Actual` for an `Employee`.
 - [GET /means/{employee_id}/actual/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/actual/getactual.md): Get a single `Actual` for an `Employee`.
 - [DELETE /means/{employee_id}/actual/{id}](https://developer.conundra.eu/apis/resource-management/resources-api/actual/deleteactual.md): Delete a single `Actual` for an `Employee`.
