Create assignment
const url = 'https://api-uat.flinkey.de/v3/assignments';const options = { method: 'PUT', headers: { 'Customer-ID': 'example', 'flinkey-API-Key': '<flinkey-API-Key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"carId":12345,"userId":54321,"start":"2026-01-31T10:00:00Z","end":"2026-01-31T18:00:00Z","lifetime":604800,"renewableAfter":302400}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api-uat.flinkey.de/v3/assignments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Customer-ID: example' \ --header 'flinkey-API-Key: <flinkey-API-Key>' \ --data '{ "carId": 12345, "userId": 54321, "start": "2026-01-31T10:00:00Z", "end": "2026-01-31T18:00:00Z", "lifetime": 604800, "renewableAfter": 302400 }'Purpose
Create a new assignment in the selected customer context.
An assignment grants access from a user to a car for a defined time range.
This operation is used to create the access permission that allows a user to access a car.
Assignment creation is asynchronous.
The API request confirms that the assignment creation 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 grant vehicle access to a user.
Typical situations:
- creating access for a booking,
- granting a driver access to a car,
- preparing mobile access for the partner app,
- creating an unrestricted assignment,
- creating a time-limited assignment for a defined access window.
Before creating an assignment, the partner backend should have resolved:
- the correct
Customer-ID, - the flinkey
carId, - the flinkey
userId, - the intended assignment start time,
- the intended assignment end time or unrestricted assignment behavior.
Do not treat the assignment as active only because this API operation returned successfully.
Wait for the assignment created result webhook before marking the local assignment state as active.
Validation notes
PROD validation result:
PUT /assignmentsreturned204 No Contentwithout a response body.- The direct API response represented request acceptance only.
- A configured HTTPS webhook endpoint received the assignment created result as an HTTP
POST. - The webhook contained the final numeric
assignmentId,carId,userId,customerId,checksum,operationSucceededanderrorMessagefields. operationSucceededwastrueanderrorMessagewasnullin the successful validation.- The created assignment was retrievable through the assignment read endpoints after successful webhook processing.
Async behavior
Asynchronous.
The API response does not represent the final assignment creation result.
The partner backend must wait for the assignment created result webhook.
The local assignment should remain in a pending state until the webhook has been processed.
Webhook result
Yes.
This operation produces an assignment created result webhook.
The webhook result determines whether assignment creation 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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Customer database ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Database ID of the car
Database ID of the user
Assignment start time in date-time format
Assignment end time in date-time format, or null for unrestricted assignment end
Assignment lifetime in seconds
Renewal timing in seconds
Example
{ "carId": 12345, "userId": 54321, "start": "2026-01-31T10:00:00Z", "end": "2026-01-31T18:00:00Z", "lifetime": 604800, "renewableAfter": 302400}Responses
Section titled “Responses”Assignment creation 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
Request content type is missing or incorrect
Recommended handling: Ensure Content-Type: application/json is used
Server-side error
Recommended handling: Retry later if appropriate and escalate if persistent
