Activities & Events
Get Activity
Get details for a specific activity
GET
/
accounts
/
{account_id}
/
activities
/
{activity_id}
Get Activity
curl --request GET \
--url https://api.example.com/accounts/{account_id}/activities/{activity_id}import requests
url = "https://api.example.com/accounts/{account_id}/activities/{activity_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/accounts/{account_id}/activities/{activity_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts/{account_id}/activities/{activity_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts/{account_id}/activities/{activity_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/accounts/{account_id}/activities/{activity_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts/{account_id}/activities/{activity_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGet Activity
Returns detailed information about a specific activity. See Activities & Events for the full activity definition.Request
GET /accounts/:account_id/activities/:activity_id
Path parameters
| Parameter | Type | Description |
|---|---|---|
account_id | string | The sub-account ID |
activity_id | integer | The activity ID |
Examples
curl https://prime-api.legend.xyz/accounts/acc_2o0yiljtp378/activities/1 \
-H "Authorization: Bearer $LEGEND_QUERY_KEY"
const activity = await client.accounts.activity("acc_2o0yiljtp378", 1);
activity = await client.accounts.activity("acc_2o0yiljtp378", 1)
let activity = client.accounts.activity("acc_2o0yiljtp378", 1).await?;
Response
{
"id": 1,
"status": "completed",
"quark_intent": {
"id": 7,
"mercator_version": "1.2.0",
"intent_type": "supply",
"intent": {
"amount": "1000000",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"comet": "0xb125E6687d4313864e53df431d5425969c15Eb2F",
"chain_id": 8453
}
},
"executions": [
{
"execution_type": "transaction",
"chain_id": 8453,
"transaction_hash": "0xabc123...def456",
"status": "executed",
"executed_at": "2025-06-15T10:30:15Z",
"reverted_at": null,
"actions": [
{
"action_type": "COMET_SUPPLY",
"expected_values": {
"amount": 1000000,
"asset_symbol": "USDC",
"chain_id": 8453,
"comet": "0xb125E6687d4313864e53df431d5425969c15Eb2F",
"price": "0.9998",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"observed_values": {
"amount": 1000000,
"asset_symbol": "USDC",
"chain_id": 8453,
"comet": "0xb125E6687d4313864e53df431d5425969c15Eb2F",
"price": "0.9998",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
}
]
}
]
}
Errors
| Status | Code | Description |
|---|---|---|
| 404 | not_found | Activity doesn’t exist or belongs to a different account |
⌘I
Get Activity
curl --request GET \
--url https://api.example.com/accounts/{account_id}/activities/{activity_id}import requests
url = "https://api.example.com/accounts/{account_id}/activities/{activity_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/accounts/{account_id}/activities/{activity_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts/{account_id}/activities/{activity_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts/{account_id}/activities/{activity_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/accounts/{account_id}/activities/{activity_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts/{account_id}/activities/{activity_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body