POST
/
v1
/
organizations
/
folders
/
get
curl --request POST \
  --url https://api.velt.dev/v1/organizations/folders/get \
  --header 'Content-Type: application/json' \
  --header 'x-velt-api-key: <x-velt-api-key>' \
  --header 'x-velt-auth-token: <x-velt-auth-token>' \
  --data '{
  "data": {
    "organizationId": "<string>",
    "folderId": "<string>"
  }
}'
{
  "result": {
    "status": "success",
    "message": "Folders retrieved successfully.",
    "data": [
      {
        "folderId": "folderId1",
        "folderName": "Folder 1",
        "organizationId": "yourOrganizationId",
        "parentFolderId": "root",
        "createdAt": 1738695077691,
        "lastUpdated": 1738695077691,
        "subFolders": [
          {
            "folderId": "childFolderId1",
            "folderName": "Child Folder 1",
            "organizationId": "yourOrganizationId",
            "parentFolderId": "folderId1",
            "createdAt": 1738695615706,
            "lastUpdated": 1738698727591
          }
        ]
      }
    ]
  }
}

Use this API to retrieve the given folder’s metadata and its subfolders.

Prior to using this API, you must:

  • Deploy v4.0.0-beta.19 or higher of the Velt SDK.
  • Enable advanced queries option in the console

Endpoint

POST https://api.velt.dev/v1/organizations/folders/get

Headers

x-velt-api-key
string
required

Your API key.

x-velt-auth-token
string
required

Body

Params

data
object
required

Example Requests

1. Get all folders in organization

{
  "data": {
    "organizationId": "yourOrganizationId"
  }
}

2. Get specific folder in an organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "folderId": "yourFolderId"
  }
}

Response

Success Response for All Folders

{
  "result": {
    "status": "success",
    "message": "Folders retrieved successfully.",
    "data": [
      {
        "folderId": "folderId1",
        "folderName": "Folder 1",
        "organizationId": "yourOrganizationId",
        "parentFolderId": "root",
        "createdAt": 1738695615706,
        "lastUpdated": 1738696287859
      },
      {
        "folderId": "folderId2",
        "folderName": "Folder 2",
        "organizationId": "yourOrganizationId",
        "parentFolderId": "root",
        "createdAt": 1738695077691,
        "lastUpdated": 1738695077691
      }
    ]
  }
}

Success Response for Specific Folder

{
  "result": {
    "status": "success",
    "message": "Folders retrieved successfully.",
    "data": [
      {
        "folderId": "folderId1",
        "folderName": "Folder 1",
        "organizationId": "yourOrganizationId",
        "parentFolderId": "root",
        "createdAt": 1738695077691,
        "lastUpdated": 1738695077691,
        "subFolders": [
          {
            "folderId": "childFolderId1",
            "folderName": "Child Folder 1",
            "organizationId": "yourOrganizationId",
            "parentFolderId": "folderId1",
            "createdAt": 1738695615706,
            "lastUpdated": 1738698727591
          }
        ]
      }
    ]
  }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
{
  "result": {
    "status": "success",
    "message": "Folders retrieved successfully.",
    "data": [
      {
        "folderId": "folderId1",
        "folderName": "Folder 1",
        "organizationId": "yourOrganizationId",
        "parentFolderId": "root",
        "createdAt": 1738695077691,
        "lastUpdated": 1738695077691,
        "subFolders": [
          {
            "folderId": "childFolderId1",
            "folderName": "Child Folder 1",
            "organizationId": "yourOrganizationId",
            "parentFolderId": "folderId1",
            "createdAt": 1738695615706,
            "lastUpdated": 1738698727591
          }
        ]
      }
    ]
  }
}