Update Style
Update Style
POST
/api/portal/v1/styles/{id}
Description
Update the name or rendering parameters of an existing style. Only the fields included in the request body are modified. Fields that are omitted are left unchanged.
Updates take effect immediately for any subsequent Core API request that references the style by ID.
Authentication
This endpoint requires a Bearer token in the Authorization header.
- Authorization:
Bearer <token>. A valid Portal API session token or API token.
Path Parameters
- id: The
idof the style to update.
Request Body
The request body should be JSON-encoded.
- name (Optional): A human-readable label for the style.
- parameters (Optional): The full rendering parameters object. See Styles for the schema.
Response Schema
On success, the endpoint returns the updated style record. The shape matches an entry from List Styles.
Error Responses
- 401 Unauthorized: The
Authorizationheader is missing or the token is not valid. - 404 Not Found: No style exists with the given
idon the caller’s account.
Example Request
POST https://<your-host>:9909/api/portal/v1/styles/42
Authorization: Bearer <token>
Content-Type: application/json
{
"parameters": {
"colors": { ... },
"settings": {
"iconSet": "enc-day",
"soundingOpacity": 0.7,
"showLightSectors": false
}
}
}
Example Response
Status Code: 200 OK
Response Body:
{
"id": 42,
"name": "Vessel Map",
"userEmail": "example@zydromarine.com",
"createdAt": 1736942400000,
"updatedAt": 1736950000000,
"parameters": {
"colors": { ... },
"settings": {
"iconSet": "enc-day",
"soundingOpacity": 0.7,
"showLightSectors": false
}
}
}