Overspeed configuration
Setting Overspeed Thresholds & Duration via GraphQL
This guide explains how to configure the speed limit thresholds and duration settings for a device using the journey_post_device_configs mutation.
Overview
To control how a device detects and reports overspeed events, you send an input whose attributes (see mutationInput_post_device_configs_input_data_attributes_Input) contain the device identifier and three overspeed parameters.
API endpoint
The mutation is available on the GraphQL Gateway at https://api.munic.io/services/graphql_gateway. Requests must include your Bearer token in the Authorization header.
Authentication
Provide your auth token in the Authorization: Bearer <token> HTTP header. See the auth service to obtain a token.
For full mutation details, see the GraphQL Gateway mutation reference.
Updating device config with the mutation
Use the journey_post_device_configs mutation to update the device configuration. The mutation takes an input whose data.attributes object contains the device imei and the three overspeed fields (all in the same attributes object, as per the attributes input type).
| |
| |
| |
Field definitions (input.data.attributes)
All fields below belong to the attributes object (input.data.attributes) of the mutation input:
| Field | Type | Unit | Description |
|---|---|---|---|
| imei | ID | — | Device IMEI. Transmitted as string in JSON. |
| speed_limit_exceeded_threshold | Float | km/h | The threshold added to the current speed limit that, when exceeded, triggers an overspeed alert (default is 8 km/h). |
| overspeed_min_duration | Integer | Seconds | The minimum time the vehicle must stay above the thresholdto register as an overspeed event (default is 5s). |
| underspeed_max_duration | Integer | Seconds | The maximum time allowed below the threshold before the event is considered “finished” (default is 5s). |
Example with cURL
Replace YOUR_ACCESS_TOKEN with your actual Bearer token.
curl -X POST https://api.munic.io/services/graphql_gateway/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "mutation($input: device_config_create_Input) { journey_post_device_configs(input: $input) { ... on device_config_show { data { id type attributes { imei speed_limit_exceeded_threshold } } } ... on errors { errors { title detail status } } } }",
"variables": {
"input": {
"data": {
"type": "device_configs",
"attributes": {
"imei": "123456789012345",
"speed_limit_exceeded_threshold": 40,
"overspeed_min_duration": 15,
"underspeed_max_duration": 3
}
}
}
}
}'Expected response
Success: the API returns the created/updated device config under data (with id, type, and attributes).
Error: on failure, journey_post_device_configs contains an errors array with objects exposing title and detail.