API Documentation
Use the PJT AI API to manage projects and tasks from external systems, agents, and internal systems.
https://api.pjt.aiAuthentication
PJT AI API supports two authentication methods: API Key and JWT Token.
API Key
API Key is the recommended authentication method for external system integrations. Generate an API Key from your account settings.
Go to the API Key section in your account settings.
Click the 'Create New API Key' button and enter a name.
Store the generated key securely. The full key is only shown at creation time.
Header Format
X-API-Key: pk_live_xxxxxxxxxxxxcURL Example
curl -X GET "https://api.pjt.ai/api/external/v1/workspaces" \
-H "X-API-Key: pk_live_xxxxxxxxxxxx"JavaScript Example
const response = await fetch('https://api.pjt.ai/api/external/v1/workspaces', {
method: 'GET',
headers: {
'X-API-Key': 'pk_live_xxxxxxxxxxxx',
'Content-Type': 'application/json',
},
});
const workspaces = await response.json();JWT Token
JWT Token is used for user session-based authentication. Include the token issued after login in the Authorization header.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Rate Limiting
API calls are subject to rate limiting. If you exceed the limit, a 429 error will be returned.
| Limit Type | Limit Value |
|---|---|
| Requests per minute | 60 |
Rate Limit Exceeded Response
{
"error": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}API Usage
Monitor and query API usage per API Key.
Get API Key usage statistics. Returns today's, monthly, and total usage.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | API Key ID |
Response
{
"apiKeyId": 1,
"todayUsage": 150,
"monthlyUsage": 3420,
"totalUsage": 12500,
"today": "2026-01-20",
"month": "2026-01"
}Get daily usage history.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | API Key ID |
days | query | No | Number of days to query (default: 30) |
Response
{
"apiKeyId": 1,
"history": [
{ "date": "2026-01-20", "count": 150 },
{ "date": "2026-01-19", "count": 230 },
{ "date": "2026-01-18", "count": 180 }
]
}Get monthly API usage for the entire account.
Response
{
"accountId": 1,
"monthlyUsage": [
{ "month": "2026-01", "count": 3420 },
{ "month": "2025-12", "count": 4500 },
{ "month": "2025-11", "count": 3200 }
]
}Workspaces
Get workspace information.
Get a list of workspaces accessible by the current user.
Response
{
"content": [
{
"id": 1,
"name": "My Workspace",
"description": "Main workspace",
"createdAt": "2024-01-10T09:00:00Z"
}
],
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 20
}Get workspace details.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | docs.workspaces.params.id |
Response
{
"id": 1,
"name": "My Workspace",
"description": "Main workspace",
"members": [...],
"createdAt": "2024-01-10T09:00:00Z"
}Projects
Create, read, update, and delete projects.
Get a list of projects in the workspace.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId | path | Yes | Workspace ID |
page | query | No | Page number (starts from 0) |
size | query | No | Page size (default: 20) |
Response
{
"content": [
{
"id": 1,
"name": "Website Redesign",
"description": "Complete website overhaul",
"status": "IN_PROGRESS",
"startDate": "2024-01-15",
"endDate": "2024-03-30",
"createdAt": "2024-01-10T09:00:00Z"
}
],
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 20
}Get project details.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Project ID |
Response
{
"id": 1,
"name": "Website Redesign",
"description": "Complete website overhaul",
"status": "IN_PROGRESS",
"startDate": "2024-01-15",
"endDate": "2024-03-30",
"tasks": [...],
"createdAt": "2024-01-10T09:00:00Z"
}Create a new project.
Request Body
{
"workspaceId": 1,
"name": "New Project",
"description": "Project description",
"startDate": "2024-01-15",
"endDate": "2024-03-30"
}Response
{
"id": 1,
"name": "New Project",
"description": "Project description",
"status": "PLANNING",
"startDate": "2024-01-15",
"endDate": "2024-03-30",
"createdAt": "2024-01-10T09:00:00Z"
}Update project information.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Project ID |
Request Body
{
"name": "Updated Project Name",
"status": "IN_PROGRESS"
}Response
{
"id": 1,
"name": "Updated Project Name",
"status": "IN_PROGRESS",
...
}Delete a project.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Project ID |
Response
204 No ContentTasks
Manage tasks within a project.
Get all tasks in the project (no pagination).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | path | Yes | Project ID |
Response
[
{
"id": 1,
"title": "Design mockups",
"description": "Create initial design mockups",
"status": "IN_PROGRESS",
"priority": "HIGH",
"dueDate": "2024-01-20",
"assignee": { "id": 1, "name": "John Doe" }
}
]Get tasks in the project (with pagination).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | path | Yes | Project ID |
page | query | No | Page number (starts from 0) |
size | query | No | Page size (default: 20) |
Response
{
"content": [
{
"id": 1,
"title": "Design mockups",
"description": "Create initial design mockups",
"status": "IN_PROGRESS",
"priority": "HIGH",
"dueDate": "2024-01-20"
}
],
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 20
}Get task details.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Task ID |
Response
{
"id": 1,
"title": "Design mockups",
"description": "Create initial design mockups",
"status": "IN_PROGRESS",
"priority": "HIGH",
"dueDate": "2024-01-20",
"assignee": { "id": 1, "name": "John Doe" },
"project": { "id": 1, "name": "Website Redesign" }
}Create a new task.
Request Body
{
"projectId": 1,
"title": "New Task",
"description": "Task description",
"priority": "MEDIUM",
"dueDate": "2024-01-25",
"assigneeId": 1
}Response
{
"id": 2,
"title": "New Task",
"description": "Task description",
"status": "TODO",
"priority": "MEDIUM",
"dueDate": "2024-01-25"
}Update task information.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Task ID |
Request Body
{
"title": "Updated Task",
"status": "IN_PROGRESS",
"priority": "HIGH"
}Response
{
"id": 1,
"title": "Updated Task",
"status": "IN_PROGRESS",
"priority": "HIGH",
...
}Delete a task.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Task ID |
Response
204 No ContentGet tasks assigned to the current user.
Response
[
{
"id": 1,
"title": "Design mockups",
"description": "Create initial design mockups",
"status": "IN_PROGRESS",
"priority": "HIGH",
"dueDate": "2024-01-20",
"project": { "id": 1, "name": "Website Redesign" }
}
]Documents
Manage project documents.
Get all documents in the project (no pagination).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | path | Yes | Project ID |
Response
[
{
"id": 1,
"title": "Project Requirements",
"type": "SPECIFICATION",
"createdAt": "2024-01-10T09:00:00Z",
"updatedAt": "2024-01-15T14:30:00Z"
}
]Get documents in the project (with pagination).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | path | Yes | Project ID |
page | query | No | Page number (starts from 0) |
size | query | No | Page size (default: 20) |
Response
{
"content": [
{
"id": 1,
"title": "Project Requirements",
"type": "SPECIFICATION",
"createdAt": "2024-01-10T09:00:00Z",
"updatedAt": "2024-01-15T14:30:00Z"
}
],
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 20
}Get document details.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Document ID |
Response
{
"id": 1,
"title": "Project Requirements",
"type": "SPECIFICATION",
"content": "Document content here...",
"project": { "id": 1, "name": "Website Redesign" },
"createdAt": "2024-01-10T09:00:00Z",
"updatedAt": "2024-01-15T14:30:00Z"
}Create a new document.
Request Body
{
"projectId": 1,
"title": "API Specification",
"type": "SPECIFICATION",
"content": "Document content here..."
}Response
{
"id": 2,
"title": "API Specification",
"type": "SPECIFICATION",
"createdAt": "2024-01-20T10:00:00Z"
}Update document information.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Document ID |
Request Body
{
"title": "Updated Title",
"content": "Updated content..."
}Response
{
"id": 1,
"title": "Updated Title",
"content": "Updated content...",
"updatedAt": "2024-01-20T10:00:00Z"
}Delete a document.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | path | Yes | Document ID |
Response
204 No ContentIntegrations
Integrate PJT AI API with external automation tools to automate your workflows.
n8n Setup
To use PJT AI API in n8n, configure authentication in the HTTP Request node.
Add an HTTP Request node to your n8n workflow.
Set Authentication to 'Generic Credential Type'.
Create a 'Header Auth' credential and enter X-API-Key with your API key.
Set the Base URL and call API endpoints.
Credential Configuration
{
"name": "PJT AI API",
"type": "httpHeaderAuth",
"data": {
"name": "X-API-Key",
"value": "pk_live_xxxxxxxxxxxx"
}
}Workflow Examples
Workflow automation examples using n8n.
Create Project from Slack Message
Automatically create a new project when a specific keyword is detected in a Slack message.
{
"nodes": [
{
"name": "Slack Trigger",
"type": "n8n-nodes-base.slackTrigger",
"parameters": {
"channel": "#project-requests"
}
},
{
"name": "Create Project",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://api.pjt.ai/api/external/v1/projects",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{ "name": "Content-Type", "value": "application/json" }
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{ "name": "workspaceId", "value": "1" },
{ "name": "name", "value": "={{ $json.text }}" },
{ "name": "description", "value": "Created from Slack" }
]
}
}
}
]
}Overdue Task Notifications
Daily check for overdue tasks and send Slack notifications to assignees.
{
"nodes": [
{
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"parameters": {
"rule": { "interval": [{ "field": "hours", "hoursInterval": 1 }] }
}
},
{
"name": "Get Tasks",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://api.pjt.ai/api/external/v1/projects/{{projectId}}/tasks",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "httpHeaderAuth",
"qs": { "status": "IN_PROGRESS" }
}
},
{
"name": "Filter Overdue",
"type": "n8n-nodes-base.filter",
"parameters": {
"conditions": {
"dateTime": [{
"value1": "={{ $json.dueDate }}",
"operation": "before",
"value2": "={{ $now }}"
}]
}
}
},
{
"name": "Send Notification",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#alerts",
"text": "Overdue task: {{ $json.title }}"
}
}
]
}Create Task from GitHub Issue
Automatically create a PJT AI task when a new issue is created in GitHub.
{
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"parameters": {
"path": "github-issue",
"httpMethod": "POST"
}
},
{
"name": "Create Task",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://api.pjt.ai/api/external/v1/projects/{{projectId}}/tasks",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{ "name": "title", "value": "={{ $json.issue.title }}" },
{ "name": "description", "value": "={{ $json.issue.body }}" },
{ "name": "priority", "value": "MEDIUM" }
]
}
}
}
]
}Error Handling
The API uses standard HTTP status codes to indicate request success or failure.
| Status Code | Meaning | The API uses standard HTTP status codes to indicate request success or failure. |
|---|---|---|
200 | OK | Request was successful. |
201 | Created | Resource was successfully created. |
204 | No Content | Request succeeded with no content to return. |
400 | Bad Request | Bad request. Check the request format. |
401 | Unauthorized | Authentication required or credentials are invalid. |
403 | Forbidden | No permission to access the resource. |
404 | Not Found | Requested resource not found. |
429 | Too Many Requests | Rate limit exceeded. Please try again later. |
500 | Internal Server Error | Internal server error. |
Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request body contains invalid data",
"details": [
{
"field": "name",
"message": "Name is required"
}
]
}
}