Docs API reference

neoserver 0.1.2

Create layer

POST /api/v1/workspaces/{workspace}/services/{service}/layers · Layers

← All operations and schemas
POST /api/v1/workspaces/{workspace}/services/{service}/layers

Publishes a readable discovered layer. Enabled publication validates the source. Set enabled=false explicitly to save an offline draft; enabling later requires validation. SQL views are read-only.

Operation ID: createLayer

Authentication

Use one of the following authentication options. Permissions and workspace scope still apply. See authentication and access control.

  • Authorization: Bearer YOUR_ACCESS_TOKEN
  • X-API-Key: YOUR_API_KEY

Parameters

workspace path required

Workspace ID

string
service path required

Service ID

string

Request body

Required

Layer to publish

Content type application/json

object
allowed_roles array of string
crs_default integer

Default CRS EPSG code (defaults to 4326)

description string
dimensions array of Dimension ↗
enabled boolean
public boolean
public_id string

Public identifier for URLs (defaults to source_layer)

source_layer string

Name of the source table/layer in the data source

sql_view SQLView ↗
title string

Human-readable title

Responses

201 Created layer

Content type application/json

400 Bad Request

Content type application/json

401 Unauthorized

Content type application/json

403 Forbidden

Content type application/json

409 public_id is already published in this workspace

Content type application/json

413 Request body exceeds the configured limit

Content type application/json

422 Source layer is missing or unreadable

Content type application/json

426 HTTPS required

Content type application/json

429 Request rate exceeded

Content type application/json

503 Datasource unavailable

Content type application/json

OpenAPI operation definition
{
  "description": "Publishes a readable discovered layer. Enabled publication validates the source. Set enabled=false explicitly to save an offline draft; enabling later requires validation. SQL views are read-only.",
  "operationId": "createLayer",
  "parameters": [
    {
      "description": "Workspace ID",
      "in": "path",
      "name": "workspace",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Service ID",
      "in": "path",
      "name": "service",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "allowed_roles": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "crs_default": {
              "description": "Default CRS EPSG code (defaults to 4326)",
              "type": "integer"
            },
            "description": {
              "type": "string"
            },
            "dimensions": {
              "items": {
                "$ref": "#/components/schemas/Dimension"
              },
              "type": "array"
            },
            "enabled": {
              "type": "boolean"
            },
            "public": {
              "type": "boolean"
            },
            "public_id": {
              "description": "Public identifier for URLs (defaults to source_layer)",
              "type": "string"
            },
            "source_layer": {
              "description": "Name of the source table/layer in the data source",
              "type": "string"
            },
            "sql_view": {
              "$ref": "#/components/schemas/SQLView"
            },
            "title": {
              "description": "Human-readable title",
              "type": "string"
            }
          },
          "type": "object"
        }
      }
    },
    "description": "Layer to publish",
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Layer"
          }
        }
      },
      "description": "Created layer"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Bad Request"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Unauthorized"
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Forbidden"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "public_id is already published in this workspace"
    },
    "413": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Request body exceeds the configured limit"
    },
    "422": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Source layer is missing or unreadable"
    },
    "426": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "HTTPS required"
    },
    "429": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Request rate exceeded"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Datasource unavailable"
    }
  },
  "summary": "Create layer",
  "tags": [
    "Layers"
  ]
}

Search documentation

Type to search guides and reference pages.