> ## Documentation Index
> Fetch the complete documentation index at: https://pay3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Linked Smart Accounts — Pay3 Smart Accounts

> Return all Soroban smart account contracts linked to your Pay3 account, ordered by most recently linked first. Returns an empty array if none are linked.

Smart accounts are Soroban contracts deployed on Stellar that act as programmable spending vaults. Once you link a deployed contract to your Pay3 account, AI sessions can reference it to authorize and execute on-chain payments within your defined policies. This endpoint returns every smart account you have linked, ordered by most recently linked first.

## Endpoint

**`GET /api/smart-accounts`**

Authentication is **required**. Include either the `pay3_session` cookie or an `Authorization: Bearer <session-token>` header.

***

## Response

All Pay3 API responses are wrapped in a standard envelope:

```json theme={null}
{
  "data": [ ... ],
  "requestId": "req_01hx2q3r4s5t6u7v8w9x0y1z"
}
```

A successful `200 OK` response returns an array of smart account objects inside `data`. The array is empty (`[]`) if you have not yet linked any contracts.

**data** `array`

Array of linked smart account records.

**item fields**

**data\[].id** `string`

Pay3 internal smart account record ID (UUID).

**data\[].userId** `string`

The Pay3 user ID that owns this smart account record.

**data\[].walletId** `string`

The Pay3 wallet record ID this smart account is associated with.

**data\[].contractId** `string`

The Soroban contract address on Stellar — a 56-character `C...` string.

**data\[].network** `string`

The Stellar network this contract is deployed on — `TESTNET` or `PUBLIC`.

**data\[].createdAt** `string`

ISO 8601 timestamp of when this smart account was linked to your Pay3
account.

**data\[].updatedAt** `string`

ISO 8601 timestamp of when this smart account record was last updated.

**requestId** `string`

A unique identifier for this API request, useful for support and debugging.

***

## Example

### Request

```bash theme={null}
curl --request GET \
  --url https://api.pay3.dev/api/smart-accounts \
  --header 'Authorization: Bearer your-session-token-here'
```

### Response Body

```json theme={null}
{
  "data": [
    {
      "id": "e7f8a9b0-c1d2-3456-7890-abcdef123456",
      "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "walletId": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
      "contractId": "CDJT5OQNBBSXMFBKXH3ZHQJH3XPXKBQQMYIBNHQK5ZYXDV7KXQHRMTE",
      "network": "TESTNET",
      "createdAt": "2024-11-01T10:30:00.000Z",
      "updatedAt": "2024-11-01T10:30:00.000Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
      "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "walletId": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
      "contractId": "CCWAMYJME4H5CKG7OLXGC2T4M7FQGKWH3Y7TMKHBRVNLG6ZQPQHXJDE",
      "network": "TESTNET",
      "createdAt": "2024-10-15T08:00:00.000Z",
      "updatedAt": "2024-10-15T08:00:00.000Z"
    }
  ],
  "requestId": "req_01hx2q3r4s5t6u7v8w9x0y1z"
}
```

### Empty Response (no accounts linked)

```json theme={null}
{
  "data": [],
  "requestId": "req_01hx2q3r4s5t6u7v8w9x0y1z"
}
```

***

## Error Responses

| HTTP Status | Description |
| - | - |
| `401 Unauthorized` | Missing or invalid session. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.