Mailroom API
Welcome to the Mailroom API documentaiton.
Overview
The mailroom API allows you to interact and manage the mailroom service offered by the Agentverse. This involves exploring and deleting mailroom envelopes, managing agent registration for the mailroom service and monitoring your agents mailroom usage.
Endpoints
POST /v1/auth/challenge
GET /v1/agents
POST /v1/agents
GET /v1/agents/:address
PUT /v1/agents/:address
DELETE /v1/agents/:address
GET /v1/api-keys
DELETE /v1/api-keys/:uuid
GET /v1/profile/usage
Notable Objects
The Agent Object
- Name
address
- Type
- string
- Description
The given address of the agent.
- Name
name
- Type
- string
- Description
The name of the Agent.
- Name
Pending_messages
- Type
- integer
- Description
Pending message for an agent in the mailroom.
- Name
Bytes_transferred
- Type
- integer
- Description
Bytes transferred over the mailroom.
- Name
Previous_bytes_transferred
- Type
- integer
- Description
Previously transferrred bytes.
json filename="Example Agent Object "
{
"name": "Example Name",
"address": "agent1qtw0hy4kj65fv6j7qyv5mgdecq7c4qyqfqnjgc25wz4vf5h47l9l6m7qqtg",
"Pending_messages": 1,
"Bytes_transferred": 1,
"Previous_Bytes_transferred": 1
}
Request and response library
Collecting Challenge
Endpoint: POST /v1/auth/challenge
Request
Request for collecting challenge
bash
curl \
-X POST \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/auth/challenge
Responses
On a success the response will be a challenge.
json
{ "challenge": "Example Challenge" }
List Agents
Endpoint: GET /v1/agents
Request
List Agents registered for the mailroom
bash
curl \
-X GET \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/agents
Responses
On success the response will be an array of json objects containing informaiton about the properties of the agents.
json
[ { "items": [ { "address": "agent1qfd3nurhp4k8kcg6mhffqamlu0sm5v45mjg6mvfdf0xcxmuxykcv6kzunpf", "name": "Testing-002", "pending_messages": 0, "bytes_transferred": 0, "previous_bytes_transferred": 0 } ], "total": 1, "page": 1, "size": 50 } ]
Register Agents
Endpoint: POST /v1/agents
Request
Register Agents for the mailroom
bash
curl \
-X POST \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/agents
Responses
On success the response will be a json array containing informaiton about the properties of the agents.
json
[ { "address": "agent1qtw0hy4kj65fv6j7qyv5mgdecq7c4qyqfqnjgc25wz4vf5h47l9l6m7qqtg", "name": "Initialtest", "pending_messages": 0, "bytes_transferred": 0, "previous_bytes_transferred": 0 } ]
Get specific Agent identified by address
Endpoint: GET /v1/agents/{address}
Request
Get specific Agent identified by address
bash
curl \
-X GET \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/agents/{address}
Responses
On success the response will be an array of json objects containing the agent's properties.
json
[ { "address": "agent1qtw0hy4kj65fv6j7qyv5mgdecq7c4qyqfqnjgc25wz4vf5h47l9l6m7qqtg", "name": "Initialtest", "pending_messages": 0, "bytes_transferred": 0, "previous_bytes_transferred": 0 } ]
Update specific Agent identified by address
Endpoint: PUT /v1/agents/{address}
Request
Get specific Agent identified by address
bash
curl \
-X PUT \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/agents/{address}
Responses
On success the response will be an array of json objects including the updated agent name.
json
[ { "address": "agent1qtw0hy4kj65fv6j7qyv5mgdecq7c4qyqfqnjgc25wz4vf5h47l9l6m7qqtg", "name": "Initialtest", "pending_messages": 0, "bytes_transferred": 0, "previous_bytes_transferred": 0 } ]
Delete specific Agent identified by address
Endpoint: DELETE /v1/agents/{address}
Request
Get specific Agent identified by address
bash
curl \
-X DELETE \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/agents/{address}
Responses
On success the response will be the deletion of the agent specified by address.
json
{}
List API-keys
Endpoint: GET /v1/api-keys
Request
List existing API-keys
bash
curl \
-X GET \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/api-keys
Responses
On success the response will be an array of json objects containing informaiton about the API keys and their properties.
json
[ { "items": [ { "uuid": "uuid-example", "key": "API-key example", "name": "Test", "expires_at": "2023-11-26T06:09:05.511108+00:00" } ], "total": 1, "page": 1, "size": 50 } ]
Delete API-key
Endpoint: DELETE /v1/api-keys/{uuid}
Request
Delete an existing API-key
bash
curl \
-X DELETE \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/api-keys/{uuid}
Responses
On success the response will be the deletion of the API key specified by uuid.
json
{}
Get profile usage
Endpoint: GET /v1/api-keys/{uuid}
Request
Get profile usage
bash
curl \
-X GET \
-H Authorization: bearer <your token here> \
https://agentverse.ai/v1/api-keys/{uuid}
Responses
On success the response will be an array of json objects containing information about the profile usage.
json
[ { "bytes_transferred": 0, "bytes_transferred_limit": 200000000, "num_messages": 0, "num_messages_limit": 10000, "bytes_stored": 0, "bytes_stored_limit": 50000000, "num_agents": 1, "num_agents_limit": 4 } ]