Skip to content

Update assignment

PATCH
/assignments/{assignmentId}
curl --request PATCH \
--url https://api-uat.flinkey.de/v3/assignments/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Customer-ID: example' \
--header 'flinkey-API-Key: <flinkey-API-Key>' \
--data '[ { "op": "replace", "path": "/end", "value": "2026-01-31T20:00:00Z" } ]'

Purpose

Update an existing assignment in the selected customer context.

An assignment grants access from a user to a car for a defined time range.

Use this operation to change an existing access permission.

Assignment updates are asynchronous.

The API request confirms that the assignment update request was accepted.

The final operation result is delivered through webhook.

When to use this operation

Use this operation when the partner backend needs to update an existing assignment.

Typical situations:

  • changing assignment start time,
  • changing assignment end time,
  • extending or shortening vehicle access,
  • changing the assigned car,
  • changing the assigned user,
  • updating lifetime or renewal behavior,
  • correcting assignment data after reconciliation.

Before updating an assignment, the partner backend should have resolved:

  • the correct Customer-ID,
  • the flinkey assignmentId,
  • the intended update operation,
  • the expected local assignment state.

Do not treat the assignment update as final only because this API operation returned successfully.

Wait for the assignment updated result webhook before marking the local assignment update as successful.

Validation notes

PROD validation result:

  • PATCH /assignments/{assignmentId} with a JSON Patch replace operation for /end returned 204 No Content without a response body.
  • The configured assignment-updated webhook received an HTTP POST containing the same patch operation in updateData.
  • The webhook contained checksum, numeric assignmentId, numeric customerId, operationSucceeded, errorMessage and updateData.
  • operationSucceeded was true and errorMessage was null in the successful validation.
  • A configured webhook secret was transmitted in the secret request header and was visible to the receiving test endpoint.
  • A subsequent assignment lookup confirmed that the updated end time was persisted.

Async behavior

Asynchronous.

The API response does not represent the final assignment update result.

The partner backend must wait for the assignment updated result webhook.

The local assignment should remain in a pending update state until the webhook has been processed.

Webhook result

Yes.

This operation produces an assignment updated result webhook.

The webhook result determines whether assignment update succeeded or failed.

Use operationSucceeded from the webhook payload to update the local assignment state.

Security notes

Never log:

  • flinkey-API-Key,
  • bearer token,
  • full request headers.

Assignment identifiers are environment-specific.

Do not mix UAT and PROD assignment IDs.

Use placeholders in documentation, examples, screenshots and AI prompts.

For standard partner integrations, the mobile app must not receive API Manager credentials, backend bearer tokens or the flinkey-API-Key.

assignmentId
required
number

Database ID of the assignment

Customer-ID
required
string

Customer database ID

Media typeapplication/json
Array<object>
object
op
required

Update operation. Allowed values are remove and replace

string
path
required

Assignment field to update

string
value
required

New value for the selected path, or null where applicable

string | null
Example
[
{
"op": "replace",
"path": "/end",
"value": "2026-01-31T20:00:00Z"
}
]

Assignment update request was accepted

Invalid subscription key or missing / invalid access token

Recommended handling: Check flinkey-API-Key, bearer token and environment configuration

API Manager was not found

Recommended handling: Check credentials, token context and Customer-ID

Server-side error

Recommended handling: Retry later if appropriate and escalate if persistent