---
title: "Submit JSON-RPC request to wallet API"
method: POST
path: "/v2/requests"
tags: ["Wallet"]
---

# Submit JSON-RPC request to wallet API

`POST /v2/requests`

This endpoint is the main entry point to submit JSON-RPC requests. The body of the HTTP request should be formatted as a JSON-RPC v2 request. The HTTP response is formatted as the JSON-RPC v2 response.

The `ID` should be specified. See [the JSON-RPC notification documentation](https://www.jsonrpc.org/specification#notification) for more details.

# Content type
This endpoint returns a response with a specific `Content-Type` header: `application/json-rpc`.

This content type is used to help third-party applications differentiate the different JSON formats returned by the service. 

Note that `application/json-rpc` is not a standard HTTP content type.

# Authentication

## Workflow
When connecting to a wallet, a connection token will be received back through the `Authorisation` header.

When accessing protected JSON-RPC methods, the connection token must be set to the `Authorisation` header. If the connection token is not valid, the server returns a response with the HTTP code 401, and the `WWW-Authenticate` header set to `VWT` as required by the HTTP standards.

### Community implementation of the wallet service
People might be willing to implement their own wallet service with their own authentication system. It's recommended that any community implementations follow the same workflow.

This will save third-party applications from having to _explicitly_ support different authentication schemes, and make the community implementations fully interoperable with all third-party applications, out of the box.

### Token format


The token will be formatted as follows:
`VWT \<YOUR_TOKEN\>`

`VWT` scheme stands for "Vega Wallet Token" and is not a standard authorisation scheme.

`YOUR_TOKEN` is a randomly generated string of 64 characters with numbers and letters. Each session generates a unique one.

## Headers

- `Origin` string, required
- `Authorization` string

## Response `200`

The request is successful. On this endpoint, only this type of response format should be expected.

## Other responses

- `204` — This response is returned when there is no `id` property valued in the JSON-RPC request. Concretely, when a JSON-RPC request doesn't have an ID, it is considered a JSON-RPC notification and, as such, no result is to be expected, even in case of failure.
- `400` — Something went wrong
- `401` — This error code is returned when the authentication failed.
- `500` — Something failed internally. Nothing can be done about it on the client side. Reporting the issue to the wallet software developers is encouraged.

---

[API](https://skmtc.dev/vegaprotocol/apis/wallet-api.md) · [All operations](https://skmtc.dev/vegaprotocol/apis/wallet-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vegaprotocol/wallet-api/revisions/95b73ed7c0db/schema)
