REST API

Meshery REST API specifications

Meshery’s REST API specifications are now maintained and published from the meshery/schemas repository.

Each of Meshery’s APIs is subject to Meshery’s authentication and authorization system. Meshery requires a valid token in order to allow clients to invoke its APIs.

AuthenticationRequests to any of the API endpoints must be authenticated and include a valid JWT access token in the HTTP headers. The type of authentication is determined by the selected Providers. Use of the Local Provider, "None", puts Meshery into single-user mode and uses minimal, intentionally insecure authentication.

How to get your token

There are two ways to get your authentication token:

Meshery UI

Using Meshery UI, you can get a copy of your authentication token by following these steps:

  1. Log into Meshery by selecting your identity provider of choice (typically found at http:\{meshery-server}:9081/provider)

  2. Navigate to your user’s avatar in the upper righthand corner and select “Get Token” from the dropdown of profile section:

Meshery Dashboard

Meshery CLI
Using Meshery CLI, you can get a copy of your authentication token by executing the following command:

  
mesheryctl system login


In order to use this command, you must have a web browser available on your system (this command cannot be executed on a headless system).

How to access Meshery’s REST API

Example using curl
Using curl, you can access Meshery's REST API by executing this command:

  
curl --location 'localhost:9081/api/<endpoint>' \ --header 'meshery-token: <yourToken>\ --header 'Cookie: meshery-provider=Layer5; cloud.layer5.io_ref=/;token=<yourToken>


Endpoints

See the published Meshery OpenAPI bundles in meshery/schemas for the authoritative REST API definitions.