# PTV OptiFlow Planning API

The planning API provides information about plannings and their lifecycle. 

You can find out more in our [developer portal](https://developer.conundra.eu/developer-portal/planning/).


Version: 1.13.0

## Servers

Production Api
```
https://api.conundra.eu/planning/v1
```

## Security

### clientCredentials

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


Type: oauth2

## Download OpenAPI description

[PTV OptiFlow Planning API](https://developer.conundra.eu/_bundle/apis/plannings/planning-api.yaml)

## Health

Validate connection and accessibility of the API.


### Returns a single pong string

 - [GET /ping](https://developer.conundra.eu/apis/plannings/planning-api/health/ping.md): The ping-endpoint can be used for validating a connection with the application.
It will authenticate the caller and returns a pong response when everything is set-up correctly.

## Plannings

Endpoints used for retrieving information about plannings and its releases.


### Get a cursor paged list of plannings

 - [GET /plannings](https://developer.conundra.eu/apis/plannings/planning-api/plannings/getplannings.md): Returns a cursor paged list of plannings. Results are sorted by created_at in descending order.
You can find out more about how to use cursors in our developer portal.

### Retrieve a released planning using a given planning id

 - [GET /plannings/{id}/releases/latest](https://developer.conundra.eu/apis/plannings/planning-api/plannings/getlatestreleasebyplanningid.md): Retrieves detailed information on the given released planning.

Note that information about releases are only stored for 2 weeks after the release was made. If you try to retrieve a release which is older than 2 weeks, you will get a 404 Not Found response.

## Plan Profiles

Endpoints used for managing plan profiles.


### List the existing plan profiles

 - [GET /plan-profiles](https://developer.conundra.eu/apis/plannings/planning-api/plan-profiles/listplanprofiles.md): Retrieve plan profiles using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal for more details).

### Get plan profile

 - [GET /plan-profiles/{id}](https://developer.conundra.eu/apis/plannings/planning-api/plan-profiles/getplanprofile.md): Retrieves detailed information on the given plan profile.

### Upsert plan profile

 - [PUT /plan-profiles/{id}](https://developer.conundra.eu/apis/plannings/planning-api/plan-profiles/upsertplanprofile.md): Create or update a plan profile. A unique ID is required to identify the plan profile.
Calling this endpoint with an existing ID will update the plan profile.

### Delete plan profile

 - [DELETE /plan-profiles/{id}](https://developer.conundra.eu/apis/plannings/planning-api/plan-profiles/deleteplanprofile.md): Delete a plan profile by its ID.

## Location Workload Levelling

Endpoints used for managing location workload levelling sets.


### List the existing location workload levelling sets

 - [GET /settings/location-workload-levelling-sets](https://developer.conundra.eu/apis/plannings/planning-api/location-workload-levelling/listlocationworkloadlevellingsets.md): Retrieves detailed information on all location workload levelling sets, limited to at most 100 items.

### Get location workload levelling set

 - [GET /settings/location-workload-levelling-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/location-workload-levelling/getlocationworkloadlevellingset.md): Retrieves detailed information on the given location workload levelling set.

### Upsert location workload levelling set

 - [PUT /settings/location-workload-levelling-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/location-workload-levelling/upsertlocationworkloadlevellingset.md): Create or update a location workload levelling set. A unique ID (business_id) is required to identify the location workload levelling set. 
Calling this endpoint with an existing business_id will update the location workload levelling set.

### Delete location workload levelling set

 - [DELETE /settings/location-workload-levelling-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/location-workload-levelling/deletelocationworkloadlevellingset.md): Delete a location workload levelling set by its business_id.

## Order-Order Restrictions

Endpoints used for managing order-order restriction sets.


### List the existing order-order restriction sets

 - [GET /settings/order-order-restriction-sets](https://developer.conundra.eu/apis/plannings/planning-api/order-order-restrictions/listorderorderrestrictionsets.md): Retrieves detailed information on all order-order restriction sets, limited to at most 100 items.

### Get order-order restriction set

 - [GET /settings/order-order-restriction-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/order-order-restrictions/getorderorderrestrictionset.md): Retrieves detailed information on the given order-order restriction set.

### Upsert order-order restriction set

 - [PUT /settings/order-order-restriction-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/order-order-restrictions/upsertorderorderrestrictionset.md): Create or update an order-order restriction set. A unique ID (business_id) is required to identify the order-order restriction set. 
Calling this endpoint with an existing business_id will update the order-order restriction set.

### Delete order-order restriction set

 - [DELETE /settings/order-order-restriction-sets/{business_id}](https://developer.conundra.eu/apis/plannings/planning-api/order-order-restrictions/deleteorderorderrestrictionset.md): Delete an order-order restriction set by its business_id.

## Break Rules

Endpoints used for managing break rule sets.


### List the existing break rule sets

 - [GET /settings/break-rule-sets](https://developer.conundra.eu/apis/plannings/planning-api/break-rules/listbreakrulesets.md): Retrieves detailed information on all break rule sets, limited to at most 100 items.

### Get break rule set

 - [GET /settings/break-rule-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/break-rules/getbreakruleset.md): Retrieves detailed information on the given break rule set.

### Upsert break rule set

 - [PUT /settings/break-rule-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/break-rules/upsertbreakruleset.md): Create or update a break rule set. A unique ID is required to identify the break rule set. 
Calling this endpoint with an existing ID will update the break rule set.

### Delete break rule set

 - [DELETE /settings/break-rule-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/break-rules/deletebreakruleset.md): Delete a break rule set by its id.

## Depot Sets

Endpoints used for managing depot sets.


### List the existing depot sets

 - [GET /locations/depot-sets](https://developer.conundra.eu/apis/plannings/planning-api/depot-sets/listdepotsets.md): Retrieve depot sets using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal for more details).

### Get depot set

 - [GET /locations/depot-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/depot-sets/getdepotset.md): Retrieves detailed information on the given depot set.

### Upsert depot set

 - [PUT /locations/depot-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/depot-sets/upsertdepotset.md): Create or update a depot set. A unique ID is required to identify the depot set.
Calling this endpoint with an existing id will update the depot set.

### Delete depot set

 - [DELETE /locations/depot-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/depot-sets/deletedepotset.md): Delete a depot set by its ID.

## Charging Location Sets

<span style="background-color: orange; color: white; padding: 4px 8px; border-radius: 5px; font-size: 12px; font-weight: bold;">Early Access</span>
<br />Endpoints used for managing charging location sets.


### List the existing charging location sets

 - [GET /locations/charging-location-sets](https://developer.conundra.eu/apis/plannings/planning-api/charging-location-sets/listcharginglocationsets.md): Retrieve charging location sets using cursor-based paging (see the Cursor-based pagination documentation on the PTV Developer Portal for more details).

### Get charging location set

 - [GET /locations/charging-location-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/charging-location-sets/getcharginglocationset.md): Retrieves detailed information on the given charging location set.

### Upsert charging location set

 - [PUT /locations/charging-location-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/charging-location-sets/upsertcharginglocationset.md): Create or update a charging location set. A unique ID is required to identify the charging location set.
Calling this endpoint with an existing ID will update the charging location set.

### Delete charging location set

 - [DELETE /locations/charging-location-sets/{id}](https://developer.conundra.eu/apis/plannings/planning-api/charging-location-sets/deletecharginglocationset.md): Delete a charging location set by its ID.

