Activity Log

Base Path: /v1/activity

Get Recent Activity Log Entries

Method: GET Endpoint: https://api.tokensource.com/v1/activity Description: Retrieves the 50 most recent activity log entries for the authenticated user, ordered by creation date (newest first).

Response (200 OK):

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "action": "create_objective",
      "details": "Created objective 'Project Alpha'",
      "createdAt": "2023-10-27T10:00:00Z",
      "username": "johndoe"
    }
  ]
}

Get Specific Activity Log Entry

Method: GET Endpoint: https://api.tokensource.com/v1/activity/{id} Description: Retrieves a specific activity log entry by its ID, only if it belongs to the authenticated user.

Parameters:

  • id (integer, required): The ID of the activity log entry.

Response (200 OK):

{
  "status": 200,
  "data": {
    "id": 2,
    "action": "update_assistant",
    "details": "Updated AI assistant 'Beta'",
    "createdAt": "2023-10-26T15:30:00Z",
    "username": "johndoe"
  }
}

Response (404 Not Found):

{
  "status": 404,
  "message": "Activity log entry not found"
}

Create Activity Log Entry

Method: POST Endpoint: https://api.tokensource.com/v1/activity Description: Creates a new activity log entry for the authenticated user. Primarily used internally by the application.

Request Body:

{
  "action": "string",
  "details": "string"
}

Response (201 Created):

{
  "status": 201,
  "data": {
    "id": 3,
    "message": "Activity log entry created successfully"
  }
}

Delete Activity Log Entry

Method: DELETE Endpoint: https://api.tokensource.com/v1/activity/{id} Description: Deletes a specific activity log entry by its ID, only if it belongs to the authenticated user.

Parameters:

  • id (integer, required): The ID of the activity log entry.

Response (200 OK):

{
  "status": "success",
  "message": "Activity log entry deleted successfully"
}

Response (404 Not Found):

{
  "status": "error",
  "message": "Activity log entry not found"
}

Last updated