> For the complete documentation index, see [llms.txt](https://ellcrys.gitbook.io/ellcrys/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ellcrys.gitbook.io/ellcrys/api/admin.md).

# Admin

## admin\_auth

Create an RPC session token to be used as the authorization token for request to private JSON-RPC API endpoints.&#x20;

**Parameters**

| Argument | Type   | Description       |
| -------- | ------ | ----------------- |
| username | String | The RPC username. |
| password | String | The RPC password. |

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"admin_auth", "params": { "username": "myuser", "password":"mypass" } ,"id":21}'
```

#### Console Example

```javascript
> admin.auth({
    "username": "myuser",
    "password": "mypass"
})
```

#### Returns:

&#x20;`String` - JSON Web Token

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDE4LTExLTEwVDE0OjQyOjU4LjUwNDI2MjQ2MyswMTowMCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.u02jMZ-VShh6Jp18tbvxCJ1KWv6fIGXky8hh7vbgDrc"
}
```

## admin.login

Authenticates the current console session to allow private RPC APIs to be called from the console environment. Internally, it acquires a session via `admin_auth` endpoint, caches the session token and sets it on every JSON-RPC requests.&#x20;

**Parameters**

| Argument | Type   | Required | Description       |
| -------- | ------ | -------- | ----------------- |
| username | String | True     | The RPC username. |
| password | String | False    | The RPC password. |

{% hint style="info" %}
If the `password` argument is omitted, an interactive session is started to collect the password. This is the recommended approach.
{% endhint %}

#### Console Example

```javascript
> admin.login("myuser", "mypass")
```

#### Returns:

&#x20;`String` - JSON Web Token

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDE4LTExLTEwVDE0OjQyOjU4LjUwNDI2MjQ2MyswMTowMCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.u02jMZ-VShh6Jp18tbvxCJ1KWv6fIGXky8hh7vbgDrc"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ellcrys.gitbook.io/ellcrys/api/admin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
