POST
/
v2
/
auth
/
permissions
/
get
Get Permissions
curl --request POST \
  --url https://api.velt.dev/v2/auth/permissions/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>",
    "userIds": [
      {}
    ],
    "folderIds": [
      {}
    ],
    "documentIds": [
      {}
    ]
  }
}'
{
  "result": {
    "permissions": {
      "samarth": {
        "organization": {
          "org1": { "accessRole": "editor" }
        },
        "documents": {
          "freestyle-comments1": { "accessRole": "viewer", "expiresAt": 1728902400 }
        }
      }
    }
  }
}
Use this API to get a user’s permissions for various resources like organizations, folders, documents, etc.
  • Returns permissions per user and resource. Temporary permissions include an expiresAt (Unix seconds) value.
  • See the Access Control overview for concepts and detailed guidance.

Endpoint

POST https://api.velt.dev/v2/auth/permissions/get

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

data
object
required

Example Request

{
  "data": {
    "organizationId": "org1",
    "documentIds": ["freestyle-comments1"],
    "userIds": ["samarth"]
  }
}

Response

Success Response

{
  "result": {
    "permissions": {
      "samarth": {
        "organization": {
          "org1": { "accessRole": "editor" }
        },
        "documents": {
          "freestyle-comments1": { "accessRole": "viewer", "expiresAt": 1728902400 }
        },
        "folders": {
          "folder_123": { "accessRole": "editor" }
        }
      }
    }
  }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
{
  "result": {
    "permissions": {
      "samarth": {
        "organization": {
          "org1": { "accessRole": "editor" }
        },
        "documents": {
          "freestyle-comments1": { "accessRole": "viewer", "expiresAt": 1728902400 }
        }
      }
    }
  }
}