Skip to content

Authentication

Developer

Prodgy supports two authentication methods for API access:

MethodRecommended useHeader
API TokenExternal integrations and automationsX-API-Token: prodgy_...
JWTAuthenticated user sessionsAuthorization: Bearer <jwt>

For external integrations, always use API tokens.


Super Admin users can override their organization context by sending the X-Organization-Id header with any request. This allows them to operate in the context of a different organization than their profile’s default.

X-Organization-Id: 6480d1ad-5535-40e1-95b0-05774d3dc4b0

The header must contain a valid UUID. It is automatically injected by the Prodgy frontend when a Super Admin selects an organization in the sidebar dropdown.


Tokens follow the format:

prodgy_<random_characters>

Example: prodgy_k8d9Jf2kL9mP3qR4sT5uV6wX7yZ8aB9c

Include the token in one of the following header formats:

X-API-Token: prodgy_k8d9Jf2kL9mP3qR4sT5uV6wX7yZ8aB9c

or

Authorization: Bearer prodgy_k8d9Jf2kL9mP3qR4sT5uV6wX7yZ8aB9c
curl -X GET https://<instance>/api/agent-base/product/<product_id> \
  -H "X-API-Token: prodgy_k8d9Jf2kL9mP3qR4sT5uV6wX7yZ8aB9c"

The following endpoints are accessible via API Token, grouped by category:

EndpointMethodsDescription
/api/agent-baseGET, POST, DELETEList, install and uninstall agents for a workspace
/api/agent-base/{id}/executionsGETList executions for a specific agent
/api/agent-base/triggersGET, POSTList and execute manual triggers
EndpointMethodsDescription
/api/workflow/executePOSTExecute a workflow test
/api/workflow/{executionId}/statusGETGet execution status
/api/workflow/{executionId}/eventsGETStream execution events (SSE)
/api/workflow/{executionId}/stopPOSTStop a running execution
/api/workflow/{executionId}/pausePOSTPause a running execution
/api/workflow/{executionId}/continuePOSTResume a paused execution
EndpointMethodsDescription
/api/workflow-baseGET, POST, PUT, DELETEManage workflow base definitions
EndpointMethodsDescription
/api/nodes/executePOSTExecute a single node
/api/nodes/status/{nodeId}GETGet node execution status
EndpointMethodsDescription
/api/integrations-baseGET, POST, PUT, DELETEManage integration configurations
/api/external/integrationsGETList active integrations for the organization
EndpointMethodsDescription
/api/knowledge-base/{productId}GETList knowledge bases for a workspace
/api/knowledge-base/embeddingsGET, POST, PUT, DELETEManage embeddings and semantic search
/api/knowledge-base/storageGET, POST, PUT, DELETEUpload, download and manage files
EndpointMethodsDescription
/api/assistant/chatPOSTSend a message and receive AI response (streaming)
/api/assistant/chat/historyGETRetrieve chat session history
EndpointMethodsDescription
/api/api-token/auth/validateGETValidate the current API token

Tokens are created through the Prodgy interface or via API (with JWT authentication).

  1. Go to workspace settings (gear button in the navbar)
  2. Click the API Tokens tab
  3. Click Create Token
  4. Enter the name and, optionally, an expiration date
  5. Copy the generated token — it is displayed only once
POST /api/api-tokens
Content-Type: application/json
Authorization: Bearer <jwt_token>

{
  "product_id": "644c3604-4fd3-4681-846b-8ae14f18f00d",
  "token_name": "My Integration",
  "expires_at": "2026-12-31T23:59:59Z"
}

Response (201):

{
  "success": true,
  "message": "API token created successfully",
  "data": {
    "id": "uuid",
    "token": "prodgy_...",
    "token_name": "My Integration",
    "token_prefix": "prodgy_k8...",
    "product_id": "644c3604-...",
    "expires_at": "2026-12-31T23:59:59Z",
    "created_at": "2026-03-05T10:00:00Z"
  }
}

To check if a token is valid:

GET /api/api-token/auth/validate
X-API-Token: prodgy_<token>

Response (200) — Valid token:

{
  "success": true,
  "authType": "api_token",
  "userId": "uuid",
  "productId": "uuid",
  "organizationId": "uuid",
  "apiTokenId": "uuid"
}

Response (401) — Invalid token:

{
  "error": "Unauthorized",
  "message": "Invalid API token"
}

GET /api/api-tokens/product/{productId}
Authorization: Bearer <jwt_token>
PUT /api/api-tokens/{id}
Content-Type: application/json
Authorization: Bearer <jwt_token>

{
  "token_name": "New Name",
  "is_active": true,
  "expires_at": "2027-06-30T23:59:59Z"
}
POST /api/api-tokens/{id}/revoke
Authorization: Bearer <jwt_token>
POST /api/api-tokens/{id}/renew
Content-Type: application/json
Authorization: Bearer <jwt_token>

{
  "expires_at": "2027-12-31T23:59:59Z"
}
POST /api/api-tokens/{id}/regenerate
Authorization: Bearer <jwt_token>
DELETE /api/api-tokens/{id}
Authorization: Bearer <jwt_token>

Each token usage is automatically logged. To query the logs:

GET /api/api-tokens/{id}/audit-logs?limit=100
Authorization: Bearer <jwt_token>

Response:

{
  "success": true,
  "data": [
    {
      "action": "used",
      "ip_address": "192.168.1.100",
      "user_agent": "curl/7.88.0",
      "endpoint": "/api/agent-base/product/...",
      "status_code": 200,
      "created_at": "2026-03-05T14:30:00Z"
    }
  ]
}
ActionDescription
createdToken was created
usedToken was used in a request
revokedToken was revoked
expiredToken expired
renewedToken expiration was extended
regeneratedNew token was generated from the previous one

  • Use HTTPS for all requests in production
  • Never expose tokens in code repositories or public logs
  • Configure expiration dates for temporary tokens
  • Rotate tokens periodically using the regenerate function
  • Monitor audit logs to detect suspicious access
  • Use one token per integration for easier tracking