Update Action

Update Actions Endpoint

PATCH {baseUrl}/openapi/api/v1/actions


Purpose

The Update Actions API enables partners to bulk-update actions by submitting a structured payload.

The API:

  • Validates the input

  • Maps it to the legacy API format

  • Processes the request

  • Returns a detailed response


Request Requirements

  1. Authorization:

    • Include a valid JWT token in the Authorization header.

    • Tokens are validated via Keycloak before processing.

  2. Validation:

    • The service validates all payloads in the request before forwarding them to the legacy API.

    • If any payload fails validation, the entire request is rejected, and no calls to the legacy API are made.

    • In the first example, the input payload can be seen as what is required(validated) and what is validated only if provided.

  3. Bulk Operation:

    • It supports bulk updating actions in a single request.

  4. Response

  • 200 - Success All actions are successfully updated.

  • 207 - Partial Success At least one action failed and at least one action has succed.

  • 400 - Failure Validation of the payload failed, and no actions were processed.

  • 404 - Not found Given actionId(s) are not found. There’s a call to the core API for each ID.

Examples

Example input of success 200:

Required, validated
Validated only if provided

actionId

category_action

Valid values:

  • validation

  • link

  • form

  • todo

  • schedule

status

If provided valid values are:

  • active

  • inactive

  • draft

  • approved

  • pending

  • done

type_action

Valid values:

  • validation

  • link

  • form

  • todo

  • schedule

author_id - cannot be updated

Response:

We have two successfully updated actions therefore two returned actions.


Example input of partial success 207 with 2 requests for actions:

Response:

In this case, the first action id is not found. The other is updated successfully.


Example input of complete failure 400 - error from the open-api-service #1:

Response:

Note: The request is validated on an open-API service level.

In this case, we may have multiple errors. No traffic to the core API will be generated.


Example input of complete failure 400 - error from the open-api-service #2:

Response:

This example shows the response when a non-valid field is provided. Again no traffic to the core API will be generated. Examples of all valid fields can be found in the create action response examples.


Another example of failure 400 - error from the core API:

Response:


Another example of failure 404 - error from the core API:

Response:

Last updated