> For the complete documentation index, see [llms.txt](https://ai-security-docs.akto.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-security-docs.akto.io/api-reference/user-management/fetch-data.md).

# Fetch Data

## User, Auth & Access Control

<table data-full-width="true"><thead><tr><th width="50">#</th><th width="400">API</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td><strong>POST /api/me</strong></td><td>Fetches the current logged-in user's profile information including login, name, role, and associated accounts.</td></tr><tr><td>2</td><td><strong>POST /api/fetchUserLastLoginTs</strong></td><td>Fetches the Unix timestamp of the current user's last login.</td></tr><tr><td>3</td><td><strong>POST /api/getCustomRoles</strong></td><td>Retrieves all custom roles defined in the system for the current account.</td></tr><tr><td>4</td><td><strong>POST /api/getRoleHierarchy</strong></td><td>Returns the role hierarchy that the current user is permitted to assign to others.</td></tr><tr><td>5</td><td><strong>POST /api/getAccessTypes</strong></td><td>Fetches access-type information (public, private, partner) for a given list of Agentic Component URLs.</td></tr><tr><td>6</td><td><strong>POST /api/fetchApiTokens</strong></td><td>Fetches all API Request tokens (including Slack webhook tokens) belonging to the current user in the current account.</td></tr><tr><td>7</td><td><strong>POST /api/getCustomerStiggDetails</strong></td><td>Fetches a signed Stigg customer token for authenticating the Stigg in-app widget on the client side.</td></tr><tr><td>8</td><td><strong>POST /api/getUserAnalysis</strong></td><td>Fetches user analysis data for a given MCP agent and device, used by the Endpoint Shield agent.</td></tr></tbody></table>

## POST /api/me

> POST request for endpoint /api/me

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/me":{"post":{"summary":"POST request for endpoint /api/me","operationId":"/api/me-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"No request body required."}}}},"responses":{"200":{"description":"Returns the current user's profile details.","content":{"application/json":{"schema":{"type":"object","description":"User profile object","properties":{"user":{"type":"object","properties":{"login":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"accounts":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}}}}}}}
```

## POST /api/fetchUserLastLoginTs

> POST request for endpoint /api/fetchUserLastLoginTs

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/fetchUserLastLoginTs":{"post":{"summary":"POST request for endpoint /api/fetchUserLastLoginTs","operationId":"/api/fetchUserLastLoginTs-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"No request body required."}}}},"responses":{"200":{"description":"Returns the last login timestamp.","content":{"application/json":{"schema":{"type":"object","properties":{"lastLoginTs":{"type":"integer","description":"Unix epoch timestamp (seconds) of the user's last login."}}}}}}}}}}}
```

## POST /api/getCustomRoles

> POST request for endpoint /api/getCustomRoles

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getCustomRoles":{"post":{"summary":"POST request for endpoint /api/getCustomRoles","operationId":"/api/getCustomRoles-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"No request body required."}}}},"responses":{"200":{"description":"Returns the list of custom roles.","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","description":"List of CustomRole objects.","items":{"type":"object","properties":{"name":{"type":"string"},"baseRole":{"type":"string"},"apiCollectionIds":{"type":"array","items":{"type":"integer"}},"defaultInviteRole":{"type":"boolean"},"allowedFeaturesForUser":{"type":"array","items":{"type":"string"}}}}}}}}}}}}}}}
```

## POST /api/getRoleHierarchy

> POST request for endpoint /api/getRoleHierarchy

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getRoleHierarchy":{"post":{"summary":"POST request for endpoint /api/getRoleHierarchy","operationId":"/api/getRoleHierarchy-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"No request body required."}}}},"responses":{"200":{"description":"Returns the list of roles below the current user's role.","content":{"application/json":{"schema":{"type":"object","properties":{"userRoleHierarchy":{"type":"array","description":"Array of Role enum values that the current user can assign.","items":{"type":"string"}}}}}}}}}}}}
```

## POST /api/getAccessTypes

> POST request for endpoint /api/getAccessTypes

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getAccessTypes":{"post":{"summary":"POST request for endpoint /api/getAccessTypes","operationId":"/api/getAccessTypes-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["urls"],"properties":{"urls":{"type":"array","description":"List of API endpoint URLs to look up access types for.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns ApiInfo objects with access type details for each URL.","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","properties":{"apiInfos":{"type":"array","description":"List of ApiInfo objects containing access type details.","items":{"type":"object","properties":{"url":{"type":"string"},"accessType":{"type":"string"}}}}}}}}}}}}}}}}
```

## POST /api/fetchApiTokens

> POST request for endpoint /api/fetchApiTokens

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/fetchApiTokens":{"post":{"summary":"POST request for endpoint /api/fetchApiTokens","operationId":"/api/fetchApiTokens-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"No request body required."}}}},"responses":{"200":{"description":"Returns all API tokens for the current user.","content":{"application/json":{"schema":{"type":"object","properties":{"apiTokenList":{"type":"array","description":"List of ApiToken objects, including Slack webhook tokens.","items":{"type":"object","properties":{"id":{"type":"integer"},"key":{"type":"string"},"utility":{"type":"string"},"userId":{"type":"integer"}}}}}}}}}}}}}}
```

## POST /api/getCustomerStiggDetails

> POST request for endpoint /api/getCustomerStiggDetails

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getCustomerStiggDetails":{"post":{"summary":"POST request for endpoint /api/getCustomerStiggDetails","operationId":"/api/getCustomerStiggDetails-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"type":"string","format":"uuid","description":"Organisation ID in UUID format, used as the Stigg customer identifier."}}}}}},"responses":{"200":{"description":"Returns a signed Stigg customer token.","content":{"application/json":{"schema":{"type":"object","properties":{"customerToken":{"type":"string","description":"Signed JWT/signature token for authenticating with the Stigg client SDK."}}}}}}}}}}}
```

## POST /api/getUserAnalysis

> POST request for endpoint /api/getUserAnalysis

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getUserAnalysis":{"post":{"summary":"POST request for endpoint /api/getUserAnalysis","operationId":"/api/getUserAnalysis-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["agentId","deviceId"],"properties":{"agentId":{"type":"string","description":"Identifier of the MCP agent/service."},"deviceId":{"type":"string","description":"Identifier of the device making the request."}}}}}},"responses":{"200":{"description":"Returns the user analysis data for the specified agent and device.","content":{"application/json":{"schema":{"type":"object","properties":{"userAnalysis":{"type":"object","description":"UserAnalysisData object matching the provided agentId and deviceId.","properties":{"agentId":{"type":"string"},"deviceId":{"type":"string"},"analysisData":{"type":"object","description":"Raw analysis data payload."}}}}}}}}}}}}}
```
