fegura.ai

Accounts

The Accounts API lets you list and retrieve your connected AWS accounts. These are accounts that have been connected through the Fegura dashboard with the required IAM role.

GET/api/accountsread

List all connected AWS accounts

GET/api/accounts/{id}read

Retrieve a specific AWS account


List Accounts

GET/api/accountsread

Returns a paginated list of all connected AWS accounts for your organization.

Query Parameters

ParameterTypeDescription
limitintegerNumber of accounts to return per page (1-100)Default: 20
cursorstringPagination cursor from previous response

Example Request

curl "https://api.fegura.ai/api/accounts?limit=10" \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01"

Response

{
  "success": true,
  "data": {
    "accounts": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "alias": "Production",
        "awsAccountId": "123456789012",
        "status": "connected",
        "createdAt": "2026-01-15T10:30:00.000Z",
        "updatedAt": "2026-01-15T10:30:00.000Z"
      },
      {
        "id": "550e8400-e29b-41d4-a716-446655440001",
        "alias": "Staging",
        "awsAccountId": "987654321098",
        "status": "connected",
        "createdAt": "2026-01-10T08:00:00.000Z",
        "updatedAt": "2026-01-10T08:00:00.000Z"
      }
    ],
    "meta": {
      "cursor": "eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMSJ9",
      "hasMore": true
    }
  }
}

Response Fields

ParameterTypeDescription
idstringUnique identifier for the account connection (UUID)
aliasstringUser-defined name for the account
awsAccountIdstring12-digit AWS account ID
statusstringConnection status: "connected", "pending", or "failed"
createdAtstringISO 8601 timestamp of when the account was connected
updatedAtstringISO 8601 timestamp of the last update

Get Account

GET/api/accounts/{id}read

Retrieves detailed information about a specific connected AWS account.

Path Parameters

ParameterTypeDescription
idrequiredstringThe account connection ID (UUID)

Example Request

curl "https://api.fegura.ai/api/accounts/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01"

Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "alias": "Production",
    "awsAccountId": "123456789012",
    "roleArn": "arn:aws:iam::123456789012:role/FeguraRole-abc123",
    "externalId": "abc123-def456-ghi789",
    "status": "connected",
    "errorMessage": null,
    "createdAt": "2026-01-15T10:30:00.000Z",
    "updatedAt": "2026-01-15T10:30:00.000Z"
  }
}

Additional Response Fields

ParameterTypeDescription
roleArnstringARN of the IAM role used for cross-account access
externalIdstringExternal ID used for STS assume role
errorMessagestring | nullError details if status is "failed"

Account Statuses

StatusDescription
connectedAccount is fully connected and ready for scanning
pendingIAM role setup is in progress or awaiting verification
failedConnection failed; check errorMessage for details