POST
/
portfolio
/
:portfolioId
/
archive
curl --request POST \
  --url https://api.glider.fi/portfolio/:portfolioId/archive \
  --header 'Content-Type: <content-type>' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "reason": "<string>",
  "resumeSchedules": true
}'
{
  "success": true,
  "data": {
    "portfolio": {
      "id": "<string>",
      "status": "<string>",
      "unarchivedAt": "<string>",
      "unarchivedBy": "<string>",
      "schedules": [
        {}
      ]
    }
  },
  "NOT_FOUND": {},
  "UNAUTHORIZED": {},
  "FORBIDDEN": {},
  "BAD_REQUEST": {}
}

These endpoints allow you to archive and unarchive portfolios. Archiving a portfolio prevents further transactions and pauses any rebalance schedules.

Archive a Portfolio

POST /portfolio/:portfolioId/archive

Archives a portfolio, preventing further transactions and pausing rebalance schedules.

Path Parameters

portfolioId
string
required

The unique identifier of the portfolio to archive

Request Headers

X-API-KEY
string
required

Your API key

Content-Type
string
required

Must be set to application/json

Request Body

reason
string

Reason for archiving the portfolio (optional)

Response

success
boolean

Indicates if the request was successful

data
object

Unarchive a Portfolio

POST /portfolio/:portfolioId/unarchive

Unarchives a previously archived portfolio, allowing transactions to resume.

Path Parameters

portfolioId
string
required

The unique identifier of the portfolio to unarchive

Request Headers

X-API-KEY
string
required

Your API key

Content-Type
string
required

Must be set to application/json

Request Body

resumeSchedules
boolean
default:"false"

Whether to resume previous rebalance schedules

Response

success
boolean

Indicates if the request was successful

data
object

Example Archive Request

curl -X POST "https://api.glider.fi/portfolio/port_1a2b3c4d5e6f/archive" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "No longer in use"
  }'

Example Archive Response

{
  "success": true,
  "data": {
    "portfolio": {
      "id": "port_1a2b3c4d5e6f",
      "status": "archived",
      "archivedAt": "2023-05-15T14:30:00Z",
      "archivedBy": "api_user_123",
      "archiveReason": "No longer in use"
    }
  }
}

Example Unarchive Request

curl -X POST "https://api.glider.fi/portfolio/port_1a2b3c4d5e6f/unarchive" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "resumeSchedules": true
  }'

Example Unarchive Response

{
  "success": true,
  "data": {
    "portfolio": {
      "id": "port_1a2b3c4d5e6f",
      "status": "active",
      "unarchivedAt": "2023-05-20T09:15:00Z",
      "unarchivedBy": "api_user_123",
      "schedules": [
        {
          "id": "sched_1a2b3c4d",
          "type": "threshold",
          "status": "active"
        }
      ]
    }
  }
}

Error Codes

NOT_FOUND
404

The specified portfolio could not be found

UNAUTHORIZED
401

Invalid or missing API key

FORBIDDEN
403

The API key does not have permission to manage this portfolio

BAD_REQUEST
400

The portfolio is already in the requested state (e.g., archiving an already archived portfolio)

Notes

  • Archiving a portfolio is a non-destructive action - no data or assets are removed
  • All active rebalance schedules are automatically paused when a portfolio is archived
  • When unarchiving, you can choose whether to resume previous rebalance schedules
  • While archived, deposits, withdrawals, and other transactions will be rejected
  • Portfolio data remains accessible for reporting and historical analysis
  • The archive reason is stored for audit and reporting purposes