Create Style

Create Style

POST

/api/portal/v1/styles

Description

Create a new style. The new style is initialized with the default color palette and display settings for the chosen theme. To customize the style, follow up with a call to Update Style.

Authentication

This endpoint requires a Bearer token in the Authorization header.

  • Authorization: Bearer <token>. A valid Portal API session token or API token.

Request Body

The request body should be JSON-encoded.

  • name: A human-readable label for the style.
  • theme: The base theme for the style. One of day, dusk, or night. See Styles for what each theme provides.

Response Schema

On success, the endpoint returns the newly created style record. The shape matches an entry from List Styles.

Error Responses

  • 400 Bad Request: The name or theme field is missing.
  • 401 Unauthorized: The Authorization header is missing or the token is not valid.
Example Request
POST https://<your-host>:9909/api/portal/v1/styles
Authorization: Bearer <token>
Content-Type: application/json

{
    "name": "Vessel Map",
    "theme": "day"
}

Example Response
Status Code: 200 OK
Response Body:
{
    "id": 42,
    "name": "Vessel Map",
    "userEmail": "example@zydromarine.com",
    "createdAt": 1736942400000,
    "updatedAt": 1736942400000,
    "parameters": {
        "colors": { ... },
        "settings": {
            "iconSet": "enc-day",
            "soundingOpacity": 0.5,
            "showLightSectors": true
        }
    }
}
VectorCharts.com © 2024, Zydro Marine Technologies, Inc. · vectorcharts.com