# Claude Code setup Source: https://developers.projectcor.com/ai-tools/claude-code Configure Claude Code for COR API development Claude Code is Anthropic's official CLI tool. This guide shows how to configure Claude Code with context about COR APIs for building integrations. ## Prerequisites * Active Claude subscription (Pro, Max, or API access) * COR API credentials (API Key and Client Secret) ## Setup 1. Install Claude Code globally: ```bash theme={null} npm install -g @anthropic-ai/claude-code ``` 2. Navigate to your project directory. 3. Add the `CLAUDE.md` file below to your project root. 4. Run `claude` to start. ## Create `CLAUDE.md` Create a `CLAUDE.md` file at the root of your project to provide Claude Code with COR API context: ````markdown theme={null} # COR API Integration ## Working Relationship - Ask for clarification rather than making assumptions about API usage - Verify endpoint paths and required fields before generating code - Reference the COR API documentation when uncertain ## COR Platform COR is a project management platform for agencies. Three APIs are available: | API | Base URL | |-----|----------| | Main API | `https://api.projectcor.com/v1` | | Resource Allocation | `https://planner.svc.v2.projectcor.com` | | Integrations | `https://integrations.projectcor.com` | ## Authentication OAuth 2.0 with Bearer tokens (same token for all APIs). ```bash # Get token curl -X POST 'https://api.projectcor.com/v1/oauth/token?grant_type=client_credentials' \ -H 'Authorization: Basic BASE64(API_KEY:CLIENT_SECRET)' # Use token Authorization: Bearer ACCESS_TOKEN ``` ## Main API Entities - **Clients** `/clients` - Customer accounts - **Projects** `/projects` - Project management - **Tasks** `/tasks` - Task tracking - **Hours** `/hours` - Time entries - **Users** `/users` - Team members - **Brands** `/brands` - Client brands - **Products** `/products` - Brand products ### User Roles `1` C-Level, `2` Director, `3` Project Manager, `4` Collaborator, `5` Freelancer, `6` Client ### Task Status `nueva` (new), `en_proceso` (in progress), `estancada` (stalled), `finalizada` (completed) ### Project Status `in_process`, `finished`, `suspended` ## Data Conventions ### Pagination ```json {"total": "45", "perPage": 20, "page": 1, "lastPage": 3, "data": [...]} ``` - `page`: Page number (default 1, set `false` for all) - `perPage`: Items per page (default 20) ### Filters URL-encoded JSON: `?filters=%7B%22client_id%22%3A123%7D` ### Dates Request: `YYYY-MM-DD` | Response: `YYYY-MM-DD HH:mm:ss` ## Resource Allocation API Manages user capacity on projects. ### Endpoints - `POST /allocation/saveAllocation` - Create - `PUT /allocation/updateAllocation` - Update - `DELETE /allocation/removeAllocation` - Delete - `GET /allocation/getAllocations/{projectId}` - List ### Allocation Object ```json { "userId": 1111, "companyId": 1111, "resource": {"typeId": "Project", "entityId": 1111}, "from": "2024-06-01", "to": "2024-10-31", "assignedByUserId": 11111, "allocatedHours": 20 } ``` ### Validation - `from` < `to`, max 12 months range - No overlapping allocations - `allocatedHours` required ## Integrations API Syncs external systems (Salesforce, Jira, SAP, Okta, etc.) with COR. ### Required: metadata.source ```json { "metadata": {"source": "SALESFORCE"}, "id": "external-id", "name": "Entity Name" } ``` ### Sources `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` ### Entities Projects, Clients, Users, Working Time, Contracts, Workspaces, Brands ### Error Codes `ZC001` Generic, `ZC002` Validation, `ZC003` API Request, `ZC004` Query, `ZC005` External Request ## HTTP Status Codes `200` OK, `201` Created, `400` Bad Request, `401` Unauthorized, `403` Forbidden, `404` Not Found, `422` Validation Error, `429` Rate Limited, `500` Server Error ## Do Not - Hardcode API credentials in source code - Skip token refresh handling - Ignore pagination on list endpoints - Omit `metadata.source` on Integration API calls - Send invalid date formats (use YYYY-MM-DD) - Create overlapping resource allocations ```` # Cursor setup Source: https://developers.projectcor.com/ai-tools/cursor Configure Cursor for COR API development Use Cursor to help build integrations with the COR API. This guide shows how to configure Cursor with project rules optimized for COR API development. ## Prerequisites * Cursor editor installed * COR API credentials (API Key and Client Secret) ## Project rules Create project rules that provide Cursor with context about COR APIs. In your project root: ```bash theme={null} mkdir -p .cursor ``` Create `.cursor/rules.md`: ````markdown theme={null} # COR API Development Rules You are an AI assistant specialized in building integrations with the COR platform APIs. ## Platform Overview COR is a project management platform for agencies and professional services. The platform provides three APIs: | API | Base URL | Purpose | |-----|----------|---------| | Main API | `https://api.projectcor.com/v1` | Core platform operations | | Resource Allocation | `https://planner.svc.v2.projectcor.com` | User capacity management | | Integrations API | `https://integrations.projectcor.com` | External system synchronization | ## Authentication All APIs use OAuth 2.0 with Bearer tokens. The same token works across all three APIs. ### Getting a Token (Client Credentials) ```bash # 1. Encode credentials echo -n "API_KEY:CLIENT_SECRET" | base64 # 2. Request token curl -X POST 'https://api.projectcor.com/v1/oauth/token?grant_type=client_credentials' \ -H 'Authorization: Basic BASE64_CREDENTIALS' ``` ### Using the Token ``` Authorization: Bearer ACCESS_TOKEN Content-Type: application/json ``` ### Token Refresh Tokens expire (check `expires_in`). Refresh before expiration: ```bash curl -X POST 'https://api.projectcor.com/v1/oauth/refreshtoken' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'refresh_token=REFRESH_TOKEN' ``` ## Main API Entities ### Core Entities | Entity | Endpoints | Description | |--------|-----------|-------------| | Clients | `/clients` | Customer accounts | | Projects | `/projects` | Project management | | Tasks | `/tasks` | Task tracking | | Hours | `/hours` | Time entries | | Users | `/users` | Team members | | Brands | `/brands` | Client brands | | Products | `/products` | Brand products | ### Entity Relationships ``` Company └── Clients └── Brands └── Products └── Projects └── Tasks └── Hours (time entries) └── Project Costs └── Project Estimates └── Users (with roles and positions) ``` ### User Roles | role_id | Role | |---------|------| | 1 | C-Level | | 2 | Director | | 3 | Project Manager | | 4 | Collaborator | | 5 | Freelancer | | 6 | Client | ### Task Status Values | Status | Description | |--------|-------------| | `nueva` | New | | `en_proceso` | In progress | | `estancada` | Stalled | | `finalizada` | Completed | ### Project Status Values | Status | Description | |--------|-------------| | `in_process` | Active | | `finished` | Completed | | `suspended` | On hold | ## Data Conventions ### Pagination List endpoints return paginated responses by default: ```json { "total": "45", "perPage": 20, "page": 1, "lastPage": 3, "data": [...] } ``` Parameters: - `page`: Page number (default: 1). Set to `false` to get all results - `perPage`: Items per page (default: 20) ### Filters Use URL-encoded JSON for filtering: ```bash # Filter projects by client and status filters={"client_id":25855,"status":"in_process","archived":2} # URL encode it curl '.../projects?filters=%7B%22client_id%22%3A25855%7D' ``` ### Date Formats - Request dates: `YYYY-MM-DD` (e.g., `2025-01-15`) - Response dates: `YYYY-MM-DD HH:mm:ss` or ISO 8601 ## Resource Allocation API Manages user capacity on projects. ### Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/allocation/saveAllocation` | Create allocation | | PUT | `/allocation/updateAllocation` | Update allocation | | DELETE | `/allocation/removeAllocation` | Delete allocation | | GET | `/allocation/getAllocations/{projectId}` | Get project allocations | ### Allocation Object ```json { "userId": 1111, "companyId": 1111, "email": "user@example.com", "resource": { "typeId": "Project", "entityId": 1111 }, "from": "2024-06-01", "to": "2024-10-31", "assignedByUserId": 11111, "allocatedHours": 20 } ``` ### Validation Rules - `allocatedHours` cannot be empty - `from` date must be before `to` date - Date range cannot exceed 12 months - No overlapping allocations for same user/project ### Allocation Errors | Error | Description | |-------|-------------| | `InvalidAllocationError` | Invalid data (empty hours, bad dates, >12 months) | | `AllocationAlreadyExistInDatesRangeError` | Overlapping allocation exists | | `UserNotFoundError` | User doesn't exist | | `UserNotHaveWorkDaysError` | User has no work days configured | | `ProjectNotFoundError` | Project doesn't exist | | `AllocationNotFoundError` | Allocation to update/delete not found | ## Integrations API Synchronizes external systems with COR using external ID mapping. ### Required Field All requests MUST include `metadata.source`: ```json { "metadata": { "source": "SALESFORCE" }, "id": "external-id-123", "name": "Entity Name" } ``` ### Supported Sources `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` ### Integration Entities | Entity | Operations | |--------|------------| | Projects | CREATE, UPDATE, DELETE | | Clients | CREATE, UPDATE, DELETE | | Users | CREATE, UPDATE, DELETE, Assign Position | | Working Time | CREATE, DELETE | | Contracts | CREATE, UPDATE, DELETE, Attach/Detach Users | | Workspaces | CREATE, UPDATE | | Brands | CREATE, UPDATE, DELETE | ### External ID Flow 1. You provide external ID (from your system) 2. COR creates entity and stores mapping 3. Future operations reference external ID ```bash # Create with external ID POST /v2/integrations/projects {"metadata":{"source":"SALESFORCE"},"id":"SF-OPP-123","name":"Project"} # Update using external ID PUT /v2/integrations/projects/SF-OPP-123 {"metadata":{"source":"SALESFORCE"},"name":"Updated Project"} ``` ### Integration Error Codes | Code | Description | |------|-------------| | `ZC001` | Generic Error | | `ZC002` | Validation Error | | `ZC003` | API Request Exception | | `ZC004` | Query Exception | | `ZC005` | External Request Exception | ## HTTP Status Codes | Code | Description | |------|-------------| | `200` | Success | | `201` | Created | | `204` | Success (No Content) | | `400` | Bad Request - check required fields | | `401` | Unauthorized - refresh token | | `403` | Forbidden - insufficient permissions | | `404` | Not Found - verify resource exists | | `422` | Unprocessable Entity - validation error | | `429` | Too Many Requests - implement backoff | | `500` | Server Error - retry with backoff | ## Best Practices ### Token Management - Store tokens securely (environment variables) - Implement automatic token refresh before expiration - Never hardcode credentials in source code ### Error Handling - Always check response status codes - Parse error responses for specific error types - Implement exponential backoff for retries ### Rate Limiting - Implement delays between bulk operations - Use pagination instead of fetching all at once - Cache responses when appropriate ### Data Integrity - Validate required fields before sending requests - Use transactions for related operations when possible - Log all API interactions for debugging ## Code Examples ### List Projects with Filters ```python import requests import json headers = {'Authorization': f'Bearer {token}'} filters = json.dumps({'status': 'in_process', 'archived': 2}) response = requests.get( 'https://api.projectcor.com/v1/projects', params={'page': 1, 'perPage': 50, 'filters': filters}, headers=headers ) data = response.json() for project in data['data']: print(f"{project['id']}: {project['name']}") ``` ### Create Integration Project ```python response = requests.post( 'https://integrations.projectcor.com/v2/integrations/projects', headers={**headers, 'Content-Type': 'application/json'}, json={ 'metadata': {'source': 'SALESFORCE'}, 'id': 'SF-OPP-12345', 'name': 'New Project', 'client_id': 'SF-ACC-67890', 'start': '2025-01-15', 'end': '2025-03-31' } ) ``` ### Create Resource Allocation ```python response = requests.post( 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation', headers={**headers, 'Content-Type': 'application/json'}, json={ 'userId': 1111, 'companyId': 1111, 'resource': {'typeId': 'Project', 'entityId': 5001}, 'from': '2025-01-01', 'to': '2025-03-31', 'assignedByUserId': 1111, 'allocatedHours': 40 } ) ``` ```` # MCP Server Source: https://developers.projectcor.com/ai-tools/mcp-server Connect any MCP-compatible AI client to your COR workspace using natural language The COR MCP Server lets you interact with your COR workspace from any MCP-compatible AI client. Connect natively in Claude, Cursor, Windsurf, and other MCP clients to manage projects and tasks, log hours, communicate with your team, and get real-time insights — without leaving your AI assistant. The server follows the [MCP specification (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25) and uses **Streamable HTTP transport** with **OAuth 2.0** authentication. **Endpoint:** `https://mcp.projectcor.com/mcp` **What you can do:** * Ask about your pending tasks and get an instant overview * Create and update projects and tasks with full detail * Log worked hours on tasks for yourself or your team * Post messages and @mention teammates directly in task threads * Browse team members, clients, and project statuses * Assign labels, collaborators, and attachments to tasks * Get direct links to any project, task, or client in COR *** ## Features * **List projects** with filters by name, client, project manager, status, health, work order, and date range * **Get project details** including budget, profitability, logged hours, and billing info * **Create projects** with name, client, PM, estimated time, dates, and billing settings * **Update projects** — change status, archive, reassign PM, update budget * **Search tasks** across your organization with powerful filters: project, client, status, text search, date ranges, labels, and archived state * **Get my pending tasks** — instant view of all active tasks assigned to you * **Get task details** including description, collaborators, subtask hierarchy, and attachments count * **Create tasks** with title, project, description (HTML), deadline, priority, estimated hours, and subtask nesting * **Update tasks** — change any field without affecting others (partial update) * **Manage collaborators** — view and assign team members to tasks * **Manage labels** — assign and remove labels/tags on tasks * **Post messages** on task threads with support for @mentions — your AI assistant builds the proper mention markup automatically * **Log worked hours** on any task with date, duration, and optional description * **Search time entries** with filters by user, project, client, date range, and approval status — includes totals per query * **Get your profile** — name, email, role, position, and remaining hours * **List users** in your organization with optional filters * **Get user details** by ID — role, position, daily hours, labels * **Add attachments** to tasks from Google Drive, Dropbox, or OneDrive * **List attachments** for any task with file details and source * **List available labels** by model (task, project, or user) * **Get direct URLs** to any task, project, or client — open in browser instantly *** ## Setup The COR MCP Server supports **Streamable HTTP transport** and uses OAuth 2.0 with dynamic client registration for authentication. Connect any compatible MCP client using: ``` https://mcp.projectcor.com/mcp ``` For clients that do not support remote MCP natively, use [`mcp-remote`](https://github.com/geelen/mcp-remote) as a bridge. Go to [claude.ai/connectors](https://claude.ai/connectors) and find **COR** in the directory. Click **Connect**. You will be redirected to COR to log in and authorize access. Once authorized, COR will be available in your Claude workspace. COR appears as a connected integration in your Claude workspace. Add the following to your `claude_desktop_config.json`: ```json theme={null} { "mcpServers": { "COR": { "name": "COR", "url": "https://mcp.projectcor.com/mcp", "headers": {} } } } ``` Restart Claude Desktop. On first use you will be prompted to log in to COR and authorize the connector. Run the following command: ```bash theme={null} claude mcp add --transport http cor https://mcp.projectcor.com/mcp ``` Then run `/mcp` in a Claude Code session to go through the authentication flow. Add the following to your `.cursor/mcp.json`: ```json theme={null} { "mcpServers": { "COR": { "url": "https://mcp.projectcor.com/mcp" } } } ``` On first use, Cursor will open a browser window to complete OAuth authorization with COR. Open the Command Palette (`Ctrl/Cmd + P`) and search for **MCP: Add Server**, then select **Command (stdio)**. Enter the following command: ``` npx mcp-remote https://mcp.projectcor.com/mcp ``` Enter **COR** as the server name and press Enter. Go to **MCP: List Servers** → select COR → **Start Server**. Alternatively, add directly to your VS Code `settings.json`: ```json theme={null} { "mcpServers": { "COR": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.projectcor.com/mcp"] } } } ``` Open Windsurf settings (`Ctrl/Cmd + ,`) → scroll to **Cascade → MCP servers** → **Add Server → Add custom server**, then add: ```json theme={null} { "mcpServers": { "COR": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.projectcor.com/mcp"] } } } ``` Open Zed settings (`Cmd + ,`) and add: ```json theme={null} { "context_servers": { "COR": { "source": "custom", "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.projectcor.com/mcp"], "env": {} } } } ``` Any MCP-compatible client can connect to COR using the following settings: | Setting | Value | | - | - | | URL / Endpoint | `https://mcp.projectcor.com/mcp` | | Transport | Streamable HTTP (native) or stdio via `npx mcp-remote https://mcp.projectcor.com/mcp` | | Authentication | OAuth 2.0 (handled automatically on first connection) | *** ## Authentication The COR MCP Server uses **OAuth 2.0 authorization code flow**. You will need: * An active COR account at [cor.works](https://cor.works) * Any role (Collaborator, Project Manager, Director, or C-Level) Your MCP client redirects you to COR's login page. Log in with your COR credentials. COR asks you to authorize the server to access your workspace. Review the permissions and approve. After approving, you are redirected back to your AI client — fully connected. Your access token is stored securely in the server session. Tokens are refreshed automatically in the background. You only need to authorize once per client (Claude, Cursor, VS Code, etc.). **Data access:** The server accesses your COR workspace on your behalf using your credentials. It can only perform actions that your COR role permits. No data is stored or shared outside of your COR account and the active session. *** ## Examples **User prompt:** > "What are my pending tasks this week?" **What happens:** * The connector calls `cor_get_my_pending_tasks` filtered to active (non-archived), non-finished tasks assigned to you * Results are filtered to show tasks with a start or deadline in the current week * Returns task titles, statuses, priorities, deadlines, and project names **Expected output:** ``` You have 5 pending tasks this week: 1. [2019468] Add time tracking tools — High priority, due Mar 13, project: Integración Claude Connector 2. [2018923] Review Q1 budget — Urgent, due Mar 14, project: Finance 2026 3. [2018891] Design homepage mockup — Medium, in progress, project: Website Redesign ... ``` **User prompt:** > "Create a task called 'Write release notes for v2.1' in the Product Updates project with high priority and deadline March 25" **What happens:** * The connector searches for the "Product Updates" project using `cor_list_projects` * Calls `cor_create_task` with the title, project ID, priority 2 (High), and deadline 2026-03-25 * Returns confirmation with the new task ID and a direct link **Expected output:** ``` Task created successfully: - ID: 2021045 - Title: Write release notes for v2.1 - Project: Product Updates - Priority: High - Deadline: 2026-03-25 - Link: https://your-company.cor.works/tasks/2021045 ``` **User prompt:** > "Log 2.5 hours on the 'API Integration' task for today" **What happens:** * The connector searches for the task using `cor_list_tasks` with text search * Calls `cor_log_time` with task ID, duration 2.5 hours, and today's date * The entry is created with `origin: MCP_CONNECTOR` for traceability * Returns the time entry confirmation **Expected output:** ``` Time logged successfully. - Entry ID: 88423 - Task: API Integration (task 2018745) - Hours: 2.5h - Date: 2026-03-12 - User: Daniel Guzman - Status: pending ``` **User prompt:** > "Give me a summary of the Marketing Campaign 2026 project — status, health, and how we're doing on profitability" **What happens:** * The connector searches for the project using `cor_list_projects` with name filter * Calls `cor_get_project` to retrieve full details including budget, logged hours, and profitability metrics * Returns a structured summary **Expected output:** ``` Project: Marketing Campaign 2026 [ID: 1752344] - Status: In Process - Health: At Risk - Client: Acme Corp - PM: Maria Lopez - Start: 2026-01-15 | End: 2026-04-30 - Estimated hours: 240h | Logged hours: 198h - Profitability now: 42% | Estimated: 61% - Billable: Yes ``` **User prompt:** > "Post a message on the 'Budget Review' task saying the updated spreadsheet is ready for review, and mention Maria Lopez" **What happens:** * The connector searches for the task and looks up Maria Lopez's user details using `cor_list_users` * Calls `cor_post_task_message` with the message text and mention data * The message is posted with proper `@mention` markup so Maria receives a notification in COR **Expected output:** ``` Message posted on task [2019234] Budget Review. "The updated spreadsheet is ready for review @Maria Lopez" Maria Lopez has been notified. ``` *** ## Reference values ### Task status | Value | Meaning | | - | - | | `nueva` | New (not started) | | `en_proceso` | In progress | | `estancada` | Stalled / blocked | | `finalizada` | Completed | ### Task priority | Value | Label | | - | - | | `0` | Low | | `1` | Medium | | `2` | High | | `3` | Urgent | ### Project status | Value | Meaning | | - | - | | `in_process` | Active | | `finished` | Completed | | `suspended` | On hold | ### Project health | Value | Label | | - | - | | `1` | On track | | `2` | At risk | | `3` | Delayed | | `4` | Critical | *** ## Support For connector-specific issues, open a ticket via the [Help Center](https://cor.zendesk.com/) or email [help@projectcor.com](mailto:help@projectcor.com) with "MCP Connector" in the subject line. **Privacy Policy:** [projectcor.com/cor-privacy-and-personal-data](https://projectcor.com/cor-privacy-and-personal-data/) — The server accesses your COR workspace on your behalf and does not store, share, or sell your data outside of your COR account and the active session. # Windsurf setup Source: https://developers.projectcor.com/ai-tools/windsurf Configure Windsurf for COR API development Configure Windsurf's Cascade AI assistant for building integrations with the COR platform APIs. This guide shows how to set up workspace rules optimized for COR API development. ## Prerequisites * Windsurf editor installed * COR API credentials (API Key and Client Secret) ## Workspace rules Create workspace rules that provide Windsurf with context about COR APIs and development patterns. Create `.windsurf/rules.md` in your project root: ````markdown theme={null} # COR API Development Rules You are an AI assistant specialized in building integrations with the COR platform APIs. ## COR Platform Overview COR is a project management platform for agencies and professional services. Three APIs are available: | API | Base URL | Purpose | |-----|----------|---------| | Main API | `https://api.projectcor.com/v1` | Core platform operations | | Resource Allocation | `https://planner.svc.v2.projectcor.com` | User capacity management | | Integrations API | `https://integrations.projectcor.com` | External system synchronization | ## Authentication All APIs use OAuth 2.0 with Bearer tokens. The same token works across all three APIs. ### Token Request (Client Credentials) ```bash # Encode credentials echo -n "API_KEY:CLIENT_SECRET" | base64 # Get token curl -X POST 'https://api.projectcor.com/v1/oauth/token?grant_type=client_credentials' \ -H 'Authorization: Basic BASE64_CREDENTIALS' ``` ### Token Usage ``` Authorization: Bearer ACCESS_TOKEN Content-Type: application/json ``` ### Token Refresh ```bash curl -X POST 'https://api.projectcor.com/v1/oauth/refreshtoken' \ -d 'refresh_token=REFRESH_TOKEN' ``` ## Main API ### Core Entities | Entity | Endpoint | Operations | |--------|----------|------------| | Clients | `/clients` | GET, POST, PUT | | Projects | `/projects` | GET, POST, PUT, DELETE | | Tasks | `/tasks` | GET, POST, PUT, DELETE | | Hours | `/hours` | GET, POST | | Users | `/users` | GET, POST, PUT, DELETE | | Brands | `/brands` | GET, POST, PUT, DELETE | | Products | `/products` | GET, POST, PUT, DELETE | ### Entity Hierarchy ``` Company └── Clients → Brands → Products └── Projects → Tasks → Hours └── Users (with roles) ``` ### User Roles | role_id | Role | |---------|------| | 1 | C-Level | | 2 | Director | | 3 | Project Manager | | 4 | Collaborator | | 5 | Freelancer | | 6 | Client | ### Status Values **Tasks:** `nueva`, `en_proceso`, `estancada`, `finalizada` **Projects:** `in_process`, `finished`, `suspended` ### Pagination All list endpoints return paginated responses: ```json { "total": "45", "perPage": 20, "page": 1, "lastPage": 3, "data": [...] } ``` Parameters: - `page`: Page number (default: 1, set to `false` for all results) - `perPage`: Items per page (default: 20) ### Filters Use URL-encoded JSON: ```bash ?filters=%7B%22client_id%22%3A123%2C%22status%22%3A%22in_process%22%7D ``` ### Date Format - Requests: `YYYY-MM-DD` - Responses: `YYYY-MM-DD HH:mm:ss` or ISO 8601 ## Resource Allocation API Manages user capacity and project assignments. ### Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/allocation/saveAllocation` | Create allocation | | PUT | `/allocation/updateAllocation` | Update allocation | | DELETE | `/allocation/removeAllocation` | Delete allocation | | GET | `/allocation/getAllocations/{projectId}` | Get project allocations | ### Allocation Object ```json { "userId": 1111, "companyId": 1111, "email": "user@example.com", "resource": { "typeId": "Project", "entityId": 1111 }, "from": "2024-06-01", "to": "2024-10-31", "assignedByUserId": 11111, "allocatedHours": 20 } ``` ### Validation Rules - `allocatedHours` cannot be empty - `from` must be before `to` - Date range max: 12 months - No overlapping allocations for same user/project ### Errors | Error | Cause | |-------|-------| | `InvalidAllocationError` | Invalid data | | `AllocationAlreadyExistInDatesRangeError` | Overlap exists | | `UserNotFoundError` | User not found | | `UserNotHaveWorkDaysError` | No work days | | `ProjectNotFoundError` | Project not found | | `AllocationNotFoundError` | Allocation not found | ## Integrations API Synchronizes external systems with COR via external ID mapping. ### Required Field All requests must include `metadata.source`: ```json { "metadata": { "source": "SALESFORCE" }, "id": "external-id-123", "name": "Entity Name" } ``` ### Supported Sources `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` ### Integration Entities | Entity | Operations | |--------|------------| | Projects | CREATE, UPDATE, DELETE | | Clients | CREATE, UPDATE, DELETE | | Users | CREATE, UPDATE, DELETE, Assign Position | | Working Time | CREATE, DELETE | | Contracts | CREATE, UPDATE, DELETE, Attach/Detach Users | | Workspaces | CREATE, UPDATE | | Brands | CREATE, UPDATE, DELETE | ### External ID Mapping 1. Send external ID with `metadata.source` 2. COR creates entity and stores mapping 3. Reference external ID in future operations ### Error Codes | Code | Description | |------|-------------| | `ZC001` | Generic Error | | `ZC002` | Validation Error | | `ZC003` | API Request Exception | | `ZC004` | Query Exception | | `ZC005` | External Request Exception | ## HTTP Status Codes | Code | Meaning | Action | |------|---------|--------| | `200` | Success | - | | `201` | Created | - | | `400` | Bad Request | Check required fields | | `401` | Unauthorized | Refresh token | | `403` | Forbidden | Check permissions | | `404` | Not Found | Verify resource ID | | `422` | Validation Error | Check data format | | `429` | Rate Limited | Implement backoff | | `500` | Server Error | Retry with backoff | ## Best Practices ### Security - Store credentials in environment variables - Never hardcode tokens in source code - Implement automatic token refresh ### API Usage - Always handle pagination on list endpoints - URL-encode filter JSON objects - Use correct date format (YYYY-MM-DD) - Include `metadata.source` on all Integration API calls ### Error Handling - Check status codes on all responses - Parse error bodies for specific error types - Implement exponential backoff for retries ### Resource Allocation - Validate date ranges before requests - Check for overlapping allocations - Ensure users have work days configured ```` # Get Authenticated User Source: https://developers.projectcor.com/api-reference/auth/get-authenticated-user /api-reference/openapi.json get /me Returns information about the currently authenticated user # JWT Authorization by Authorization code Source: https://developers.projectcor.com/api-reference/auth/jwt-authorization-by-authorization-code /api-reference/openapi.json post /oauth2/token The authorization code is obtained by using an authorization server (COR) as an intermediary between the client and resource owner. # JWT Authorization by Client credentials Source: https://developers.projectcor.com/api-reference/auth/jwt-authorization-by-client-credentials /api-reference/openapi.json post /oauth/token We'll be using the OAuth2 Client Credentials workflow as an authentication strategy and JWTs for the format of the tokens. # JWT Authorization by User Credentials Source: https://developers.projectcor.com/api-reference/auth/jwt-authorization-by-user-credentials /api-reference/openapi.json post /auth/login # JWT Refresh Token Source: https://developers.projectcor.com/api-reference/auth/jwt-refresh-token /api-reference/openapi.json post /oauth/refreshtoken Refresh the user token # Create a brand Source: https://developers.projectcor.com/api-reference/brands/create-a-brand /api-reference/openapi.json post /brands Create a new brand entity. # Delete a brand Source: https://developers.projectcor.com/api-reference/brands/delete-a-brand /api-reference/openapi.json delete /brands/{brand_id} Destroy a brand entity. # Get brand by ID Source: https://developers.projectcor.com/api-reference/brands/get-brand-by-id /api-reference/openapi.json get /brands/{brand_id} # Get Brands Source: https://developers.projectcor.com/api-reference/brands/get-brands /api-reference/openapi.json get /brands Retrieves a paginated list of brands. By default, responses are paginated with 20 items per page. # Update a brand Source: https://developers.projectcor.com/api-reference/brands/update-a-brand /api-reference/openapi.json put /brands/{brand_id} Update a brand entity. # Create a new client Source: https://developers.projectcor.com/api-reference/clients/create-a-new-client /api-reference/openapi.json post /clients # Get client by ID Source: https://developers.projectcor.com/api-reference/clients/get-client-by-id /api-reference/openapi.json get /clients/{id} # Get clients Source: https://developers.projectcor.com/api-reference/clients/get-clients /api-reference/openapi.json get /clients Retrieves a paginated list of clients. By default, responses are paginated with 20 items per page. # Get clients by name Source: https://developers.projectcor.com/api-reference/clients/get-clients-by-name /api-reference/openapi.json get /clients/search-by-name/{name} # Update client Source: https://developers.projectcor.com/api-reference/clients/update-client /api-reference/openapi.json put /clients/{id} # Create contract position Source: https://developers.projectcor.com/api-reference/contract-positions/create-contract-position /api-reference/openapi.json post /contracts/{contract_id}/positions Creates a new position rate for the specified contract. # Get contract positions Source: https://developers.projectcor.com/api-reference/contract-positions/get-contract-positions /api-reference/openapi.json get /contracts/{contract_id}/positions Retrieves all positions associated with a contract. # Update contract position Source: https://developers.projectcor.com/api-reference/contract-positions/update-contract-position /api-reference/openapi.json put /contracts/{contract_id}/positions/{contract_position_rate_id} Updates rate and/or hours for a contract position. # Attach users to a contract Source: https://developers.projectcor.com/api-reference/contracts-users/attach-users-to-a-contract /api-reference/openapi.json post /contracts/{contract_id}/users Attaches one or more users to a contract, each with one or more date ranges. Access to this endpoint is governed by the caller's `contracts` permission (`edit`), not by their `users` permission. The `users` sub-resource under a contract is treated as part of the parent contract for authorization. # Create contract Source: https://developers.projectcor.com/api-reference/contracts/create-contract /api-reference/openapi.json post /contracts/{contract_id} Creates a contract using the provided contract identifier. The authenticated user is automatically attached as a contract member from the contract `start` date through an open-ended end date, so the creator can immediately see and manage the contract even when they do not have global access. # Delete contract Source: https://developers.projectcor.com/api-reference/contracts/delete-contract /api-reference/openapi.json delete /contracts/{contract_id} Deletes the specified contract. # Get contracts Source: https://developers.projectcor.com/api-reference/contracts/get-contracts /api-reference/openapi.json get /contracts Retrieves a paginated list of contracts. # Update contract Source: https://developers.projectcor.com/api-reference/contracts/update-contract /api-reference/openapi.json put /contracts/{contract_id} Updates the specified contract. # Create a fee Source: https://developers.projectcor.com/api-reference/fees/create-a-fee /api-reference/openapi.json post /clients/{client_id}/fees # Get Fees Source: https://developers.projectcor.com/api-reference/fees/get-fees /api-reference/openapi.json get /fees Retrieves a paginated list of fees. By default, responses are paginated with 20 items per page. # Get Fees from a client Source: https://developers.projectcor.com/api-reference/fees/get-fees-from-a-client /api-reference/openapi.json get /clients/{client_id}/fees # Get Historical fees Source: https://developers.projectcor.com/api-reference/fees/get-historical-fees /api-reference/openapi.json get /clients/{client_id}/fees/{fee_id}/historicals # Update fee Source: https://developers.projectcor.com/api-reference/fees/update-fee /api-reference/openapi.json put /clients/{client_id}/fees/{fee_id} # Accept suggested hours Source: https://developers.projectcor.com/api-reference/hours/accept-suggested-hours /api-reference/openapi.json post /hours/accept-suggested/{datetime} datetime: datetime in unix format # Change status Source: https://developers.projectcor.com/api-reference/hours/change-status /api-reference/openapi.json post /hours/status-change # Get Hours Source: https://developers.projectcor.com/api-reference/hours/get-hours /api-reference/openapi.json get /hours Retrieves a paginated list of time entries. By default, responses are paginated with 20 items per page. # Get Hours By Date Source: https://developers.projectcor.com/api-reference/hours/get-hours-by-date /api-reference/openapi.json get /hours/by-day/{datetime} datetime: datetime in unix format # Post hours Source: https://developers.projectcor.com/api-reference/hours/post-hours /api-reference/openapi.json post /hours # Status bill change Source: https://developers.projectcor.com/api-reference/hours/status-bill-change /api-reference/openapi.json post /hours/status-bills-change # Update status of weigh hours Source: https://developers.projectcor.com/api-reference/hours/update-status-of-weigh-hours /api-reference/openapi.json post /hours/by-day/weigh # Integrations API Source: https://developers.projectcor.com/api-reference/integrations-introduction Connect external systems with COR through the Integrations API for seamless data synchronization The Integrations API is a dedicated service that acts as an intermediary between external systems and COR. It enables you to map external IDs from third-party services to COR entities, facilitating seamless data synchronization and workflow automation. ## Overview The Integrations API provides a standardized way to: * **Map external IDs** — Link entities from external systems (Salesforce, Jira, SAP, etc.) to their corresponding COR entities * **Sync data bidirectionally** — Keep data consistent between COR and external platforms * **Handle webhooks** — Process incoming events from external services and route updates accordingly * **Track integration state** — Maintain a record of which entities are integrated and their sync status ## Architecture ```mermaid theme={null} flowchart LR subgraph external [External Services] SF[Salesforce] JIRA[Jira] SAP[SAP] OTHER[Other Systems] end subgraph integrations [Integrations Domain] INTAPI[Integrations API] INTDB[(Integrations DB)] end subgraph cor [COR Platform] CORAPI[COR API] MAINDB[(Main DB)] WEB[Web App] end SF -->|external_id mapping| INTAPI JIRA -->|webhooks| INTAPI SAP -->|sync events| INTAPI OTHER --> INTAPI INTAPI <-->|CRUD operations| CORAPI INTAPI --> INTDB CORAPI --> MAINDB MAINDB --> WEB ``` ## Base URL All integration endpoints use the following base URL: ``` https://integrations.projectcor.com/ ``` ## Integration Flows The Integrations API supports three types of data flows depending on your integration requirements: **Unidirectional inbound** Data flows from an external service into COR. Example: Creating projects in COR when opportunities are won in Salesforce. **Unidirectional outbound** Data flows from COR to an external service. Example: Syncing time entries to an external billing system. **Two-way sync** Full synchronization where changes in either system are reflected in the other. Example: Project updates synced between COR and Jira. ### Flow Selection Choose your integration flow based on: | Flow Type | Use Case | Example | | - | - | - | | External → COR | External system is the source of truth | CRM creates projects in COR | | COR → External | COR is the source of truth | Time tracking synced to payroll | | Bidirectional | Both systems need real-time updates | Project management across platforms | ## Authentication The Integrations API uses the **same authentication** as the main COR API. You can use the same Bearer token obtained from the COR authentication endpoints. All requests require a Bearer token in the Authorization header: ```bash theme={null} Authorization: Bearer YOUR_ACCESS_TOKEN Content-Type: application/json Accept: application/json ``` Obtain your access token using one of the authentication methods from the main API: * [Client Credentials](/api-reference/auth/jwt-authorization-by-client-credentials) * [Authorization Code](/api-reference/auth/jwt-authorization-by-authorization-code) * [User Credentials](/api-reference/auth/jwt-authorization-by-user-credentials) ## Required Fields All integration endpoints require the `metadata.source` field to identify the external system: ```json theme={null} { "metadata": { "source": "SALESFORCE" }, "id": "external-entity-id-123", "name": "Entity Name", // ... other entity fields } ``` The `metadata.source` field is **required** in all integration requests. It identifies which external system the data originates from and is used to route webhooks and maintain integration mappings. ## Supported Integration Sources The API supports the following integration sources: | Source | Description | | - | - | | `JIRA` | Atlassian Jira project management | | `SALESFORCE` | Salesforce CRM | | `ADVERTMIND` | Advertmind platform | | `QUICKBOOKS` | QuickBooks accounting | | `ZAPIER` | Zapier automation | | `OKTA` | Okta identity management | | `MICROSOFT_DYNAMICS` | Microsoft Dynamics 365 | | `GITHUB` | GitHub repository management | | `MICROSOFT_TEAMS` | Microsoft Teams | | `VBS` | VBS system | | `SAP` | SAP enterprise system | | `GLOBANT` | Globant platform | Need a custom integration source? Contact the COR development team to request support for additional platforms. ## Available Entities The Integrations API provides endpoints for managing the following entities: | Entity | Operations | Description | | - | - | - | | [Brands](/api-reference/integrations/brands) | CREATE, UPDATE, DELETE | Manage brand associations | | [Clients](/api-reference/integrations/clients) | CREATE, UPDATE, DELETE | Sync client/account data | | [Contracts](/api-reference/integrations/contracts) | CREATE, UPDATE, DELETE, Attach/Detach Users | Manage contract integrations | | [Positions](/api-reference/integrations/positions) | CREATE, UPDATE, DELETE | Manage user positions | | [Position Categories](/api-reference/integrations/categories) | CREATE, UPDATE, DELETE | Manage position categories | | [Projects](/api-reference/integrations/projects) | CREATE, UPDATE, DELETE | Manage project synchronization | | [Teams](/api-reference/integrations/teams) | CREATE, UPDATE, Attach/Detach Users | Sync team data within workspaces | | [Users](/api-reference/integrations/users) | CREATE, UPDATE, DELETE, Assign Position | Manage user provisioning | | [User Leaves](/api-reference/integrations/user-leaves) | CREATE | Manage leave types | | [Workspaces](/api-reference/integrations/workspaces) | CREATE, UPDATE | Sync workspace/team data | | [Working Time](/api-reference/integrations/working-time) | CREATE, DELETE | Sync time tracking data | ## External ID Mapping The core feature of the Integrations API is external ID mapping. When you create an entity through the integration endpoints: 1. **You provide** the external ID (from your system) 2. **COR creates** the entity and stores the mapping 3. **Future operations** can reference either the external ID or the COR ID This allows you to: * Update or delete entities using their external IDs * Query integration status to determine if an entity is already synced * Route webhook events to the correct external endpoint ### Example Flow ```mermaid theme={null} sequenceDiagram participant Salesforce participant IntegrationsAPI as Integrations API participant CORAPI as COR API participant IntDB as Integrations DB participant MainDB as Main DB Salesforce->>IntegrationsAPI: POST /v2/integrations/projects Note right of Salesforce: external_id: "SF-OPP-123" IntegrationsAPI->>CORAPI: Create project CORAPI->>MainDB: Insert project MainDB-->>CORAPI: project_id: 45678 CORAPI-->>IntegrationsAPI: Project created IntegrationsAPI->>IntDB: Store mapping Note right of IntDB: SF-OPP-123 → 45678 IntegrationsAPI-->>Salesforce: 201 Created Note left of IntegrationsAPI: cor_id: 45678 ``` ## Response Codes All integration endpoints use standard HTTP status codes: | Code | Description | | - | - | | `200 OK` | Operation successful | | `201 Created` | Resource created successfully | | `400 Bad Request` | Invalid data or missing required fields | | `401 Unauthorized` | Invalid or expired token | | `403 Forbidden` | Insufficient permissions | | `404 Not Found` | Resource not found | | `422 Unprocessable Entity` | Validation error | | `500 Internal Server Error` | Server error | ## Error Codes The API returns specific error codes for better error handling: | Code | Description | | - | - | | `ZC001` | Generic Error | | `ZC002` | Validation Error | | `ZC003` | API Request Exception | | `ZC004` | Query Exception | | `ZC005` | External Request Exception | ## Quick Start ### 1. Create an integrated project ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/projects' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "id": "SF-OPP-12345", "name": "Website Redesign Project", "client_id": "SF-ACC-67890", "start": "2025-01-15", "end": "2025-03-31" }' ``` ```python Python theme={null} import requests response = requests.post( 'https://integrations.projectcor.com/v2/integrations/projects', headers={ 'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json' }, json={ 'metadata': { 'source': 'SALESFORCE' }, 'id': 'SF-OPP-12345', 'name': 'Website Redesign Project', 'client_id': 'SF-ACC-67890', 'start': '2025-01-15', 'end': '2025-03-31' } ) project = response.json() print(f"Created project with COR ID: {project['id']}") ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/projects', { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, id: 'SF-OPP-12345', name: 'Website Redesign Project', client_id: 'SF-ACC-67890', start: '2025-01-15', end: '2025-03-31' }) } ); const project = await response.json(); console.log(`Created project with COR ID: ${project.id}`); ``` ### 2. Update using external ID ```bash theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "name": "Website Redesign Project - Phase 2" }' ``` ## Next Steps Integrate project data between COR and external systems Sync client and account information Manage user provisioning and assignments Handle contract integrations with user associations **Need help?** Contact our support team at [help@projectcor.com](mailto:help@projectcor.com) or visit [COR Support](https://cor.zendesk.com/). # Create Brand Source: https://developers.projectcor.com/api-reference/integrations/brands/create POST https://integrations.projectcor.com/v2/integrations/brands Creates a new brand in your COR instance with external ID mapping Creates a new brand in your COR instance through the integrations service. The brand must be associated with an existing client that was previously created through the integrations API. ## Request Body Requirements Integration source identifier External brand ID from your source system Brand name External client ID. The client must have been previously created through the integrations API. ## Known Errors * `ValidationError` — Missing required fields * `ClientNotFoundError` — The specified client does not exist in the integration mappings * `DuplicateExternalIdError` — A brand with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/brands' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "id": "SF-BRAND-12345", "name": "Acme Premium", "client_id": "SF-ACC-67890" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/brands" payload = { "metadata": { "source": "SALESFORCE" }, "id": "SF-BRAND-12345", "name": "Acme Premium", "client_id": "SF-ACC-67890" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/brands', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, id: 'SF-BRAND-12345', name: 'Acme Premium', client_id: 'SF-ACC-67890' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 3001, "name": "Acme Premium", "client_id": 25855, "company_id": 1234, "user_id": 8546, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'SF-ACC-67890' not found", "code": "ZC004" } ``` # Delete Brand Source: https://developers.projectcor.com/api-reference/integrations/brands/delete DELETE https://integrations.projectcor.com/v2/integrations/brands/{id} Deletes a brand from your COR instance using its external ID Deletes a brand from your COR instance using its external ID. This removes both the brand and the integration mapping. ## Path Parameters External brand ID that was used when creating the brand ## Request Body Requirements Integration source identifier ## Known Errors * `BrandNotFoundError` — No brand found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Brand cannot be deleted due to existing project associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345" payload = { "metadata": { "source": "SALESFORCE" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Brand deleted successfully", "external_id": "SF-BRAND-12345", "cor_id": 3001 } ``` ```json 404 theme={null} { "error": "BrandNotFoundError", "message": "Brand with external ID 'SF-BRAND-12345' not found", "code": "ZC004" } ``` # Update Brand Source: https://developers.projectcor.com/api-reference/integrations/brands/update PUT https://integrations.projectcor.com/v2/integrations/brands/{id} Updates an existing brand in your COR instance using its external ID Updates an existing brand in your COR instance using its external ID. ## Path Parameters External brand ID that was used when creating the brand ## Request Body Requirements Integration source identifier Updated brand name ## Known Errors * `ZC001` — Entity is not associated (brand with the specified external ID not found) * `BrandNotFoundError` — No brand found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "name": "Acme Premium Plus" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345" payload = { "metadata": { "source": "SALESFORCE" }, "name": "Acme Premium Plus" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/brands/SF-BRAND-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, name: 'Acme Premium Plus' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 3001, "name": "Acme Premium Plus", "client_id": 25855, "company_id": 1234, "user_id": 8546, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "BrandNotFoundError", "message": "Brand with external ID 'SF-BRAND-12345' not found", "code": "ZC004" } ``` # Create Category Source: https://developers.projectcor.com/api-reference/integrations/categories/create POST https://integrations.projectcor.com/v2/integrations/categories Creates a new position category in your COR instance with external ID mapping Creates a new position category in your COR instance through the integrations service. ## Request Body Requirements Integration source identifier External category ID from your source system Category name ## Known Errors * `ValidationError` — Missing required fields * `DuplicateExternalIdError` — A category with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/categories' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "id": "external-category-id-1", "name": "Category name" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/categories" payload = { "metadata": { "source": "GLOBANT" }, "id": "external-category-id-1", "name": "Category name" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/categories', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, id: 'external-category-id-1', name: 'Category name' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Category name", "company_id": 2336, "created_at": "2025-11-19 18:33:26", "updated_at": "2025-11-19 18:33:26", "id": "external-category-id-1" } } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "Source is required in metadata" } ``` # Delete Category Source: https://developers.projectcor.com/api-reference/integrations/categories/delete DELETE https://integrations.projectcor.com/v2/integrations/categories/{id} Deletes a position category from your COR instance using its external ID Deletes a position category from your COR instance using its external ID. This removes both the category and the integration mapping. ## Path Parameters External category ID that was used when creating the category ## Request Body Requirements Integration source identifier ## Known Errors * `CategoryNotFoundError` — No category found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Category cannot be deleted due to existing position associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Entity deleted successfully" } ``` ```json 404 theme={null} { "error": "CategoryNotFoundError", "message": "Category with external ID 'external-category-id-1' not found", "code": "ZC004" } ``` # Update Category Source: https://developers.projectcor.com/api-reference/integrations/categories/update PUT https://integrations.projectcor.com/v2/integrations/categories/{id} Updates an existing position category in your COR instance using its external ID Updates an existing position category in your COR instance using its external ID. ## Path Parameters External category ID that was used when creating the category ## Request Body Requirements Integration source identifier Updated category name ## Known Errors * `CategoryNotFoundError` — No category found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "name": "Updated Category Name" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1" payload = { "metadata": { "source": "GLOBANT" }, "name": "Updated Category Name" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/categories/external-category-id-1', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, name: 'Updated Category Name' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Updated Category Name", "company_id": 2336, "created_at": "2025-11-19 18:33:26", "updated_at": "2025-11-19 18:42:01", "deleted_at": null, "__meta__": { "oldRate": 0 } } } ``` ```json 404 theme={null} { "error": "CategoryNotFoundError", "message": "Category with external ID 'external-category-id-1' not found", "code": "ZC004" } ``` # Create Client Source: https://developers.projectcor.com/api-reference/integrations/clients/create POST https://integrations.projectcor.com/v2/integrations/clients Creates a new client in your COR instance with external ID mapping Creates a new client in your COR instance through the integrations service. The client is mapped to an external ID from your source system for bidirectional synchronization. ## Request Body Requirements All requests require the `metadata.source` field to identify the integration source. Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` External client ID from your source system. This ID will be used to reference the client in future operations. Client display name External workspace ID that the client belongs to Legal business name for contracts and invoicing Primary contact email address Contact person's first name Contact person's last name Phone number Website URL Client description ## Known Errors * `ValidationError` — Missing required fields (`metadata.source`, `id`, or `name`) * `DuplicateExternalIdError` — A client with this external ID already exists for this source * `InvalidSourceError` — The `metadata.source` value is not a valid integration source * `WS001` — workspace\_id is required or the workspace was not found in the system ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/clients' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "id": "SF-ACC-67890", "name": "Acme Corporation", "workspace_id": "ws-clients-emea-region", "business_name": "Acme Corporation LLC", "email_contact": "contact@acme.com", "name_contact": "Jane", "last_name_contact": "Smith", "phone": "+1 555-0100", "website": "https://acme.com", "description": "Enterprise software solutions provider" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/clients" payload = { "metadata": { "source": "SALESFORCE" }, "id": "SF-ACC-67890", "name": "Acme Corporation", "workspace_id": "ws-clients-emea-region", "business_name": "Acme Corporation LLC", "email_contact": "contact@acme.com", "name_contact": "Jane", "last_name_contact": "Smith", "phone": "+1 555-0100", "website": "https://acme.com", "description": "Enterprise software solutions provider" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/clients', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, id: 'SF-ACC-67890', name: 'Acme Corporation', workspace_id: 'ws-clients-emea-region', business_name: 'Acme Corporation LLC', email_contact: 'contact@acme.com', name_contact: 'Jane', last_name_contact: 'Smith', phone: '+1 555-0100', website: 'https://acme.com', description: 'Enterprise software solutions provider' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 25855, "name": "Acme Corporation", "business_name": "Acme Corporation LLC", "email_contact": "contact@acme.com", "name_contact": "Jane", "last_name_contact": "Smith", "phone": "+1 555-0100", "website": "https://acme.com", "description": "Enterprise software solutions provider", "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "error": "ValidationError", "message": "Missing required field: name", "code": "ZC002" } ``` # Delete Client Source: https://developers.projectcor.com/api-reference/integrations/clients/delete DELETE https://integrations.projectcor.com/v2/integrations/clients/{id} Deletes a client from your COR instance using its external ID Deletes a client from your COR instance using its external ID. This also removes the integration mapping. ## Path Parameters External client ID that was used when creating the client ## Request Body Requirements Integration source identifier. Must match the source used when creating the client. ## Known Errors * `ClientNotFoundError` — No client found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Client cannot be deleted due to existing dependencies (projects, brands, etc.) ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890" payload = { "metadata": { "source": "SALESFORCE" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Client deleted successfully", "external_id": "SF-ACC-67890", "cor_id": 25855 } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'SF-ACC-67890' not found for source SALESFORCE", "code": "ZC004" } ``` # Update Client Source: https://developers.projectcor.com/api-reference/integrations/clients/update PUT https://integrations.projectcor.com/v2/integrations/clients/{id} Updates an existing client in your COR instance using its external ID Updates an existing client in your COR instance using its external ID. Only the fields provided in the request body will be updated. ## Path Parameters External client ID that was used when creating the client ## Request Body Requirements Integration source identifier. Must match the source used when creating the client. Updated client name External workspace ID that the client belongs to Updated legal business name Updated contact email Updated contact first name Updated contact last name Updated phone number Updated website URL Updated description ## Known Errors * `ZC001` — Entity is not associated (client with the specified external ID not found) * `ClientNotFoundError` — No client found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `WS001` — The workspace was not found in the system (if workspace\_id is provided) ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "name": "Acme Corp (Updated)", "workspace_id": "ws-clients-emea-region", "phone": "+1 555-0200", "website": "https://www.acmecorp.com" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890" payload = { "metadata": { "source": "SALESFORCE" }, "name": "Acme Corp (Updated)", "workspace_id": "ws-clients-emea-region", "phone": "+1 555-0200", "website": "https://www.acmecorp.com" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, name: 'Acme Corp (Updated)', workspace_id: 'ws-clients-emea-region', phone: '+1 555-0200', website: 'https://www.acmecorp.com' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 25855, "name": "Acme Corp (Updated)", "business_name": "Acme Corporation LLC", "email_contact": "contact@acme.com", "name_contact": "Jane", "last_name_contact": "Smith", "phone": "+1 555-0200", "website": "https://www.acmecorp.com", "description": "Enterprise software solutions provider", "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'SF-ACC-67890' not found for source SALESFORCE", "code": "ZC004" } ``` # Attach Users to Contract Source: https://developers.projectcor.com/api-reference/integrations/contracts/attach-users PUT https://integrations.projectcor.com/v2/integrations/contracts/{id}/attach Associates one or more users with an existing contract Associates one or more users with an existing contract. After the refactor, each user must be sent as an object with `id` and a non-empty `dates` array. The endpoint supports partial processing (`partial_success`): valid assignments are attached while rejected users or rejected date ranges are returned in `errors`. ## Path Parameters External contract ID ## Request Body Requirements Integration source identifier Array of users to attach. Each item must include an external `id` and at least one date range in `dates`. External user ID Non-empty array of assignment ranges for the user. Start date in `YYYY-MM-DD` format. Cannot be `null`. End date in `YYYY-MM-DD` format. Cannot be `null`. ## Known Errors * `ContractNotFoundError` — No contract found with the specified external ID * `ValidationError` — Missing required fields, invalid `users` schema, or empty `dates` array for any user * `CE001` — User association not found in COR (`error_code: USER_ASSOCIATION_NOT_FOUND`) * `UnprocessableEntity` (422) — Upstream attach validation errors are returned in the endpoint response body * `Partial success date validation` — A user can be partially attached while one or more date ranges are rejected (`message: "Partial success. Some dates were rejected"`) ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/attach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "users": [ { "id": "{{external_user_id}}", "dates": [ { "start": "2027-10-01", "end": "2028-11-01" }, { "start": "2025-10-10" } ] }, { "id": "external-user-id-5", "dates": [ { "start": "2025-10-02", "end": "2026-11-01" } ] } ] }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/attach" payload = { "metadata": { "source": "GLOBANT" }, "users": [ { "id": "{{external_user_id}}", "dates": [ {"start": "2027-10-01", "end": "2028-11-01"}, {"start": "2025-10-10"} ] }, { "id": "external-user-id-5", "dates": [ {"start": "2025-10-02", "end": "2026-11-01"} ] } ] } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/attach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, users: [ { id: '{{external_user_id}}', dates: [ { start: '2027-10-01', end: '2028-11-01' }, { start: '2025-10-10' } ] }, { id: 'external-user-id-5', dates: [{ start: '2025-10-02', end: '2026-11-01' }] } ] }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "status": "partial_success", "company_id": 2336, "contract_id": "external-contract-id-1", "records_received": 2, "records_created": 1, "records_rejected": 1, "assigned": [ { "id": 18, "user_id": 48915, "start_date": "2027-10-01T00:00:00.000Z", "end_date": "2028-11-01T00:00:00.000Z" } ], "errors": [ { "id": "external-user-id-5", "error_code": "CE001", "message": "User not found in associations" }, { "id": "external_user_id_12312333333333", "dates": [ { "start": "2025-10-10", "end": null, "message": "Date malformatted. Start and end date are required" } ], "message": "Partial success. Some dates were rejected" } ] } ``` # Create Contract Source: https://developers.projectcor.com/api-reference/integrations/contracts/create POST https://integrations.projectcor.com/v2/integrations/contracts Creates a new contract in your COR instance with external ID mapping Creates a new contract in your COR instance through the integrations service. Validates contract type, status, client association, and validates date fields in `YYYY-MM-DD` format before creating. The currency ISO sent in the request must have a previously configured currency exchange in COR. If no exchange rate exists from the contract currency to the company base currency, contract creation is rejected with `status: 400`, `name: CORCustomError`, and `code: CTR006`. ## Request Body Requirements Integration source identifier External contract ID from your source system Contract name External client ID. The client must have been previously created through the integrations API. Contract type (e.g., "retainer", "project", "hourly") Contract status (e.g., "active", "pending", "completed") Start date in `YYYY-MM-DD` format End date in `YYYY-MM-DD` format Non-negative decimal rounded to 2 places. Must be between `0` and `999999999999.99` (`numeric(14,2)`). Contract description (max 255 characters) ## Known Errors * `ValidationError` — Missing required fields * `ClientNotFoundError` — The specified client does not exist in the integration mappings * `DuplicateExternalIdError` — A contract with this external ID already exists * `ValidationError` — `Invalid start date format: ` when `start_date` is not a valid `YYYY-MM-DD` date * `ValidationError` — `Invalid end date format: ` when `end_date` is not a valid `YYYY-MM-DD` date * `ValidationError` — `Invalid contract amount: must be a number between 0 and 999999999999.99` * `ValidationError` — `Invalid contract description: must be a string of at most 255 characters` * `CTR006` (`CORCustomError`, `400`) — `Cannot save contract. Exchange rate not found for ${currency} to ${baseCurrency}. Please sync exchange rates first.` ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/contracts' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "id": "SF-CONTRACT-12345", "name": "Annual Service Agreement", "client_id": "SF-ACC-67890", "type": "retainer", "status": "active", "start_date": "2025-01-01", "end_date": "2025-12-31", "amount": 120000, "description": "Annual retainer for design and development services" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/contracts" payload = { "metadata": { "source": "SALESFORCE" }, "id": "SF-CONTRACT-12345", "name": "Annual Service Agreement", "client_id": "SF-ACC-67890", "type": "retainer", "status": "active", "start_date": "2025-01-01", "end_date": "2025-12-31", "amount": 120000, "description": "Annual retainer for design and development services" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/contracts', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, id: 'SF-CONTRACT-12345', name: 'Annual Service Agreement', client_id: 'SF-ACC-67890', type: 'retainer', status: 'active', start_date: '2025-01-01', end_date: '2025-12-31', value: 120000, description: 'Annual retainer for design and development services' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 30001, "name": "Annual Service Agreement", "client_id": 25855, "type": "retainer", "status": "active", "start_date": "2025-01-01", "end_date": "2025-12-31", "amount": 120000, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "status": 400, "name": "CORCustomError", "code": "CTR006", "message": "Cannot save contract. Exchange rate not found for USD to ARS. Please sync exchange rates first." } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'SF-ACC-67890' not found", "code": "ZC004" } ``` # Delete Contract Source: https://developers.projectcor.com/api-reference/integrations/contracts/delete DELETE https://integrations.projectcor.com/v2/integrations/contracts/{id} Deletes a contract from your COR instance using its external ID Deletes a contract from your COR instance using its external ID. Also removes related entity associations if a `corId` is provided. ## Path Parameters External contract ID that was used when creating the contract ## Request Body Requirements Integration source identifier COR internal ID to remove associations (optional) ## Known Errors * `ContractNotFoundError` — No contract found with the specified external ID * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Contract cannot be deleted due to active user associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345" payload = { "metadata": { "source": "SALESFORCE" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Contract deleted successfully", "external_id": "SF-CONTRACT-12345", "cor_id": 30001 } ``` ```json 404 theme={null} { "error": "ContractNotFoundError", "message": "Contract with external ID 'SF-CONTRACT-12345' not found", "code": "ZC004" } ``` # Detach Users from Contract Source: https://developers.projectcor.com/api-reference/integrations/contracts/detach-users PUT https://integrations.projectcor.com/v2/integrations/contracts/{id}/detach Removes one or more users from an existing contract Removes one or more users from an existing contract. Validates that users are currently attached to the contract before detaching them. On success (`200`), the response body is the updated contract resource. ## Path Parameters External contract ID ## Request Body Requirements Integration source identifier Array of external user IDs to detach from the contract ## Known Errors * `ContractNotFoundError` — No contract found with the specified external ID * `UserNotFoundError` — One or more users not found with the specified external IDs * `ValidationError` — Missing required fields or empty users array * `NotAttachedError` — One or more users are not attached to this contract ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/detach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "users": [ "OKTA-USER-67890" ] }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/detach" payload = { "metadata": { "source": "SALESFORCE" }, "users": [ "OKTA-USER-67890" ] } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345/detach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, users: [ 'OKTA-USER-67890' ] }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 23, "client_id": 58393, "company_id": 2336, "name": "Prueba contrato", "type": "fixed_price", "source": "SALESFORCE", "status": "active", "url": null, "start": "2026-01-01 00:00:00", "end": "2026-12-31 00:00:00", "frequency": null, "currency_id": 1, "created_at": "2026-05-08 13:58:38", "updated_at": "2026-05-08 13:58:38", "deleted_at": null, "url_name": null, "user_positions_header_id": null, "users": [] } ``` ```json 400 theme={null} { "error": "NotAttachedError", "message": "User 'OKTA-USER-67890' is not attached to this contract", "code": "ZC002" } ``` # Update Contract Source: https://developers.projectcor.com/api-reference/integrations/contracts/update PUT https://integrations.projectcor.com/v2/integrations/contracts/{id} Updates an existing contract in your COR instance using its external ID Updates an existing contract in your COR instance using its external ID. Performs the same validations as creation, including date validation in `YYYY-MM-DD` format, and updates only the provided fields. The currency ISO sent in the request must have a previously configured currency exchange in COR. If no exchange rate exists from the contract currency to the company base currency, contract update is rejected with `status: 400`, `name: CORCustomError`, and `code: CTR006`. ## Path Parameters External contract ID that was used when creating the contract ## Request Body Requirements Integration source identifier Updated contract name Updated contract type Updated contract status Updated start date in `YYYY-MM-DD` format Updated end date in `YYYY-MM-DD` format Non-negative decimal rounded to 2 places. Must be between `0` and `999999999999.99` (`numeric(14,2)`). Updated description (max 255 characters) ## Known Errors * `ZC001` — Entity is not associated (contract with the specified external ID not found) * `ContractNotFoundError` — No contract found with the specified external ID * `ValidationError` — Missing required `metadata.source` field * `ValidationError` — `Invalid start date format: ` when `start_date` is not a valid `YYYY-MM-DD` date * `ValidationError` — `Invalid end date format: ` when `end_date` is not a valid `YYYY-MM-DD` date * `ValidationError` — `Invalid contract amount: must be a number between 0 and 999999999999.99` * `ValidationError` — `Invalid contract description: must be a string of at most 255 characters` * `CTR006` (`CORCustomError`, `400`) — `Cannot save contract. Exchange rate not found for ${currency} to ${baseCurrency}. Please sync exchange rates first.` ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "status": "completed", "end_date": "2025-06-30", "amount": 60000 }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345" payload = { "metadata": { "source": "SALESFORCE" }, "status": "completed", "end_date": "2025-06-30", "amount": 60000 } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/contracts/SF-CONTRACT-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, status: 'completed', end_date: '2025-06-30', value: 60000 }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 30001, "name": "Annual Service Agreement", "client_id": 25855, "type": "retainer", "status": "completed", "start_date": "2025-01-01", "end_date": "2025-06-30", "amount": 60000, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 400 theme={null} { "status": 400, "name": "CORCustomError", "code": "CTR006", "message": "Cannot save contract. Exchange rate not found for USD to ARS. Please sync exchange rates first." } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Create Currency Exchanges Source: https://developers.projectcor.com/api-reference/integrations/currency-exchanges/create POST https://integrations.projectcor.com/v2/integrations/currency-exchanges Creates currency exchange rates in batch (up to 20 records per request) Creates currency exchange rates in your COR instance through the integrations service. This endpoint processes multiple exchange rates in a single request and provides detailed feedback about successes, duplicates, and errors. **Batch Processing**: You can submit up to 20 currency exchange records per request. The endpoint will process all records and return detailed statistics about the operation. ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` Array of currency exchange rates (maximum 20 items) Foreign currency ISO code (e.g., "USD", "EUR") Base currency ISO code - must match your company's base currency Exchange rate amount Exchange rate factor (typically 1) ISO 8601 datetime when the rate becomes effective (e.g., "2025-03-20T02:00:00Z") ISO 8601 datetime when the rate expires (optional) Additional metadata for the exchange rate ISO 8601 datetime of last update Rate type identifier (e.g., "EURX") ## Response The endpoint returns statistics about the batch operation: * `status` — Operation status: `success` (all records processed), `failed` (all records rejected), or `partial` (some succeeded, some failed) * `company_id` — The unique identifier of the company associated with the request * `records_received` — Total number of records in the request * `records_deduplicated` — Number of duplicate records removed * `records_created` — Number of successfully created records * `records_replaced` — Number of records that replaced existing ones * `records_rejected` — Number of records that failed validation or processing * `errors` — Array of error details for rejected records Each item in `errors` includes: | Field | Type | Description | | - | - | - | | `from_currency` | string | Source/foreign currency ISO code of the rejected record | | `to_currency` | string | Base/target currency ISO code of the rejected record | | `message` | string | Validation or business-rule message explaining why the record was rejected | ## Known Errors ### Validation Errors * `ValidationError` — Missing required fields or invalid structure * Currency not found — The specified ISO code doesn't exist in the system * Base currency mismatch — The base\_currency doesn't match your company's base currency ### Business Logic Errors * Date mismatch — `effective_date` and `last_updated_datetime` must be on the same day (for GLOBANT source) * Invalid exchange rate — Amount or factor values are invalid ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/currency-exchanges' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "currency_exchanges": [ { "foreign_currency": "USD", "base_currency": "ARS", "amount": 100, "factor": 1, "effective_date": "2025-03-20T02:00:00Z", "metadata": { "last_updated_datetime": "2025-03-20T02:00:00Z", "rate_type": "EURX" } }, { "foreign_currency": "EUR", "base_currency": "ARS", "amount": 110.50, "factor": 1, "effective_date": "2025-03-20T02:00:00Z", "metadata": { "last_updated_datetime": "2025-03-20T02:00:00Z", "rate_type": "EURX" } } ], "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/currency-exchanges" payload = { "currency_exchanges": [ { "foreign_currency": "USD", "base_currency": "ARS", "amount": 100, "factor": 1, "effective_date": "2025-03-20T02:00:00Z", "metadata": { "last_updated_datetime": "2025-03-20T02:00:00Z", "rate_type": "EURX" } }, { "foreign_currency": "EUR", "base_currency": "ARS", "amount": 110.50, "factor": 1, "effective_date": "2025-03-20T02:00:00Z", "metadata": { "last_updated_datetime": "2025-03-20T02:00:00Z", "rate_type": "EURX" } } ], "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer {{token}}", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/currency-exchanges', { method: 'POST', headers: { 'Authorization': 'Bearer {{token}}', 'Content-Type': 'application/json' }, body: JSON.stringify({ currency_exchanges: [ { foreign_currency: 'USD', base_currency: 'ARS', amount: 100, factor: 1, effective_date: '2025-03-20T02:00:00Z', metadata: { last_updated_datetime: '2025-03-20T02:00:00Z', rate_type: 'EURX' } }, { foreign_currency: 'EUR', base_currency: 'ARS', amount: 110.50, factor: 1, effective_date: '2025-03-20T02:00:00Z', metadata: { last_updated_datetime: '2025-03-20T02:00:00Z', rate_type: 'EURX' } } ], metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 - Success theme={null} { "status": "success", "company_id": 2336, "records_received": 2, "records_deduplicated": 1, "records_created": 1, "records_replaced": 0, "records_rejected": 0, "errors": [] } ``` ```json 200 - Partial Success theme={null} { "status": "partial", "company_id": 2336, "records_received": 5, "records_deduplicated": 1, "records_created": 3, "records_replaced": 0, "records_rejected": 1, "errors": [ { "from_currency": "USD", "to_currency": "ARS", "message": "metadata.last_updated_datetime day must match start date" } ] } ``` ```json 200 - Failed theme={null} { "status": "failed", "company_id": 2336, "records_received": 2, "records_deduplicated": 1, "records_created": 0, "records_replaced": 0, "records_rejected": 1, "errors": [ { "from_currency": "USD", "to_currency": "ARS", "message": "metadata.last_updated_datetime day must match start date" } ] } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "Source is required in metadata" } ``` # Assign Seniority to Position Source: https://developers.projectcor.com/api-reference/integrations/positions/assign-seniority POST https://integrations.projectcor.com/v2/user-position/{position_id}/seniority/{seniority_id} Assigns a seniority level to a user position in your COR instance Assigns a seniority level to a user position in your COR instance. Both the position and seniority must have been previously created through the integrations API. ## Path Parameters External position ID that was used when creating the position External seniority ID that was used when creating the seniority ## Request Body Requirements Integration source identifier ## Known Errors * `ZC002` — User position not found. The specified position or seniority does not exist in the integration mappings ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/user-position/external-user-position-1/seniority/external_seniority_id_10' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/user-position/external-user-position-1/seniority/external_seniority_id_10" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/user-position/external-user-position-1/seniority/external_seniority_id_10', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Software Developer", "seniority": "Ssr.", "company_id": 2336, "created_at": "2026-01-26 15:27:04", "updated_at": "2026-01-26 15:27:04" } } ``` ```json 400 - Position not found theme={null} { "status": "ERROR", "code": "ZC002", "message": "User position not found" } ``` ```json 400 - Seniority not found theme={null} { "status": "ERROR", "code": "ZC002", "message": "Seniority not found" } ``` # Create Position Source: https://developers.projectcor.com/api-reference/integrations/positions/create POST https://integrations.projectcor.com/v2/integrations/user-position Creates a new user position in your COR instance with external ID mapping Creates a new user position in your COR instance through the integrations service. Positions can be associated with a category that was previously created through the integrations API. ## Request Body Requirements Integration source identifier External position ID from your source system Position name External category ID. The category must have been previously created through the integrations API. Positions without a category\_id will not be displayed in the frontend. Hourly rate for the position Seniority level (e.g., "Jr.", "Sr.", "Lead") ## Known Errors * `ValidationError` — Missing required fields * `CategoryNotFoundError` — The specified category does not exist in the integration mappings * `DuplicateExternalIdError` — A position with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/user-position' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "id": "external-user-position-1", "name": "Software Developer", "category_id": "external-category-1", "rate": 1, "seniority": "Sr." }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/user-position" payload = { "metadata": { "source": "GLOBANT" }, "id": "external-user-position-1", "name": "Software Developer", "category_id": "external-category-1", "rate": 1, "seniority": "Sr." } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/user-position', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, id: 'external-user-position-1', name: 'Software Developer', category_id: 'external-category-1', rate: 1, seniority: 'Sr.' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Software Developer", "rate": 1, "seniority": "Sr.", "company_id": 2336, "created_at": "2025-11-19 17:39:33", "updated_at": "2025-11-19 17:39:33", "id": "external-user-position-1", "category_id": "external-category-1" } } ``` ```json 404 theme={null} { "error": "CategoryNotFoundError", "message": "Category with external ID 'external-category-1' not found", "code": "ZC004" } ``` # Delete Position Source: https://developers.projectcor.com/api-reference/integrations/positions/delete DELETE https://integrations.projectcor.com/v2/integrations/user-position/{id} Deletes a user position from your COR instance using its external ID Deletes a user position from your COR instance using its external ID. This removes both the position and the integration mapping. ## Path Parameters External position ID that was used when creating the position ## Request Body Requirements Integration source identifier ## Known Errors * `PositionNotFoundError` — No position found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Position cannot be deleted due to existing user associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Entity deleted successfully" } ``` ```json 404 theme={null} { "error": "PositionNotFoundError", "message": "Position with external ID 'external-user-position-1' not found", "code": "ZC004" } ``` # Update Position Source: https://developers.projectcor.com/api-reference/integrations/positions/update PUT https://integrations.projectcor.com/v2/integrations/user-position/{id} Updates an existing user position in your COR instance using its external ID Updates an existing user position in your COR instance using its external ID. ## Path Parameters External position ID that was used when creating the position ## Request Body Requirements Integration source identifier Updated position name Updated hourly rate for the position Updated seniority level (e.g., "Jr.", "Sr.", "Lead") External category ID. The category must have been previously created through the integrations API. ## Known Errors * `PositionNotFoundError` — No position found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `CategoryNotFoundError` — The specified category does not exist in the integration mappings ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "name": "Software Developer", "rate": 60, "seniority": "Sr.", "category_id": "external-category-1" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1" payload = { "metadata": { "source": "GLOBANT" }, "name": "Software Developer", "rate": 60, "seniority": "Sr.", "category_id": "external-category-1" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/user-position/external-user-position-1', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, name: 'Software Developer', rate: 60, seniority: 'Sr.', category_id: 'external-category-1' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Software Developer", "company_id": 2336, "rate": 60, "created_at": "2025-11-19 17:54:15", "updated_at": "2025-11-19 17:54:27", "deleted_at": null, "user_position_default": false, "seniority": "Sr.", "__meta__": { "oldRate": 1 } } } ``` ```json 404 theme={null} { "error": "PositionNotFoundError", "message": "Position with external ID 'external-user-position-1' not found", "code": "ZC004" } ``` # Create Product Source: https://developers.projectcor.com/api-reference/integrations/products/create POST https://integrations.projectcor.com/v2/integrations/products Creates a new product in your COR instance with external ID mapping Creates a new product in your COR instance through the integrations service. The product must be associated with an existing client and brand that were previously created through the integrations API. ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` External product ID from your source system Product name External client ID. The client must have been previously created through the integrations API. External brand ID. The brand must have been previously created through the integrations API. Product description ## Known Errors * `ValidationError` — Missing required fields * `ClientNotFoundError` — The specified client does not exist in the integration mappings * `BrandNotFoundError` — The specified brand does not exist in the integration mappings * `DuplicateExternalIdError` — A product with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/products' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "MICROSOFT_DYNAMICS" }, "id": "EXT-PROD-12345", "name": "Premium Product", "client_id": "EXT-CLIENT-67890", "brand_id": "EXT-BRAND-11111", "description": "Premium product description" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/products" payload = { "metadata": { "source": "MICROSOFT_DYNAMICS" }, "id": "EXT-PROD-12345", "name": "Premium Product", "client_id": "EXT-CLIENT-67890", "brand_id": "EXT-BRAND-11111", "description": "Premium product description" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/products', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'MICROSOFT_DYNAMICS' }, id: 'EXT-PROD-12345', name: 'Premium Product', client_id: 'EXT-CLIENT-67890', brand_id: 'EXT-BRAND-11111', description: 'Premium product description' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 52188, "name": "Premium Product", "client_id": 58294, "brand_id": 52187, "company_id": 2336, "user_id": 48429, "created_at": "2025-12-09T15:22:28Z", "updated_at": "2025-12-09T15:22:28Z" } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'EXT-CLIENT-67890' not found", "code": "ZC004" } ``` ```json 404 theme={null} { "error": "BrandNotFoundError", "message": "Brand with external ID 'EXT-BRAND-11111' not found", "code": "ZC004" } ``` # Delete Product Source: https://developers.projectcor.com/api-reference/integrations/products/delete DELETE https://integrations.projectcor.com/v2/integrations/products/{id} Deletes a product from your COR instance using its external ID Deletes a product from your COR instance using its external ID. This performs a soft delete, marking the product as deleted while preserving historical data for audit purposes. ## Path Parameters External product ID that was used when creating the product ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` ## Known Errors * `ProductNotFoundError` — No product found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Product cannot be deleted due to existing project associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "MICROSOFT_DYNAMICS" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345" payload = { "metadata": { "source": "MICROSOFT_DYNAMICS" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'MICROSOFT_DYNAMICS' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Entity deleted successfully" } ``` ```json 404 theme={null} { "error": "ProductNotFoundError", "message": "Product with external ID 'EXT-PROD-12345' not found", "code": "ZC004" } ``` # Update Product Source: https://developers.projectcor.com/api-reference/integrations/products/update PUT https://integrations.projectcor.com/v2/integrations/products/{id} Updates an existing product in your COR instance using its external ID Updates an existing product in your COR instance using its external ID. Only provided fields will be updated; fields not included in the request will remain unchanged. ## Path Parameters External product ID that was used when creating the product ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` Updated product name Updated product description ## Known Errors * `ZC001` — Entity is not associated (product with the specified external ID not found) * `ProductNotFoundError` — No product found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "MICROSOFT_DYNAMICS" }, "name": "Updated Premium Product", "description": "Updated product description" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345" payload = { "metadata": { "source": "MICROSOFT_DYNAMICS" }, "name": "Updated Premium Product", "description": "Updated product description" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/products/EXT-PROD-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'MICROSOFT_DYNAMICS' }, name: 'Updated Premium Product', description: 'Updated product description' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 52188, "name": "Updated Premium Product", "description": "Updated product description", "client_id": 58294, "brand_id": 52187, "company_id": 2336, "user_id": 48429, "created_at": "2025-12-09T15:22:28Z", "updated_at": "2025-12-09T15:45:00Z" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "ProductNotFoundError", "message": "Product with external ID 'EXT-PROD-12345' not found", "code": "ZC004" } ``` # Create Project Source: https://developers.projectcor.com/api-reference/integrations/projects/create POST https://integrations.projectcor.com/v2/integrations/projects Creates a new project in your COR instance with external ID mapping Creates a new project in your COR instance through the integrations service. The project is mapped to an external ID from your source system (Salesforce, Jira, etc.) for bidirectional synchronization. ## Request Body Requirements All requests require the `metadata.source` field to identify the integration source. Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` External project ID from your source system. This ID will be used to reference the project in future update/delete operations. Project name External client ID. The client must have been previously created through the integrations API. Project description or brief Project start date in `YYYY-MM-DD` format Project end date in `YYYY-MM-DD` format External project manager user ID External brand ID External product ID Estimated hours for the project Whether the project is billable Project status External currency ID Project evaluation date in `YYYY-MM-DD` format Estimated monetary value for the project External fee ID External contract ID. The contract must have been previously created through the integrations API. Project deliverables description Work order number or code Income type for the project. Possible values: `fee`, `one_time`, `hourly_rate`, `contract` Whether the project is archived ## Known Errors * `ValidationError` — Missing required fields (`metadata.source`, `id`, or `name`) * `ClientNotFoundError` — The specified `client_id` does not exist in the integration mappings * `DuplicateExternalIdError` — A project with this external ID already exists for this source * `InvalidSourceError` — The `metadata.source` value is not a valid integration source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/projects' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "id": "SF-OPP-12345", "name": "Website Redesign Project", "client_id": "SF-ACC-67890", "brief": "Complete website overhaul including new branding", "start": "2025-01-15", "end": "2025-03-31", "pm_id": "SF-USER-111", "estimated_time": 200, "billable": true, "status": "active", "estimated": 15000, "contract_id": "SF-CONTRACT-001", "work_order": "WO-2025-001" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/projects" payload = { "metadata": { "source": "SALESFORCE" }, "id": "SF-OPP-12345", "name": "Website Redesign Project", "client_id": "SF-ACC-67890", "brief": "Complete website overhaul including new branding", "start": "2025-01-15", "end": "2025-03-31", "pm_id": "SF-USER-111", "estimated_time": 200, "billable": True, "status": "active", "estimated": 15000, "contract_id": "SF-CONTRACT-001", "work_order": "WO-2025-001" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/projects', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, id: 'SF-OPP-12345', name: 'Website Redesign Project', client_id: 'SF-ACC-67890', brief: 'Complete website overhaul including new branding', start: '2025-01-15', end: '2025-03-31', pm_id: 'SF-USER-111', estimated_time: 200, billable: true, status: 'active', estimated: 15000, contract_id: 'SF-CONTRACT-001', work_order: 'WO-2025-001' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 155693, "name": "Website Redesign Project", "client_id": 25855, "brief": "Complete website overhaul including new branding", "start": "2025-01-15 00:00:00", "end": "2025-03-31 00:00:00", "pm_id": 8546, "estimated_time": 200, "billable": true, "status": "active", "estimated": 15000, "contract_id": 4521, "work_order": "WO-2025-001", "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "error": "ValidationError", "message": "Missing required field: metadata.source", "code": "ZC002" } ``` ```json 404 theme={null} { "error": "ClientNotFoundError", "message": "Client with external ID 'SF-ACC-67890' not found", "code": "ZC004" } ``` # Delete Project Source: https://developers.projectcor.com/api-reference/integrations/projects/delete DELETE https://integrations.projectcor.com/v2/integrations/projects/{id} Deletes a project from your COR instance using its external ID Deletes a project from your COR instance using its external ID. This also removes the integration mapping for the project. ## Path Parameters External project ID that was used when creating the project ## Request Body Requirements Integration source identifier. Must match the source used when creating the project. ## Known Errors * `ProjectNotFoundError` — No project found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Project cannot be deleted due to existing dependencies (tasks, time entries, etc.) ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345" payload = { "metadata": { "source": "SALESFORCE" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Project deleted successfully", "external_id": "SF-OPP-12345", "cor_id": 155693 } ``` ```json 404 theme={null} { "error": "ProjectNotFoundError", "message": "Project with external ID 'SF-OPP-12345' not found for source SALESFORCE", "code": "ZC004" } ``` # Update Project Source: https://developers.projectcor.com/api-reference/integrations/projects/update PUT https://integrations.projectcor.com/v2/integrations/projects/{id} Updates an existing project in your COR instance using its external ID Updates an existing project in your COR instance using its external ID. Only the fields provided in the request body will be updated; other fields remain unchanged. ## Path Parameters External project ID that was used when creating the project ## Request Body Requirements The `metadata.source` field is required. All other fields are optional — only provided fields will be updated. Integration source identifier. Must match the source used when creating the project. Updated project name External client ID Updated project description Project start date in `YYYY-MM-DD` format Project end date in `YYYY-MM-DD` format External project manager user ID Estimated hours for the project Whether the project is billable Project status External currency ID Project evaluation date in `YYYY-MM-DD` format Estimated monetary value for the project External fee ID External contract ID Project deliverables description Work order number or code Income type for the project. Possible values: `fee`, `one_time`, `hourly_rate`, `contract` Whether the project is archived ## Known Errors * `ProjectNotFoundError` — No project found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `InvalidDateRangeError` — The `start` date is after the `end` date ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SALESFORCE" }, "name": "Website Redesign Project - Phase 2", "end": "2025-04-30", "estimated_time": 250, "status": "in_progress", "estimated": 18000 }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345" payload = { "metadata": { "source": "SALESFORCE" }, "name": "Website Redesign Project - Phase 2", "end": "2025-04-30", "estimated_time": 250, "status": "in_progress", "estimated": 18000 } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/projects/SF-OPP-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SALESFORCE' }, name: 'Website Redesign Project - Phase 2', end: '2025-04-30', estimated_time: 250, status: 'in_progress', estimated: 18000 }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 155693, "name": "Website Redesign Project - Phase 2", "client_id": 25855, "brief": "Complete website overhaul including new branding", "start": "2025-01-15 00:00:00", "end": "2025-04-30 00:00:00", "pm_id": 8546, "estimated_time": 250, "billable": true, "status": "in_progress", "estimated": 18000, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 404 theme={null} { "error": "ProjectNotFoundError", "message": "Project with external ID 'SF-OPP-12345' not found for source SALESFORCE", "code": "ZC004" } ``` # Create Seniority Source: https://developers.projectcor.com/api-reference/integrations/seniority/create POST https://integrations.projectcor.com/v2/integrations/seniority Creates a new seniority level in your COR instance with external ID mapping Creates a new seniority level in your COR instance through the integrations service. Seniority levels can be associated with user positions. ## Request Body Requirements Integration source identifier External seniority ID from your source system Seniority level name (e.g., "Jr.", "Ssr.", "Sr.", "Lead") ## Known Errors * `ZC001` — Required validation failed. Missing required fields (e.g., name) * `ZC004` — Association already exists. A seniority with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/seniority' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "id": "external_seniority_id_10", "name": "Ssr.", "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/seniority" payload = { "id": "external_seniority_id_10", "name": "Ssr.", "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/seniority', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ id: 'external_seniority_id_10', name: 'Ssr.', metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Ssr.", "company_id": 2336, "created_at": "2026-01-26 15:15:30", "updated_at": "2026-01-26 15:15:30", "id": "external_seniority_id_10" } } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC001", "message": "required validation failed on name" } ``` ```json 409 theme={null} { "status": "ERROR", "code": "ZC004", "message": "Association already exists" } ``` # Delete Seniority Source: https://developers.projectcor.com/api-reference/integrations/seniority/delete DELETE https://integrations.projectcor.com/v2/integrations/seniority/{id} Deletes a seniority level from your COR instance using its external ID Deletes a seniority level from your COR instance using its external ID. This removes both the seniority and the integration mapping. ## Path Parameters External seniority ID that was used when creating the seniority ## Request Body Requirements Integration source identifier ## Known Errors * `ZC001` — Entity is not associated. No seniority found with the specified external ID for this source ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Entity deleted successfully" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Update Seniority Source: https://developers.projectcor.com/api-reference/integrations/seniority/update PUT https://integrations.projectcor.com/v2/integrations/seniority/{id} Updates an existing seniority level in your COR instance using its external ID Updates an existing seniority level in your COR instance using its external ID. ## Path Parameters External seniority ID that was used when creating the seniority ## Request Body Requirements Integration source identifier Updated seniority level name (e.g., "Jr.", "Ssr.", "Sr.", "Lead") ## Known Errors * `ZC001` — Entity is not associated. No seniority found with the specified external ID for this source, or missing required fields ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "Jr", "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10" payload = { "name": "Jr", "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/seniority/external_seniority_id_10', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Jr', metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "name": "Jr", "company_id": 2336, "created_at": "2026-01-26 15:20:58", "updated_at": "2026-01-26 15:21:05", "deleted_at": null, "__meta__": { "oldRate": 0 } } } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Attach Users to Team Source: https://developers.projectcor.com/api-reference/integrations/teams/attach-users PUT https://integrations.projectcor.com/v2/integrations/teams/{id}/attach Associates one or more users with an existing team Associates one or more users with an existing team. This operation validates that all provided users exist and are already mapped in COR before attaching them to the team. ## Path Parameters External team ID ## Request Body Requirements Integration source identifier Array of external user IDs to attach to the team ## Known Errors * `ZC001` — Entity is not associated (team with the specified external ID not found) or missing associations for users * `ValidationError` — Missing required fields or empty users array ### Per-User Errors When some users fail validation, the response still returns `200` but includes an `errors` array alongside the successfully attached `users`. Each error object contains: | Field | Type | Description | | - | - | - | | `user_id` | integer | Internal COR user ID | | `name` | string | Error name | | `code` | string | Error code | | `message` | string | Human-readable description | | Code | Name | Description | | - | - | - | | `UT011` | `ALREADY_ASSIGNED` | User is already assigned to this team | | `UT012` | `NOT_IN_WORKSPACE` | User does not belong to the team's workspace | | `UT013` | `WORKSPACE_CONFLICT` | User already belongs to another team in the same workspace | ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/attach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "users": ["{{external_user_id}}"], "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/attach" payload = { "users": ["{{external_user_id}}"], "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/attach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ users: ['{{external_user_id}}'], metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 All users attached theme={null} { "users": [ { "team_id": 4241, "user_id": 48878, "created_at": "2026-01-08 19:20:47", "updated_at": "2026-01-08 19:20:47", "id": 178148, "__meta__": { "company_id": 2336, "user": { "id": 48878, "first_name": "JOTA", "last_name": "Olaechea", "email": "gracie.mccullough@yahoo.com", "company_id": 2336 } } } ], "errors": [] } ``` ```json 200 Partial success theme={null} { "users": [ { "team_id": 4241, "user_id": 48878, "created_at": "2026-01-08 19:20:47", "updated_at": "2026-01-08 19:20:47", "id": 178148, "__meta__": { "company_id": 2336, "user": { "id": 48878, "first_name": "JOTA", "last_name": "Olaechea", "email": "gracie.mccullough@yahoo.com", "company_id": 2336 } } } ], "errors": [ { "user_id": 48914, "name": "NOT_IN_WORKSPACE", "code": "UT012", "message": "User does not belong to the team's workspace" } ] } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Missing associations for users: external_user_1123323245433adasd3353342334431" } ``` # Create Team Source: https://developers.projectcor.com/api-reference/integrations/teams/create POST https://integrations.projectcor.com/v2/integrations/teams Creates a new team in your COR instance with external ID mapping Creates a new team in your COR instance through the integrations service. Validates team name, ID, workspace ID, and metadata before creating. ## Request Body Requirements Integration source identifier External team ID from your source system Team name External workspace ID that the team belongs to Team description ## Known Errors * `ValidationError` — Missing required fields * `ZC004` — Association already exists (team with this external ID already exists) * `WS001` — workspace\_id is required or the workspace was not found in the system ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/teams' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "id": "{{external_team_id}}", "name": "Team test", "description": "description", "workspace_id": "ws-prod-engineering-2024", "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/teams" payload = { "id": "{{external_team_id}}", "name": "Team test", "description": "description", "workspace_id": "ws-prod-engineering-2024", "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/teams', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ id: '{{external_team_id}}', name: 'Team test', description: 'description', workspace_id: 'ws-prod-engineering-2024', metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 5001, "name": "Team test", "description": "description", "workspace_id": 1234, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC004", "message": "Association already exists" } ``` # Delete Team Source: https://developers.projectcor.com/api-reference/integrations/teams/delete DELETE https://integrations.projectcor.com/v2/integrations/teams/{id} Deletes a team from your COR instance using its external ID Deletes a team from your COR instance using its external ID. This also removes the integration mapping for the team. ## Path Parameters External team ID that was used when creating the team ## Request Body Requirements Integration source identifier. Must match the source used when creating the team. ## Known Errors * `ZC001` — Entity is not associated (team not found with the specified external ID for this source) * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/teams/11213132312111' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/teams/11213132312111" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/teams/11213132312111', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "message": "Entity deleted successfully" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Detach Users from Team Source: https://developers.projectcor.com/api-reference/integrations/teams/detach-users PUT https://integrations.projectcor.com/v2/integrations/teams/{id}/detach Removes one or more users from an existing team Removes one or more users from an existing team. This operation validates that all provided users exist and are currently attached to the team before detaching them. ## Path Parameters External team ID ## Request Body Requirements Integration source identifier Array of external user IDs to detach from the team ## Known Errors * `ZC001` — Entity is not associated (team with the specified external ID not found) or missing associations for users * `ValidationError` — Missing required fields or empty users array ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/detach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "users": ["{{external_user_id}}"], "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/detach" payload = { "users": ["{{external_user_id}}"], "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}/detach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ users: ['{{external_user_id}}'], metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} [ { "team_id": 4241, "user_id": 48878, "created_at": "2026-01-08 19:20:47", "updated_at": "2026-01-08 19:20:47", "id": 178148, "__meta__": { "company_id": 2336, "user": { "id": 48878, "first_name": "JOTA", "last_name": "Olaechea", "email": "gracie.mccullough@yahoo.com", "company_id": 2336 } } } ] ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Missing associations for users: external_user_1123323245433adasd3353342334431" } ``` # Update Team Source: https://developers.projectcor.com/api-reference/integrations/teams/update PUT https://integrations.projectcor.com/v2/integrations/teams/{id} Updates an existing team in your COR instance using its external ID Updates an existing team in your COR instance using its external ID. Performs the same validations as creation and updates only the provided fields. ## Path Parameters External team ID that was used when creating the team ## Request Body Requirements Integration source identifier Updated team name External workspace ID that the team belongs to Updated description ## Known Errors * `ZC001` — Entity is not associated (team with the specified external ID not found) * `ValidationError` — Missing required `metadata.source` field * `WS001` — The workspace was not found in the system (if workspace\_id is provided) ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "Team test 2.0", "description": "New team for delevopers", "workspace_id": "ws-prod-engineering-2024", "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}" payload = { "name": "Team test 2.0", "description": "New team for delevopers", "workspace_id": "ws-prod-engineering-2024", "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/teams/{{external_team_id}}', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Team test 2.0', description: 'New team for delevopers', workspace_id: 'ws-prod-engineering-2024', metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 4240, "company_id": 2336, "name": "Team test 2.0", "description": "New team for delevopers", "created_at": "2026-01-08 19:06:19", "updated_at": "2026-01-08 19:17:54", "deleted_at": null, "workspace_id": 3 } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Create Leave Type Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/create POST https://integrations.projectcor.com/v2/integrations/leaves-types Creates a new leave type in your COR instance with external ID mapping Creates a new leave type in your COR instance through the integrations service. ## Request Body Requirements Integration source identifier External leave type ID from your source system Leave type name ## Known Errors * `ValidationError` — Missing required fields * `DuplicateExternalIdError` — A leave type with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/leaves-types' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "id": "type external", "name": "Custom name" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves-types" payload = { "metadata": { "source": "GLOBANT" }, "id": "type external", "name": "Custom name" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves-types', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, id: 'type external', name: 'Custom name' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 201, "status": "success", "data": { "id": 12345, "name": "Custom name", "company_id": 2336, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "active": true } } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "Source is required in metadata" } ``` # Create Leave Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/create-leave POST https://integrations.projectcor.com/v2/integrations/leaves Creates a new leave request in your COR instance with external ID mapping Creates a new leave request in your COR instance through the integrations service. The user and leave type must have been previously created through the integrations API. ## Request Body Requirements Integration source identifier External leave request ID from your source system External user ID. The user must have been previously created through the integrations API. External leave type ID. The leave type must have been previously created through the integrations API. Start date and time in ISO 8601 format (e.g., "2026-05-11T00:00:00-00:00") End date and time in ISO 8601 format (e.g., "2026-05-11T23:59:00-00:00") Whether the leave is for the entire day. When true, the time portion is typically ignored. ## Known Errors * `ValidationError` — Missing required fields * `UserNotFoundError` — The specified user does not exist in the integration mappings * `LeaveTypeNotFoundError` — The specified leave type does not exist in the integration mappings * `InvalidDateRangeError` — End date must be after or equal to start date * `DuplicateExternalIdError` — A leave request with this external ID already exists for this source ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/leaves' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "id": "external-id-3", "userId": "external-user-id-3", "leaveTypeId": "external-type-3", "start": "2026-05-11T00:00:00-00:00", "end": "2026-05-11T23:59:00-00:00", "allDay": true }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves" payload = { "metadata": { "source": "GLOBANT" }, "id": "external-id-3", "userId": "external-user-id-3", "leaveTypeId": "external-type-3", "start": "2026-05-11T00:00:00-00:00", "end": "2026-05-11T23:59:00-00:00", "allDay": True } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, id: 'external-id-3', userId: 'external-user-id-3', leaveTypeId: 'external-type-3', start: '2026-05-11T00:00:00-00:00', end: '2026-05-11T23:59:00-00:00', allDay: true }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 201, "status": "success", "data": { "id": 12345, "userId": 67890, "leaveTypeId": 54321, "start": "2026-05-11T00:00:00-00:00", "end": "2026-05-11T23:59:00-00:00", "allDay": true, "company_id": 2336, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "status": "pending" } } ``` ```json 404 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'external-user-id-3' not found", "code": "ZC004" } ``` ```json 404 theme={null} { "error": "LeaveTypeNotFoundError", "message": "Leave type with external ID 'external-type-3' not found", "code": "ZC004" } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "End date must be after start date" } ``` # Delete Leave Type Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/delete DELETE https://integrations.projectcor.com/v2/integrations/leaves-types/{id} Deletes a leave type from your COR instance using its external ID Deletes a leave type from your COR instance using its external ID. This removes both the leave type and the integration mapping. Cannot delete leave types that are currently in use by existing leave requests. ## Path Parameters External leave type ID that was used when creating the leave type ## Request Body Requirements Integration source identifier ## Known Errors * `LeaveTypeNotFoundError` — No leave type found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — Leave type cannot be deleted due to existing leave request associations ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external" payload = { "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "message": "Leave type deleted successfully", "deletedId": "type external" } } ``` ```json 404 theme={null} { "error": "LeaveTypeNotFoundError", "message": "Leave type with external ID 'type external' not found", "code": "ZC004" } ``` ```json 409 theme={null} { "status": 409, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "Cannot delete leave type that is in use" } ``` # Delete Leave Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/delete-leave DELETE https://integrations.projectcor.com/v2/integrations/leaves/{id} Deletes a leave request from your COR instance using its external ID Deletes a leave request from your COR instance using its external ID. This removes both the leave request and the integration mapping. ## Path Parameters External leave request ID that was used when creating the leave request ## Request Body Requirements Integration source identifier External user ID. The user must have been previously created through the integrations API. ## Known Errors * `LeaveNotFoundError` — No leave request found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` or `userId` field * `UserNotFoundError` — The specified user does not exist in the integration mappings ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/leaves/external-id-3' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "userId": "external-user-id-3", "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves/external-id-3" payload = { "userId": "external-user-id-3", "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves/external-id-3', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ userId: 'external-user-id-3', metadata: { source: 'GLOBANT' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "message": "Leave request deleted successfully", "deletedId": "external-id-3" } } ``` ```json 404 theme={null} { "error": "LeaveNotFoundError", "message": "Leave request with external ID 'external-id-3' not found", "code": "ZC004" } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "User ID is required" } ``` # Update Leave Type Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/update PUT https://integrations.projectcor.com/v2/integrations/leaves-types/{id} Updates an existing leave type in your COR instance using its external ID Updates an existing leave type in your COR instance using its external ID. ## Path Parameters External leave type ID that was used when creating the leave type ## Request Body Requirements Integration source identifier Updated leave type name ## Known Errors * `ZC001` — Entity is not associated (leave type with the specified external ID not found) * `LeaveTypeNotFoundError` — No leave type found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` or `name` field ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "GLOBANT" }, "name": "Custom 1232131232132" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external" payload = { "metadata": { "source": "GLOBANT" }, "name": "Custom 1232131232132" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'GLOBANT' }, name: 'Custom 1232131232132' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "id": 12345, "name": "Custom 1232131232132", "company_id": 2336, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:45:00Z", "active": true } } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "LeaveTypeNotFoundError", "message": "Leave type with external ID 'type external' not found", "code": "ZC004" } ``` # Update Leave Source: https://developers.projectcor.com/api-reference/integrations/user-leaves/update-leave PUT https://integrations.projectcor.com/v2/integrations/leaves/{id} Updates an existing leave request in your COR instance using its external ID Updates an existing leave request in your COR instance using its external ID. The user and leave type must have been previously created through the integrations API. ## Path Parameters External leave request ID that was used when creating the leave request ## Request Body Requirements Integration source identifier External user ID. The user must have been previously created through the integrations API. External leave type ID. The leave type must have been previously created through the integrations API. Updated start date and time in ISO 8601 format (e.g., "2026-05-13T00:00:00-00:00") Updated end date and time in ISO 8601 format (e.g., "2026-05-13T23:59:00-00:00") Whether the leave is for the entire day. When true, the time portion is typically ignored. ## Known Errors * `ZC001` — Entity is not associated (leave request with the specified external ID not found) * `LeaveNotFoundError` — No leave request found with the specified external ID for this source * `ValidationError` — Missing required fields * `UserNotFoundError` — The specified user does not exist in the integration mappings * `LeaveTypeNotFoundError` — The specified leave type does not exist in the integration mappings * `InvalidDateRangeError` — End date must be after or equal to start date ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/leaves/external-id-3' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "userId": "external-user-id-3", "leaveTypeId": "external-type-3", "start": "2026-05-13T00:00:00-00:00", "end": "2026-05-13T23:59:00-00:00", "allDay": true, "metadata": { "source": "GLOBANT" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/leaves/external-id-3" payload = { "userId": "external-user-id-3", "leaveTypeId": "external-type-3", "start": "2026-05-13T00:00:00-00:00", "end": "2026-05-13T23:59:00-00:00", "allDay": True, "metadata": { "source": "GLOBANT" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/leaves/external-id-3', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ userId: 'external-user-id-3', leaveTypeId: 'external-type-3', start: '2026-05-13T00:00:00-00:00', end: '2026-05-13T23:59:00-00:00', allDay: true, metadata: { source: 'GLOBANT' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "statusCode": 200, "status": "success", "data": { "id": 12345, "userId": 67890, "leaveTypeId": 54321, "start": "2026-05-13T00:00:00-00:00", "end": "2026-05-13T23:59:00-00:00", "allDay": true, "company_id": 2336, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:45:00Z", "status": "pending" } } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "LeaveNotFoundError", "message": "Leave request with external ID 'external-id-3' not found", "code": "ZC004" } ``` ```json 404 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'external-user-id-3' not found", "code": "ZC004" } ``` ```json 400 theme={null} { "status": 400, "name": "COR_CUSTOM_ERROR", "code": "ZC002", "message": "End date must be after start date" } ``` # Assign Users to Position Source: https://developers.projectcor.com/api-reference/integrations/users/assign-position PUT https://integrations.projectcor.com/v2/user/user-position Assigns multiple users to their respective positions in COR Assigns multiple users to their respective positions in your COR instance. This endpoint allows batch assignment of users to positions. ## Request Body Requirements Integration source identifier Array of user-position assignments External user ID External position ID ## Known Errors * `ValidationError` — Missing required fields or empty users array * `UserNotFoundError` — One or more users not found with the specified external IDs * `PositionNotFoundError` — One or more positions not found with the specified external IDs ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/user/user-position' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "OKTA" }, "users": [ { "id": "OKTA-USER-12345", "position_id": "POS-DEV-001" }, { "id": "OKTA-USER-67890", "position_id": "POS-PM-001" } ] }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/user/user-position" payload = { "metadata": { "source": "OKTA" }, "users": [ { "id": "OKTA-USER-12345", "position_id": "POS-DEV-001" }, { "id": "OKTA-USER-67890", "position_id": "POS-PM-001" } ] } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/user/user-position', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'OKTA' }, users: [ { id: 'OKTA-USER-12345', position_id: 'POS-DEV-001' }, { id: 'OKTA-USER-67890', position_id: 'POS-PM-001' } ] }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "message": "Users assigned to positions successfully", "assignments": [ { "user_id": 8546, "position_id": 101, "status": "assigned" }, { "user_id": 8547, "position_id": 102, "status": "assigned" } ] } ``` ```json 400 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'OKTA-USER-99999' not found", "code": "ZC004" } ``` # Attach Workspaces to User Source: https://developers.projectcor.com/api-reference/integrations/users/attach-workspaces PUT https://integrations.projectcor.com/v2/integrations/users/{userId}/attach Attaches one or more workspaces to a user in COR Attaches multiple workspaces to a specific user in your COR instance. This endpoint allows batch assignment of workspace access to a user. **Prerequisites**: Workspaces must be created first using the [Create Workspace](/api-reference/integrations/workspaces/create) endpoint before they can be attached to users. ## Response The endpoint returns the complete user object including all attached workspaces. Each workspace includes a `pivot` table with the relationship details (`workspace_id`, `user_id`, `percentage`). ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` Array of workspace assignments with percentage allocation External workspace ID from your source system Percentage allocation of user's time to this workspace (0-100) ## Path Parameters External user ID from your source system ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/attach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "workspaces": [ { "workspaceId": "Workspaces-example-5", "percentage": 10 }, { "workspaceId": "Workspaces-example-6", "percentage": 20 } ], "metadata": { "source": "MICROSOFT_DYNAMICS" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/attach" payload = { "workspaces": [ { "workspaceId": "Workspaces-example-5", "percentage": 10 }, { "workspaceId": "Workspaces-example-6", "percentage": 20 } ], "metadata": { "source": "MICROSOFT_DYNAMICS" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/attach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ workspaces: [ { workspaceId: 'Workspaces-example-5', percentage: 10 }, { workspaceId: 'Workspaces-example-6', percentage: 20 } ], metadata: { source: 'MICROSOFT_DYNAMICS' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 8545, "name": "John Doe", "email": "john.doe@example.com", "workspaces": [ { "id": 1, "name": "Workspaces test 5", "active": true, "metadata": {}, "json_integrations": { "integration_id": 16, "is_active": true, "source": "MICROSOFT_DYNAMICS", "destination": null, "status": "NOT_SEND", "origin_external_id": "Workspaces-example-5", "destination_external_id": null }, "created_at": "2026-01-15 22:42:15", "updated_at": "2026-01-15 22:42:15", "pivot": { "workspace_id": 1, "user_id": 8545, "percentage": 10 } }, { "id": 2, "name": "Workspaces test 6", "active": true, "metadata": {}, "json_integrations": { "integration_id": 16, "is_active": true, "source": "MICROSOFT_DYNAMICS", "destination": null, "status": "NOT_SEND", "origin_external_id": "Workspaces-example-6", "destination_external_id": null }, "created_at": "2026-01-15 22:42:15", "updated_at": "2026-01-15 22:42:15", "pivot": { "workspace_id": 2, "user_id": 8545, "percentage": 20 } } ] } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Source is required in metadata" } ``` ```json 401 theme={null} { "status": "ERROR", "code": "AT004", "message": "E_INVALID_JWT_TOKEN: jwt must be provided" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Create User Source: https://developers.projectcor.com/api-reference/integrations/users/create POST https://integrations.projectcor.com/v2/integrations/users Creates a new user in your COR instance with external ID mapping Creates a new user in your COR instance through the integrations service. The user is mapped to an external ID from your identity provider or HR system. ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` External user ID from your source system (e.g., Okta user ID, SAP employee ID) User's email address User's first name User's last name External workspace ID that the user belongs to Phone number Job position/title Department name COR role ID: `1` (C-Level), `2` (Director), `3` (Project Manager), `4` (Collaborator), `5` (Freelancer), `6` (Client) Daily working hours capacity (default: 8) External position ID. The position must have been previously created through the integrations API. Assigns the user to this position. External seniority ID. The seniority must have been previously created through the integrations API. Assigns this seniority level to the user. ## Known Errors * `ValidationError` — Missing required fields * `DuplicateEmailError` — A user with this email already exists * `DuplicateExternalIdError` — A user with this external ID already exists for this source * `InvalidRoleError` — The `role_id` is not a valid COR role * `WS001` — workspace\_id is required or the workspace was not found in the system ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/users' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "OKTA" }, "id": "OKTA-USER-12345", "email": "john.doe@company.com", "first_name": "John", "last_name": "Doe", "workspace_id": "ws-sales-north-america", "phone": "+1 555-0100", "position": "Senior Developer", "department": "Engineering", "role_id": 4, "daily_hours": 8, "user_position_id": "external-user-position-1", "seniority_id": "external_seniority_id_10" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/users" payload = { "metadata": { "source": "OKTA" }, "id": "OKTA-USER-12345", "email": "john.doe@company.com", "first_name": "John", "last_name": "Doe", "workspace_id": "ws-sales-north-america", "phone": "+1 555-0100", "position": "Senior Developer", "department": "Engineering", "role_id": 4, "daily_hours": 8, "user_position_id": "external-user-position-1", "seniority_id": "external_seniority_id_10" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/users', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'OKTA' }, id: 'OKTA-USER-12345', email: 'john.doe@company.com', first_name: 'John', last_name: 'Doe', workspace_id: 'ws-sales-north-america', phone: '+1 555-0100', position: 'Senior Developer', department: 'Engineering', role_id: 4, daily_hours: 8 }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 8546, "email": "john.doe@company.com", "first_name": "John", "last_name": "Doe", "phone": "+1 555-0100", "role_id": 4, "daily_hours": 8, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "error": "DuplicateEmailError", "message": "A user with email 'john.doe@company.com' already exists", "code": "ZC002" } ``` # Delete User Source: https://developers.projectcor.com/api-reference/integrations/users/delete DELETE https://integrations.projectcor.com/v2/integrations/users/{id} Deletes a user from your COR instance using their external ID Deletes a user from your COR instance using their external ID. This removes the user and the integration mapping. ## Path Parameters External user ID that was used when creating the user ## Request Body Requirements Integration source identifier. Must match the source used when creating the user. ## Known Errors * `ZC001` — Entity is not associated (user with the specified external ID not found) * `UserNotFoundError` — No user found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `DeletionError` — User cannot be deleted due to existing time entries or project assignments ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "OKTA" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345" payload = { "metadata": { "source": "OKTA" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'OKTA' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "User deleted successfully", "external_id": "OKTA-USER-12345", "cor_id": 8546 } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'OKTA-USER-12345' not found for source OKTA", "code": "ZC004" } ``` # Detach Workspaces from User Source: https://developers.projectcor.com/api-reference/integrations/users/detach-workspaces PUT https://integrations.projectcor.com/v2/integrations/users/{userId}/detach Removes workspace access from a user in COR Detaches multiple workspaces from a specific user in your COR instance. This endpoint allows batch removal of workspace access from a user. **Prerequisites**: Workspaces must be created first using the [Create Workspace](/api-reference/integrations/workspaces/create) endpoint, and then attached to users using the [Attach Workspace](/api-reference/integrations/users/attach-workspaces) endpoint before they can be detached. ## Response The endpoint returns the complete user object with the remaining attached workspaces (after detachment). Each workspace includes a `pivot` table with the relationship details (`workspace_id`, `user_id`, `percentage`). ## Request Body Requirements Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT` Array of workspace external IDs (strings) to detach from the user ## Path Parameters External user ID from your source system ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/detach' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "workspaces": ["Workspaces-example-5"], "metadata": { "source": "MICROSOFT_DYNAMICS" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/detach" payload = { "workspaces": ["Workspaces-example-5"], "metadata": { "source": "MICROSOFT_DYNAMICS" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345/detach', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ workspaces: ['Workspaces-example-5'], metadata: { source: 'MICROSOFT_DYNAMICS' } }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 8545, "name": "John Doe", "email": "john.doe@example.com", "workspaces": [ { "id": 3, "name": "Other Workspace", "active": true, "metadata": {}, "json_integrations": { "integration_id": 16, "is_active": true, "source": "MICROSOFT_DYNAMICS", "destination": null, "status": "NOT_SEND", "origin_external_id": "Workspaces-example-7", "destination_external_id": null }, "created_at": "2026-01-15 22:42:15", "updated_at": "2026-01-15 22:42:15", "pivot": { "workspace_id": 3, "user_id": 8545, "percentage": 50 } } ] } ``` ```json 400 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Source is required in metadata" } ``` ```json 401 theme={null} { "status": "ERROR", "code": "AT004", "message": "E_INVALID_JWT_TOKEN: jwt must be provided" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` # Update User Source: https://developers.projectcor.com/api-reference/integrations/users/update PUT https://integrations.projectcor.com/v2/integrations/users/{id} Updates an existing user in your COR instance using their external ID Updates an existing user in your COR instance using their external ID. Only provided fields will be updated. ## Path Parameters External user ID that was used when creating the user ## Request Body Requirements Integration source identifier. Must match the source used when creating the user. Updated first name Updated last name Updated phone number Updated job position Updated department Updated COR role ID Updated daily hours capacity External workspace ID that the user belongs to External position ID. The position must have been previously created through the integrations API. Updates the user's position assignment. External seniority ID. The seniority must have been previously created through the integrations API. Updates the user's seniority level. Monthly salary amount. Month from which the salary becomes effective. Must use MM-YYYY format. Defaults to the current month if salary is provided. ## Known Errors * `ZC001` — Entity is not associated (user with the specified external ID not found) * `UserNotFoundError` — No user found with the specified external ID for this source * `ValidationError` — Missing required `metadata.source` field * `InvalidRoleError` — The `role_id` is not a valid COR role * `ValidationError` — The `salary_from` field must use MM-YYYY format * `WS001` — The workspace was not found in the system (if workspace\_id is provided) ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "OKTA" }, "position": "Lead Developer", "workspace_id": "ws-sales-north-america", "role_id": 3, "daily_hours": 8, "user_position_id": "external-user-position-2", "seniority_id": "external_seniority_id_20", "salary": 5000, "salary_from": "03-2025" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345" payload = { "metadata": { "source": "OKTA" }, "position": "Lead Developer", "workspace_id": "ws-sales-north-america", "role_id": 3, "daily_hours": 8, "user_position_id": "external-user-position-2", "seniority_id": "external_seniority_id_20", "salary": 5000, "salary_from": "03-2025" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/users/OKTA-USER-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'OKTA' }, position: 'Lead Developer', workspace_id: 'ws-sales-north-america', role_id: 3, daily_hours: 8, salary: 5000, salary_from: '03-2025' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 8546, "email": "john.doe@company.com", "first_name": "John", "last_name": "Doe", "phone": "+1 555-0100", "role_id": 3, "daily_hours": 8, "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'OKTA-USER-12345' not found for source OKTA", "code": "ZC004" } ``` # Create Working Time Source: https://developers.projectcor.com/api-reference/integrations/working-time/create POST https://integrations.projectcor.com/v2/integrations/working-time Creates a new working time record in your COR instance Creates a new working time record in your COR instance through the integrations service. Working time records **cannot be updated** once created. If you need to modify a record, you must delete it and create a new one. ## Request Body Requirements Integration source identifier External working time record ID from your source system External user ID. The user must have been previously created through the integrations API. Whether the record is active (default: true) Source system identifier Destination system identifier Working time status The `companyId` is automatically set from the authenticated user's company context. ## Known Errors * `ValidationError` — Missing required fields * `UserNotFoundError` — The specified user does not exist in the integration mappings * `DuplicateExternalIdError` — A working time record with this external ID already exists ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/working-time' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SAP" }, "id": "SAP-WT-12345", "user_id": "SAP-USER-67890", "is_active": true, "status": "active" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/working-time" payload = { "metadata": { "source": "SAP" }, "id": "SAP-WT-12345", "user_id": "SAP-USER-67890", "is_active": True, "status": "active" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/working-time', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SAP' }, id: 'SAP-WT-12345', user_id: 'SAP-USER-67890', is_active: true, status: 'active' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 50001, "user_id": 8546, "company_id": 1234, "is_active": true, "status": "active", "created_at": "2025-01-10T14:30:00Z" } ``` ```json 404 theme={null} { "error": "UserNotFoundError", "message": "User with external ID 'SAP-USER-67890' not found", "code": "ZC004" } ``` # Delete Working Time Source: https://developers.projectcor.com/api-reference/integrations/working-time/delete DELETE https://integrations.projectcor.com/v2/integrations/working-time/{id} Deletes a working time record from your COR instance Deletes a working time record from your COR instance using its external ID. Since working time records cannot be updated, use this endpoint followed by a create operation when you need to modify a record. ## Path Parameters External working time record ID that was used when creating the record ## Request Body Requirements Integration source identifier. Must match the source used when creating the record. ## Known Errors * `WorkingTimeNotFoundError` — No working time record found with the specified external ID * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request DELETE 'https://integrations.projectcor.com/v2/integrations/working-time/SAP-WT-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "SAP" } }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/working-time/SAP-WT-12345" payload = { "metadata": { "source": "SAP" } } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.status_code) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/working-time/SAP-WT-12345', { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'SAP' } }) } ); console.log(response.status); ``` ```json 200 theme={null} { "message": "Working time record deleted successfully", "external_id": "SAP-WT-12345", "cor_id": 50001 } ``` ```json 404 theme={null} { "error": "WorkingTimeNotFoundError", "message": "Working time record with external ID 'SAP-WT-12345' not found", "code": "ZC004" } ``` # Create Workspace Source: https://developers.projectcor.com/api-reference/integrations/workspaces/create POST https://integrations.projectcor.com/v2/integrations/workspaces Creates a new workspace in your COR instance with external ID mapping Creates a new workspace in your COR instance through the integrations service. Validates workspace name, ID, and active status before creating. ## Request Body Requirements Integration source identifier External workspace ID from your source system Workspace name Whether the workspace is active (default: true) Workspace description ## Known Errors * `ValidationError` — Missing required fields * `DuplicateExternalIdError` — A workspace with this external ID already exists ```bash cURL theme={null} curl --location 'https://integrations.projectcor.com/v2/integrations/workspaces' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "MICROSOFT_TEAMS" }, "id": "TEAMS-WS-12345", "name": "Marketing Team", "active": true, "description": "Workspace for the marketing department" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/workspaces" payload = { "metadata": { "source": "MICROSOFT_TEAMS" }, "id": "TEAMS-WS-12345", "name": "Marketing Team", "active": True, "description": "Workspace for the marketing department" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/workspaces', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'MICROSOFT_TEAMS' }, id: 'TEAMS-WS-12345', name: 'Marketing Team', active: true, description: 'Workspace for the marketing department' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 5001, "name": "Marketing Team", "active": true, "description": "Workspace for the marketing department", "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-10T14:30:00Z" } ``` ```json 400 theme={null} { "error": "ValidationError", "message": "Missing required field: name", "code": "ZC002" } ``` # Update Workspace Source: https://developers.projectcor.com/api-reference/integrations/workspaces/update PUT https://integrations.projectcor.com/v2/integrations/workspaces/{id} Updates an existing workspace in your COR instance using its external ID Updates an existing workspace in your COR instance using its external ID. Performs the same validations as creation and updates only the provided fields. To deactivate a workspace, set `active` to `false`. This is the recommended way to "delete" a workspace since there's no DELETE endpoint. ## Path Parameters External workspace ID that was used when creating the workspace ## Request Body Requirements Integration source identifier Updated workspace name Whether the workspace is active Updated description ## Known Errors * `ZC001` — Entity is not associated (workspace with the specified external ID not found) * `WorkspaceNotFoundError` — No workspace found with the specified external ID * `ValidationError` — Missing required `metadata.source` field ```bash cURL theme={null} curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/workspaces/TEAMS-WS-12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "source": "MICROSOFT_TEAMS" }, "name": "Marketing & Communications Team", "description": "Combined marketing and communications workspace" }' ``` ```python Python theme={null} import requests url = "https://integrations.projectcor.com/v2/integrations/workspaces/TEAMS-WS-12345" payload = { "metadata": { "source": "MICROSOFT_TEAMS" }, "name": "Marketing & Communications Team", "description": "Combined marketing and communications workspace" } headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://integrations.projectcor.com/v2/integrations/workspaces/TEAMS-WS-12345', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { source: 'MICROSOFT_TEAMS' }, name: 'Marketing & Communications Team', description: 'Combined marketing and communications workspace' }) } ); const data = await response.json(); console.log(data); ``` ```json 200 theme={null} { "id": 5001, "name": "Marketing & Communications Team", "active": true, "description": "Combined marketing and communications workspace", "company_id": 1234, "created_at": "2025-01-10T14:30:00Z", "updated_at": "2025-01-15T10:00:00Z" } ``` ```json 404 theme={null} { "status": "ERROR", "code": "ZC001", "message": "Entity is not associated" } ``` ```json 404 theme={null} { "error": "WorkspaceNotFoundError", "message": "Workspace with external ID 'TEAMS-WS-12345' not found", "code": "ZC004" } ``` # Introduction Source: https://developers.projectcor.com/api-reference/introduction COR API Documentation - Integrate with projectcor.com applications # COR API The COR API lets you integrate with projectcor.com applications using simple HTTP methods, in either XML or JSON formats, making this an ideal API for developing integrations with other softwares, external clients or mobile applications. ## Base URL All API requests should be made to: ``` https://api.projectcor.com/v1 ``` ## Authentication The COR API uses OAuth 2.0 with multiple authentication flows. All authenticated endpoints require a Bearer token in the Authorization header. ### Authentication Methods The API supports three authentication methods: 1. **Client Credentials** - For server-to-server authentication using API keys 2. **Authorization Code** - For user authorization via consent screen 3. **User Credentials** - For direct username/password authentication Learn about the different authentication methods available ### Using Access Tokens Once authenticated, include the access token in all API requests: ```bash theme={null} Authorization: Bearer {access_token} ``` Access tokens expire after a period of time. Use the refresh token endpoint to obtain a new access token without re-authenticating. ## Request Format The API accepts requests in JSON format. Some endpoints also support `application/x-www-form-urlencoded` format. ### Headers All requests should include: ``` Content-Type: application/json Authorization: Bearer {access_token} ``` ## Response Format All responses are returned in JSON format. The API uses standard HTTP status codes: * `200` - Success * `204` - Success (No Content) * `400` - Bad Request * `401` - Unauthorized * `404` - Not Found * `500` - Server Error ## Pagination Many list endpoints support pagination. By default, endpoints return 20 items per page. Use the `page` parameter to navigate through results. ## Rate Limiting Rate limiting information will be provided here. Please contact support for current rate limits. ## OpenAPI Specification This documentation is generated from our OpenAPI specification file. View the complete OpenAPI specification file ## Getting Started Contact your COR administrator to obtain API credentials (API Key and Client Secret). Use one of the authentication methods to obtain an access token. Use the access token to make authenticated API requests. # Get Categories and Labels Source: https://developers.projectcor.com/api-reference/labels/get-categories-and-labels /api-reference/openapi.json get /categories/labels-model Returns categories for the company, each with its labels, filtered by which entity type those categories apply to (users, projects, or tasks). Names are returned in the authenticated user's language. Use **`model`** to choose the taxonomy: `user` for user/operation labels, `project` for project labels, and `task` for task labels. Any other value yields a validation error. # Create a product Source: https://developers.projectcor.com/api-reference/products/create-a-product /api-reference/openapi.json post /products Create a new product entity. # Delete a product Source: https://developers.projectcor.com/api-reference/products/delete-a-product /api-reference/openapi.json delete /products/{product_id} Destroy a product entity. # Get product by ID Source: https://developers.projectcor.com/api-reference/products/get-product-by-id /api-reference/openapi.json get /products/{product_id} # Get Products Source: https://developers.projectcor.com/api-reference/products/get-products /api-reference/openapi.json get /products Retrieves a paginated list of products. By default, responses are paginated with 20 items per page. # Update a product Source: https://developers.projectcor.com/api-reference/products/update-a-product /api-reference/openapi.json put /products/{product_id} Update a product entity. # Get Project Templates Source: https://developers.projectcor.com/api-reference/project-templates/get-project-templates /api-reference/openapi.json get /projectTemplates Retrieves a paginated list of project templates. By default, responses are paginated with 20 items per page. # Project Profitability & Time Estimation Source: https://developers.projectcor.com/api-reference/projects-profitability Configure how a project estimates time — total hours, by positions, or by categories — and understand income types and ratecards. # Project Profitability & Time Estimation When creating or updating a project, the **Profitability** section controls how time and income are estimated. These settings are sent as part of `POST /projects` and `PUT /projects/{project_id}`. These fields are **unrelated** to the **Project Estimates** endpoints (`/projects/{project_id}/project_estimate`), which manage budget line items with a title, cost, and optional fee association. ## Time estimation modes Projects support three mutually exclusive time estimation modes. Only one should be active at a time. ### 1. Total hours (default) Send a single `estimated_time` value (in hours). Do not set `estimated_by_position` or `estimation_by_categories`. ```json theme={null} { "name": "Website Redesign", "client_id": 10, "estimated_time": 120, "income_type": "fee", "fee_id": 5 } ``` ### 2. Estimation by positions Set `estimated_by_position: true` and provide a `users_positions` array where each entry contains a unified position `id` and its `estimated_time` in hours. ```json theme={null} { "name": "Mobile App", "client_id": 10, "estimated_by_position": true, "users_positions": [ { "id": 1, "estimated_time": 80 }, { "id": 2, "estimated_time": 40 } ] } ``` When `estimated_by_position` is `false`, you may still send `users_positions` with only the `id` field to associate positions to the project without per-position hour estimates. On update (`PUT`), positions that exist in the project but are **absent** from the `users_positions` array will have their `estimated_hours` set to 0. If no hours have been logged against them, they are soft-deleted. ### 3. Estimation by categories Set `estimation_by_categories: 1` (or `true`) and provide a `categories` array with `id` and `estimated_time`. ```json theme={null} { "name": "Brand Campaign", "client_id": 10, "estimation_by_categories": 1, "categories": [ { "id": 7, "estimated_time": 60 }, { "id": 8, "estimated_time": 30 } ] } ``` ## Income types and ratecards The `income_type` field determines how the project revenue is modeled: | `income_type` | Description | | - | - | | `fee` | Revenue tied to a fee (`fee_id` required) | | `one_time` | Fixed one-time revenue (`estimated` monetary value) | | `hourly_rate` | Revenue calculated from hourly rates via a ratecard | | `contract` | Revenue tied to a contract (`contract_id` required) | When using `hourly_rate`, set `estimated_by_hourly_rates: true` and assign a ratecard: ```json theme={null} { "income_type": "hourly_rate", "estimated_by_hourly_rates": true, "ratecard_id": 3 } ``` The `ratecard_id` field is an alias for `user_positions_header_id` — either name is accepted, but `ratecard_id` takes precedence if both are sent. Use `GET /ratecards` to list available ratecards for your company. ## Reading profitability data When you fetch a single project with `GET /projects/{project_id}`, the response includes: | Field | Type | Description | | - | - | - | | `estimated_time` | number | Total estimated hours | | `estimated_by_position` | boolean | Whether estimation is split per position | | `estimation_by_categories` | boolean/integer | Whether estimation is split per category | | `estimated_by_hourly_rates` | boolean | Whether hourly-rate income mode is active | | `user_positions_header_id` | integer | Assigned ratecard ID | | `usersPositionsProject` | array | Positions with `estimated_hours`, `hours_charged`, `total_cost` | | `categoriesProject` | array | Categories with `estimated_hours`, `hours_charged`, `total_cost` | | `ratecard` | object | Ratecard details (`name`, `percent`, `currency_id`, etc.) | ## Field reference | Request field | Type | Used in | Description | | - | - | - | - | | `estimated_time` | number | POST, PUT | Total estimated hours (used when neither by-position nor by-category is active) | | `estimated_by_position` | boolean | POST, PUT | Enable per-position time estimation | | `estimation_by_categories` | boolean/integer | POST, PUT | Enable per-category time estimation (`1` or `true`) | | `estimated_by_hourly_rates` | boolean | POST, PUT | Enable hourly-rate income calculation | | `ratecard_id` | integer | POST, PUT | Ratecard to assign (alias for `user_positions_header_id`) | | `users_positions` | array | POST, PUT | Positions with optional `estimated_time` per item | | `categories` | array | POST, PUT | Categories with optional `estimated_time` per item | | `income_type` | string | POST, PUT | `fee`, `one_time`, `hourly_rate`, or `contract` | | `exchange` | number | POST, PUT | Exchange rate when project currency differs from base | | `currency_change_amount` | number | POST, PUT | Original amount in selected currency before conversion | # Add project collaborators Source: https://developers.projectcor.com/api-reference/projects/add-project-collaborators /api-reference/openapi.json post /projects/{project_id}/collaborators Add individual collaborators to project. # Add Project Cost Source: https://developers.projectcor.com/api-reference/projects/add-project-cost /api-reference/openapi.json post /projects/{project_id}/project_cost Create an associated project cost # Add Project Estimate Source: https://developers.projectcor.com/api-reference/projects/add-project-estimate /api-reference/openapi.json post /projects/{project_id}/project_estimate Create an associated project estimates # Create a project Source: https://developers.projectcor.com/api-reference/projects/create-a-project /api-reference/openapi.json post /projects Create a new project entity. **Time estimation modes** — Projects support three mutually exclusive ways to estimate time (set via the Profitability tab in the UI): 1. **Total hours** (default): send only `estimated_time`. 2. **By positions**: set `estimated_by_position: true` and provide `users_positions` with `estimated_time` per position. 3. **By categories**: set `estimation_by_categories: 1` (or `true`) and provide `categories` with `estimated_time` per category. When using `income_type: "hourly_rate"`, also set `estimated_by_hourly_rates: true` and assign a ratecard via `ratecard_id`. > **Note:** These fields are unrelated to the **Project Estimates** endpoints (`/projects/{project_id}/project_estimate`), which manage budget line items (title, cost, fee). # Delete a project Source: https://developers.projectcor.com/api-reference/projects/delete-a-project /api-reference/openapi.json delete /projects/{project_id} Destroy a project entity. # Delete a Project Estimate Source: https://developers.projectcor.com/api-reference/projects/delete-a-project-estimate /api-reference/openapi.json delete /projects/{project_id}/project_estimate/{project_estimate_id} Delete an associated project estimates # Delete project collaborator Source: https://developers.projectcor.com/api-reference/projects/delete-project-collaborator /api-reference/openapi.json delete /projects/{project_id}/collaborators/{user_id} Delete individual collaborator from project. # Delete Project Cost Source: https://developers.projectcor.com/api-reference/projects/delete-project-cost /api-reference/openapi.json delete /projects/{project_id}/project_cost/{project_cost_id} Delete an associated project cost # Get attachment by Project Source: https://developers.projectcor.com/api-reference/projects/get-attachment-by-project /api-reference/openapi.json get /projects/{project_id}/attachments # Get messages by project Source: https://developers.projectcor.com/api-reference/projects/get-messages-by-project /api-reference/openapi.json get /projects/{project_id}/messages # Get project by ID Source: https://developers.projectcor.com/api-reference/projects/get-project-by-id /api-reference/openapi.json get /projects/{project_id} # Get project collaborators Source: https://developers.projectcor.com/api-reference/projects/get-project-collaborators /api-reference/openapi.json get /projects/{project_id}/collaborators Get users and teams collaborators from project. # Get Project Costs Source: https://developers.projectcor.com/api-reference/projects/get-project-costs /api-reference/openapi.json get /projects/{project_id}/project_cost Get a list of associated project costs # Get Project Estimates Source: https://developers.projectcor.com/api-reference/projects/get-project-estimates /api-reference/openapi.json get /projects/{project_id}/project_estimate Get a list of associated project estimates # Get project labels Source: https://developers.projectcor.com/api-reference/projects/get-project-labels /api-reference/openapi.json get /projects/{project_id}/labels Returns project label categories and available labels for the company (same shape as grouped categories for the project entity type), plus the labels currently assigned to the given project in **`selected`**. Use **`GET /categories/labels-model?model=project`** for a simpler category tree without per-project selection. To **assign or remove** labels on a project, use **`PUT /projects/{project_id}`** with a `labels` array. # Get project ratecard Source: https://developers.projectcor.com/api-reference/projects/get-project-ratecard /api-reference/openapi.json get /projects/{project_id}/ratecard Returns the ratecard currently assigned to the project, or `null` if none is assigned. The ratecard defines pricing configurations (positions, rates, custom percentages) used when `estimated_by_hourly_rates` is enabled. # Get Projects Source: https://developers.projectcor.com/api-reference/projects/get-projects /api-reference/openapi.json get /projects Retrieves a paginated list of projects for the company. Supports filtering by client, dates, status, health, and more. By default, responses are paginated with 20 items per page. # Get projects by name Source: https://developers.projectcor.com/api-reference/projects/get-projects-by-name /api-reference/openapi.json get /projects/search-by-name/{project_name} # Post project message Source: https://developers.projectcor.com/api-reference/projects/post-project-message /api-reference/openapi.json post /projects/{id}/messages # Update a project Source: https://developers.projectcor.com/api-reference/projects/update-a-project /api-reference/openapi.json put /projects/{project_id} Update a project entity. Include only the fields you want to change. **Time estimation** — You can switch estimation mode by updating `estimated_by_position` / `estimation_by_categories` together with `users_positions` / `categories`. Positions present in the project but absent from the `users_positions` array will have their estimated hours reset to 0 (or be soft-deleted if no hours have been logged against them). > These fields are unrelated to **Project Estimates** (`/projects/{project_id}/project_estimate`), which manage budget line items. # Update a Project Estimate Source: https://developers.projectcor.com/api-reference/projects/update-a-project-estimate /api-reference/openapi.json put /projects/{project_id}/project_estimate/{project_estimate_id} Modify an associated project estimates # Update Project Cost Source: https://developers.projectcor.com/api-reference/projects/update-project-cost /api-reference/openapi.json put /projects/{project_id}/project_cost/{project_cost_id} Update an associated project cost # Create a Ratecard Source: https://developers.projectcor.com/api-reference/ratecards/create-a-ratecard /api-reference/openapi.json post /ratecards Creates a new ratecard for the current company. # Delete a Ratecard Source: https://developers.projectcor.com/api-reference/ratecards/delete-a-ratecard /api-reference/openapi.json delete /ratecards/{id} Deletes (soft-delete) a ratecard by ID. Returns the deleted ratecard object with `deleted_at` timestamp set. # Get Ratecards Source: https://developers.projectcor.com/api-reference/ratecards/get-ratecards /api-reference/openapi.json get /ratecards Retrieves a paginated list of ratecards for the current company. Each ratecard defines pricing configurations such as positions, rates, and custom pricing percentages. # Update a Ratecard Source: https://developers.projectcor.com/api-reference/ratecards/update-a-ratecard /api-reference/openapi.json put /ratecards/{id} Updates an existing ratecard by ID. # Resource Allocation Source: https://developers.projectcor.com/api-reference/resource-allocation-introduction Manage user capacity and project allocations with the Resource Allocation API The Resource Allocation API is a dedicated service for managing the capacity of users on the COR platform. This service allows you to allocate users to projects, track their availability, and manage workload distribution. ## Overview COR's Resource Allocation service provides endpoints to: * **Save allocations** — Assign users to projects with specific hour allocations * **Update allocations** — Modify existing allocations * **Remove allocations** — Delete allocations when no longer needed * **Get allocations** — Retrieve allocation data for a specific project ## Base URL The Resource Allocation API uses a different base URL than the main COR API: ``` https://planner.svc.v2.projectcor.com ``` ## Authentication The Resource Allocation API uses the **same authentication** as the main COR API. You can use the same Bearer token obtained from the main authentication endpoints. To authenticate requests, include your access token in the Authorization header: ```bash theme={null} Authorization: Bearer YOUR_ACCESS_TOKEN ``` Obtain your access token using one of the authentication methods from the main API: * [Client Credentials](/api-reference/auth/jwt-authorization-by-client-credentials) * [Authorization Code](/api-reference/auth/jwt-authorization-by-authorization-code) * [User Credentials](/api-reference/auth/jwt-authorization-by-user-credentials) ## Quick Start ### Creating an Allocation To allocate a user to a project, send a POST request with the allocation details: ```bash cURL theme={null} curl --location 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --data '{ "userId": 1111, "companyId": 1111, "email": "user@example.com", "resource": { "typeId": "Project", "entityId": 1111 }, "from": "2024-06-01", "to": "2024-10-31", "assignedByUserId": 11111, "allocatedHours": 20 }' ``` ```javascript Node.js theme={null} const response = await fetch('https://planner.svc.v2.projectcor.com/allocation/saveAllocation', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${accessToken}` }, body: JSON.stringify({ userId: 1111, companyId: 1111, email: 'user@example.com', resource: { typeId: 'Project', entityId: 1111 }, from: '2024-06-01', to: '2024-10-31', assignedByUserId: 11111, allocatedHours: 20 }) }); ``` ```python Python theme={null} import requests response = requests.post( 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation', headers={ 'Content-Type': 'application/json', 'Authorization': f'Bearer {access_token}' }, json={ 'userId': 1111, 'companyId': 1111, 'email': 'user@example.com', 'resource': { 'typeId': 'Project', 'entityId': 1111 }, 'from': '2024-06-01', 'to': '2024-10-31', 'assignedByUserId': 11111, 'allocatedHours': 20 } ) ``` ### Getting Project Allocations To retrieve all allocations for a project: ```bash theme={null} curl --location 'https://planner.svc.v2.projectcor.com/allocation/getAllocations/12345' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` ```json Response theme={null} { "users": [ { "userId": 1234, "firstName": "John", "lastName": "Doe", "positionName": "Developer", "categoryName": "Engineering", "companyId": 41195, "hidden": false, "isDeleted": false, "allocations": [ { "primaryKey": "00000001", "from": "2024-06-01T00:00:00", "to": "2024-08-31T00:00:00", "allocatedHours": 20, "capacity": 160, "availabilityLeft": 140, "allocationUserAnotherProjects": [ { "projectId": 5678, "projectName": "Project Alpha", "clientName": "Client ABC", "allocatedHours": 15 } ] } ], "totalAllocatedHours": 20 } ] } ``` ## Known Errors The API may return the following error types: | Error | Description | | - | - | | `InvalidAllocationError` | The allocation data is invalid (empty hours, invalid date range, or dates span more than 12 months) | | `AllocationAlreadyExistInDatesRangeError` | An allocation already exists within the specified date range | | `UserNotFoundError` | The specified user cannot be found | | `UserNotHaveWorkDaysError` | The user does not have any work days configured | | `ProjectNotFoundError` | The specified project cannot be found | | `AllocationNotFoundError` | The allocation to update or delete cannot be found | ## Validation Rules When creating or updating allocations, ensure that: * The `allocatedHours` field is not empty * The `from` date is before the `to` date * The date range does not exceed 12 months * No existing allocation overlaps with the new date range for the same user and project ## Batch Migration If you have a large amount of allocation data to migrate, you can use a script to batch process the data. ### Migration Script Example ```javascript theme={null} const fs = require('fs'); const allocations = require('./allocations-data.json'); async function migrateAllocations() { const token = 'YOUR_ACCESS_TOKEN'; const url = 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation'; for (const allocation of allocations) { try { const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }, body: JSON.stringify(allocation), }); if (response.ok) { console.log('Allocation saved:', allocation); fs.appendFileSync('success.log', `${new Date().toISOString()} - Saved: ${JSON.stringify(allocation)}\n` ); } else { console.error('Failed to save allocation:', allocation); fs.appendFileSync('error.log', `${new Date().toISOString()} - Failed: ${JSON.stringify(allocation)}\n` ); } } catch (error) { console.error('Error:', error); fs.appendFileSync('error.log', `${new Date().toISOString()} - Error: ${error}\n` ); } } console.log('Migration completed'); } migrateAllocations(); ``` ### Data File Format The allocations data file should follow this format: ```json theme={null} [ { "userId": 11111, "companyId": 11111, "email": "user@example.com", "resource": { "typeId": "Project", "entityId": 11111 }, "from": "2024-01-01", "to": "2024-03-31", "assignedByUserId": 11111, "allocatedHours": 20 }, { "userId": 22222, "companyId": 11111, "email": "another@example.com", "resource": { "typeId": "Project", "entityId": 11111 }, "from": "2024-02-01", "to": "2024-04-30", "assignedByUserId": 11111, "allocatedHours": 40 } ] ``` The same script structure can be used for updating allocations by changing the endpoint to `/allocation/updateAllocation` and adjusting the data format to include both `oldAllocation` and `newAllocation` objects. # Delete Allocation Source: https://developers.projectcor.com/api-reference/resource-allocation/delete-allocation /api-reference/resource-allocation-openapi.json delete /allocation/removeAllocation Removes an existing resource allocation. **Request Body Requirements:** All values in the object are required. **Known Errors:** - `AllocationNotFoundError` — The specified allocation cannot be found - `ProjectNotFoundError` — The specified project cannot be found Please ensure that your request is valid and all specified resources exist to avoid these errors. # Get Allocations By Project Source: https://developers.projectcor.com/api-reference/resource-allocation/get-allocations-by-project /api-reference/resource-allocation-openapi.json get /allocation/getAllocations/{projectId} Gets information about user allocations for a given project. Returns all users allocated to the project along with their allocation details and allocations in other projects. # Save Allocation Source: https://developers.projectcor.com/api-reference/resource-allocation/save-allocation /api-reference/resource-allocation-openapi.json post /allocation/saveAllocation Creates a new resource allocation for a user on a project. **Request Body Requirements:** All values in the object are required. **Known Errors:** - `InvalidAllocationError` — The allocation is invalid: - Empty `allocatedHours` field - The `from` date is greater than or equal to the `to` date - The date range exceeds 12 months - `AllocationAlreadyExistInDatesRangeError` — An allocation already exists within the specified date range - `UserNotFoundError` — The specified user cannot be found - `UserNotHaveWorkDaysError` — The user does not have any work days configured - `ProjectNotFoundError` — The specified project cannot be found # Update Allocation Source: https://developers.projectcor.com/api-reference/resource-allocation/update-allocation /api-reference/resource-allocation-openapi.json put /allocation/updateAllocation Updates an existing resource allocation. Requires both the old allocation data and the new allocation data. **Known Errors:** - `InvalidAllocationError` — The new allocation is invalid: - Empty `allocatedHours` field - The `from` date is greater than or equal to the `to` date - The date range exceeds 12 months - `AllocationNotFoundError` — The specified old allocation cannot be found - `AllocationAlreadyExistInDatesRangeError` — The new allocation already exists within the specified date range - `UserNotFoundError` — The specified user in new allocation cannot be found - `UserNotHaveWorkDaysError` — The user does not have any work days in the new allocation dates range - `ProjectNotFoundError` — The specified project in new allocation cannot be found **Note:** You can use this endpoint to change a project allocation, as long as there isn't an existing allocation for the same user in the target project for any date within the range of the new allocation. # Assign collaborators to a task Source: https://developers.projectcor.com/api-reference/tasks/assign-collaborators-to-a-task /api-reference/openapi.json post /tasks/{task_id}/collaborators Sets the list of collaborators assigned to a task. The operation is a **sync** — the array provided represents the desired final state. Users present in the array but not yet assigned will be added; users currently assigned but absent from the array will be removed. # Create a task Source: https://developers.projectcor.com/api-reference/tasks/create-a-task /api-reference/openapi.json post /tasks # Create task attachment from external source Source: https://developers.projectcor.com/api-reference/tasks/create-task-attachment-from-external-source /api-reference/openapi.json post /tasks/{task_id}/attachments/source/{source_type} Creates an attachment from an external source (Google Drive, Dropbox, OneDrive). # Delete a Task Source: https://developers.projectcor.com/api-reference/tasks/delete-a-task /api-reference/openapi.json delete /tasks/{task_id} Delete a Task # Delete task attachments Source: https://developers.projectcor.com/api-reference/tasks/delete-task-attachments /api-reference/openapi.json delete /tasks/{task_id}/attachments Deletes one or more attachments from a task. # Get messages by Task Source: https://developers.projectcor.com/api-reference/tasks/get-messages-by-task /api-reference/openapi.json get /tasks/{task_id}/messages # Get task attachments Source: https://developers.projectcor.com/api-reference/tasks/get-task-attachments /api-reference/openapi.json get /tasks/{task_id}/attachments Lists attachments for a task (paginated), excluding child versions. # Get task by ID Source: https://developers.projectcor.com/api-reference/tasks/get-task-by-id /api-reference/openapi.json get /tasks/{task_id} # Get task collaborators Source: https://developers.projectcor.com/api-reference/tasks/get-task-collaborators /api-reference/openapi.json get /tasks/{task_id}/collaborators Returns only the collaborators assigned to a task — users directly assigned to work on it. # GET task members Source: https://developers.projectcor.com/api-reference/tasks/get-task-members /api-reference/openapi.json get /tasks/{task_id}/members # Get Tasks Source: https://developers.projectcor.com/api-reference/tasks/get-tasks /api-reference/openapi.json get /tasks Retrieves a paginated list of tasks. By default, responses are paginated with 20 items per page. # Post task message Source: https://developers.projectcor.com/api-reference/tasks/post-task-message /api-reference/openapi.json post /tasks/{task_id}/messages # Update a Task Source: https://developers.projectcor.com/api-reference/tasks/update-a-task /api-reference/openapi.json put /tasks/{task_id} Update Task attributes # Upload task attachments Source: https://developers.projectcor.com/api-reference/tasks/upload-task-attachments /api-reference/openapi.json post /tasks/{task_id}/attachments Uploads one or more files to a task via multipart/form-data. # Add users to a team Source: https://developers.projectcor.com/api-reference/teams/add-users-to-a-team /api-reference/openapi.json post /teams/{team_id}/users Adds users to a team by providing an array of user IDs. # Create a team Source: https://developers.projectcor.com/api-reference/teams/create-a-team /api-reference/openapi.json post /teams Creates a new team entity. # Delete a team Source: https://developers.projectcor.com/api-reference/teams/delete-a-team /api-reference/openapi.json delete /teams/{team_id} Deletes a team from the system. # Get team by ID Source: https://developers.projectcor.com/api-reference/teams/get-team-by-id /api-reference/openapi.json get /teams/{team_id} # Get Teams Source: https://developers.projectcor.com/api-reference/teams/get-teams /api-reference/openapi.json get /teams Retrieves a paginated list of teams. By default, responses are paginated with 20 items per page. # Remove users from a team Source: https://developers.projectcor.com/api-reference/teams/remove-users-from-a-team /api-reference/openapi.json delete /teams/{team_id}/users Removes users from a team by providing an array of user IDs. # Update a team Source: https://developers.projectcor.com/api-reference/teams/update-a-team /api-reference/openapi.json put /teams/{team_id} Updates a team entity. # Create transaction Source: https://developers.projectcor.com/api-reference/transactions/create-transaction /api-reference/openapi.json post /transactions # Create transaction items Source: https://developers.projectcor.com/api-reference/transactions/create-transaction-items /api-reference/openapi.json post /transaction/{transaction_id}/transactionItems # Delete transaction Source: https://developers.projectcor.com/api-reference/transactions/delete-transaction /api-reference/openapi.json delete /transactions/{transaction_id} # Delete transaction items Source: https://developers.projectcor.com/api-reference/transactions/delete-transaction-items /api-reference/openapi.json delete /transaction/{transaction_id}/transactionItems # Get Suggest Allocation Source: https://developers.projectcor.com/api-reference/transactions/get-suggest-allocation /api-reference/openapi.json get /transactions/{transaction_item_id}/suggest-allocation # Get Total Source: https://developers.projectcor.com/api-reference/transactions/get-total /api-reference/openapi.json get /transactions/total # Get transactions Source: https://developers.projectcor.com/api-reference/transactions/get-transactions /api-reference/openapi.json get /transactions Retrieves a paginated list of transactions. By default, responses are paginated with 20 items per page. # Update transaction Source: https://developers.projectcor.com/api-reference/transactions/update-transaction /api-reference/openapi.json put /transactions/{transaction_id} # Update transaction item Source: https://developers.projectcor.com/api-reference/transactions/update-transaction-item /api-reference/openapi.json put /transaction/{transaction_id}/transactionItems/{transaction_item_id} # Create Leave Type Source: https://developers.projectcor.com/api-reference/user-leaves/create-leave-type /api-reference/openapi.json post /company/leaves-types Creates a new custom leave type for your company. # Create User Leave Source: https://developers.projectcor.com/api-reference/user-leaves/create-user-leave /api-reference/openapi.json post /user/leaves Creates a new user leave. ⚠️ **Important:** - Dates must be sent in UTC format (e.g., `2024-11-18T03:00:00Z`) - Dates cannot overlap with existing leaves for the same user - If there is an existing date between the submitted dates, the request will not be saved # Delete Leave Type Source: https://developers.projectcor.com/api-reference/user-leaves/delete-leave-type /api-reference/openapi.json delete /company/leaves-types Deletes a custom leave type. Only custom leave types (with a company_id) can be deleted. # Delete User Leave Source: https://developers.projectcor.com/api-reference/user-leaves/delete-user-leave /api-reference/openapi.json delete /user/leaves Deletes a user leave by providing the leave ID and user ID. # Get Leave Types Source: https://developers.projectcor.com/api-reference/user-leaves/get-leave-types /api-reference/openapi.json get /company/leaves-types Retrieves a paginated list of default and custom leave types for your company. By default, responses are paginated with 20 items per page. # Get User Leaves Source: https://developers.projectcor.com/api-reference/user-leaves/get-user-leaves /api-reference/openapi.json get /user/leaves Gets user leaves for specified users with pagination support. # Update Leave Type Source: https://developers.projectcor.com/api-reference/user-leaves/update-leave-type /api-reference/openapi.json put /company/leaves-types/{leaveTypeId} Updates a custom leave type. Only the name can be modified. # Update User Leave Source: https://developers.projectcor.com/api-reference/user-leaves/update-user-leave /api-reference/openapi.json put /user/leaves/{licenseId} Updates an existing user leave. Dates must be in UTC format. # Create a user position Source: https://developers.projectcor.com/api-reference/user-positions/create-a-user-position /api-reference/openapi.json post /userPosition Creates a new user position. If company has the feature flag to manage positions by labels enabled, Field `segmentLabel` is required. For companies without this feature enabled, `segmentLabel` is ignored. Fied `company_id` is automatically set from the authenticated user's company. # Get active user positions Source: https://developers.projectcor.com/api-reference/user-positions/get-active-user-positions /api-reference/openapi.json get /userPosition/getPositionsOnly Returns all active user positions for the authenticated user's company. Only active positions and active categories are returned. The company scope always comes from the authenticated user and cannot be set manually. Results are ordered by category name, then by position name. This endpoint does not paginate. **Query parameters** - **`lang`** (optional): Language for localized names. If omitted, uses the authenticated user's configured language; if none is set, defaults to **EN**. Examples: `EN`, `ES`, `BR`, `FR`. - **`groupedByCategory`** (optional): When present with a **truthy** value, returns positions grouped by category. When omitted or falsy, returns a flat array. For predictable behavior, use `groupedByCategory=true` to group, and omit the parameter for a flat list. # Get position segment labels Source: https://developers.projectcor.com/api-reference/user-positions/get-position-segment-labels /api-reference/openapi.json get /userPosition/labels/groupers Returns list of segment labels used to group user positions. This endpoint is only available for companies with feature flag to manage positions by labels enabled. The endpoint requires authentication and will return a 403 error if the feature is not enabled for company. These labels are not user positions (e.g., "Backend Developer", "Analista de datos"). They are the classification criteria used to group positions (e.g., by seniority, area, or department). To retrieve actual user positions grouped by category, use [GET /userPosition/getPositionsOnly](/api-reference/user-positions/get-active-user-positions). # Update a user position Source: https://developers.projectcor.com/api-reference/user-positions/update-a-user-position /api-reference/openapi.json put /userPosition/{id} Updates an existing user position. If company has the feature flag to manage positions by labels enabled, field `segmentLabel` is required and will be used to group the position by label. All fields in the request body are optional. Only provided fields will be updated. # Assign or unassign user label Source: https://developers.projectcor.com/api-reference/users/assign-or-unassign-user-label /api-reference/openapi.json put /users/{user_id}/labels Updates a label for a specified user by their user ID. It assigns a new label to the user or unassigns the existing label with the specified `labelId`. **To assign a label:** Omit the `unassign` property or set it to `false`. **To remove a label:** Set `unassign` to `true`. # Create a user Source: https://developers.projectcor.com/api-reference/users/create-a-user /api-reference/openapi.json post /users Creates a user using a POST http method. The user will receive an invitation email. **Required properties:** - `first_name` — User given name - `last_name` — User family name - `email` — User email - `role_id` — ID of the user's role: - **1**: C-Level - **2**: Director - **3**: Project Manager - **4**: Collaborator - **5**: Freelancer - **6**: Client # Delete a user Source: https://developers.projectcor.com/api-reference/users/delete-a-user /api-reference/openapi.json delete /users/{user_id} Deletes a user from the system. # Get Users Source: https://developers.projectcor.com/api-reference/users/get-users /api-reference/openapi.json get /users Retrieves a paginated list of users with optional filtering. By default, responses are paginated with 20 items per page. **Filter options:** - `withHiddenUsers` (boolean): Include hidden users in the response - `withPosition` (boolean): Include user positions in the response - `createdAt` (string): Filter users created on or after this date (YYYY-MM-DD) - `updatedAt` (string): Filter users updated on or after this date (YYYY-MM-DD) # Get users by Name Source: https://developers.projectcor.com/api-reference/users/get-users-by-name /api-reference/openapi.json get /users/search-by-name/{name} # Update a user Source: https://developers.projectcor.com/api-reference/users/update-a-user /api-reference/openapi.json put /users/{user_id} Updates a user using a PUT http method. ⚠️ **Important:** Use caution when using this endpoint. The system will replace the existing user with the values passed in the request body. **Available properties:** - `first_name` — User given name - `last_name` — User family name - `email` — User email - `role_id` — ID of the user's role (1-6) - `user_position_id` — ID of the user's position - `phone`, `description`, `birthday`, `work_in` - `hourly_rate`, `monthly_hours`, `daily_hours` - `plan_id` — 4: Project Management, 5: Capacity Planning - `hidden`, `charge_hours` — Boolean values - `salary` — New monthly salary amount - `salary_from` — Month from which salary should apply (MM-YYYY). Defaults to the current month if `salary` is provided. # Create or update working time Source: https://developers.projectcor.com/api-reference/working-time/create-or-update-working-time /api-reference/openapi.json post /working-time Creates or updates the user's working time schedule. **Fields:** - `dayOfWeek` — Day of the week (1 = Sunday, 7 = Saturday) - `start` — Start time in HH:MM format (24-hour clock) - `end` — End time in HH:MM format (24-hour clock) - `breakTime` — Break duration in hours. Valid values: 0, 0.25, 0.5, 0.75, 1, 1.5, 2 # Get working time users Source: https://developers.projectcor.com/api-reference/working-time/get-working-time-users /api-reference/openapi.json get /working-time/company/with/users Gets information about working time for all users in the company. The response is an object where keys are user IDs and values are arrays of working time entries. # Development Source: https://developers.projectcor.com/development Set up your development environment and build integrations with the COR API This guide helps you configure your development environment, obtain API credentials, and implement best practices for building robust integrations with COR. ## Get your API credentials Before you can make API requests, you need to obtain your API Key and Client Secret from the COR dashboard. Log in to your COR account and navigate to **Settings** > **Integrations** > **API**. Click **Generate API Key** to create a new API Key and Client Secret pair. COR API Key settings page showing where to generate and manage API credentials Store your Client Secret securely. It is only displayed once during creation. If you lose it, you must generate new credentials. For Client Credentials authentication, encode your credentials in Base64: ```bash theme={null} echo -n "YOUR_API_KEY:YOUR_CLIENT_SECRET" | base64 ``` This produces a string like `WU9VUl9BUElfS0VZOllPVVJfQ0xJRU5UX1NFQ1JFVA==` that you use in the Authorization header. ## API environments COR provides three API services that work together to manage your projects, resources, and external integrations. **Base URL:** `https://api.projectcor.com/v1` Main API for projects, tasks, clients, users, time tracking, and transactions. **Base URL:** `https://planner.svc.v2.projectcor.com` Dedicated service for managing user capacity and project allocations. **Base URL:** `https://integrations.projectcor.com/` Service for external system integrations with external ID mapping and bidirectional sync. All three APIs share the same authentication. Use your access token from the main COR API to authenticate requests to the Resource Allocation API and Integrations API. ## Development tools ### Import the OpenAPI specification Import the COR OpenAPI specification into your preferred API client for easy testing: 1. Open Postman and click **Import** 2. Select **Link** and paste the OpenAPI URL: ``` https://developers.projectcor.com/api-reference/openapi.json ``` 3. Click **Import** to generate a complete collection with all endpoints 1. Go to **Application** > **Preferences** > **Data** 2. Click **Import Data** > **From URL** 3. Enter the OpenAPI URL: ``` https://developers.projectcor.com/api-reference/openapi.json ``` Install the [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) extension and create `.http` files: ```http theme={null} @baseUrl = https://api.projectcor.com/v1 @token = YOUR_ACCESS_TOKEN ### Get authenticated user GET {{baseUrl}}/me Authorization: Bearer {{token}} ### Get projects GET {{baseUrl}}/projects Authorization: Bearer {{token}} ``` ### Recommended libraries Use these HTTP libraries for your integrations: ```python Python theme={null} # Install: pip install requests import requests headers = { 'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json' } # All list endpoints return paginated responses response = requests.get( 'https://api.projectcor.com/v1/projects', params={'page': 1}, headers=headers ) result = response.json() # Access paginated data print(f"Total: {result['total']}, Page: {result['page']}/{result['lastPage']}") for project in result['data']: print(project['name']) ``` ```javascript JavaScript (Node.js) theme={null} // Install: npm install axios const axios = require('axios'); const client = axios.create({ baseURL: 'https://api.projectcor.com/v1', headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' } }); // All list endpoints return paginated responses const response = await client.get('/projects', { params: { page: 1 } }); const { total, page, lastPage, data } = response.data; console.log(`Total: ${total}, Page: ${page}/${lastPage}`); data.forEach(project => console.log(project.name)); ``` ```php PHP theme={null} // Install: composer require guzzlehttp/guzzle use GuzzleHttp\Client; $client = new Client([ 'base_uri' => 'https://api.projectcor.com/v1/', 'headers' => [ 'Authorization' => 'Bearer ' . $accessToken, 'Content-Type' => 'application/json' ] ]); // All list endpoints return paginated responses $response = $client->get('projects', ['query' => ['page' => 1]]); $result = json_decode($response->getBody(), true); echo "Total: {$result['total']}, Page: {$result['page']}/{$result['lastPage']}\n"; foreach ($result['data'] as $project) { echo $project['name'] . "\n"; } ``` ```go Go theme={null} package main import ( "encoding/json" "net/http" ) type PaginatedResponse struct { Total string `json:"total"` PerPage int `json:"perPage"` Page int `json:"page"` LastPage int `json:"lastPage"` Data []interface{} `json:"data"` } func main() { client := &http.Client{} // All list endpoints return paginated responses req, _ := http.NewRequest("GET", "https://api.projectcor.com/v1/projects?page=1", nil) req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() var result PaginatedResponse json.NewDecoder(resp.Body).Decode(&result) } ``` ## Best practices ### Secure token management Never hardcode API credentials or tokens in your source code. Use environment variables or a secure secrets manager. ```bash theme={null} # Set environment variables export COR_API_KEY="your_api_key" export COR_CLIENT_SECRET="your_client_secret" ``` ```python theme={null} import os api_key = os.environ.get('COR_API_KEY') client_secret = os.environ.get('COR_CLIENT_SECRET') ``` ### Implement automatic token refresh Access tokens expire after a period of time. Implement automatic refresh to maintain uninterrupted access: ```javascript theme={null} class CORClient { constructor(apiKey, clientSecret) { this.apiKey = apiKey; this.clientSecret = clientSecret; this.accessToken = null; this.refreshToken = null; this.tokenExpiry = null; } async ensureValidToken() { if (!this.accessToken || Date.now() >= this.tokenExpiry) { await this.refreshAccessToken(); } } async refreshAccessToken() { if (this.refreshToken) { const response = await fetch( 'https://api.projectcor.com/v1/oauth/refreshtoken', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `refresh_token=${this.refreshToken}` } ); const data = await response.json(); this.accessToken = data.access_token; this.refreshToken = data.refresh_token; this.tokenExpiry = Date.now() + (data.expires_in * 1000); } else { await this.authenticate(); } } async request(endpoint, options = {}) { await this.ensureValidToken(); return fetch(`https://api.projectcor.com/v1${endpoint}`, { ...options, headers: { 'Authorization': `Bearer ${this.accessToken}`, 'Content-Type': 'application/json', ...options.headers } }); } } ``` ### Handle pagination All list endpoints return **paginated responses** by default with the following structure: ```json theme={null} { "total": "100", "perPage": 20, "page": 1, "lastPage": 5, "data": [...] } ``` Use the `page` and `perPage` parameters to navigate through results: ```python Python theme={null} def get_all_projects(access_token): """Fetch all projects across all pages.""" all_projects = [] page = 1 while True: response = requests.get( 'https://api.projectcor.com/v1/projects', params={'page': page, 'perPage': 50}, headers={'Authorization': f'Bearer {access_token}'} ) result = response.json() # Add projects from current page all_projects.extend(result['data']) # Check if we've reached the last page if page >= result['lastPage']: break page += 1 return all_projects ``` ```javascript JavaScript theme={null} async function getAllProjects(accessToken) { const allProjects = []; let page = 1; let lastPage = 1; do { const response = await fetch( `https://api.projectcor.com/v1/projects?page=${page}&perPage=50`, { headers: { 'Authorization': `Bearer ${accessToken}` } } ); const result = await response.json(); allProjects.push(...result.data); lastPage = result.lastPage; page++; } while (page <= lastPage); return allProjects; } ``` By default, list endpoints return 20 items per page. You can increase this up to 50 with the `perPage` parameter to reduce the number of requests. Set `page=false` to disable pagination entirely (use with caution on large datasets). ## Error handling ### HTTP status codes The COR API uses standard HTTP status codes: | Code | Description | Action | | - | - | - | | `200` | Success | Process the response | | `204` | Success (No Content) | Request succeeded, no body returned | | `400` | Bad Request | Check request parameters and body | | `401` | Unauthorized | Refresh or re-obtain access token | | `404` | Not Found | Verify the resource ID exists | | `429` | Too Many Requests | Implement backoff and retry | | `500` | Server Error | Retry with exponential backoff | ### Implement retry logic Handle transient errors with exponential backoff: ```python theme={null} import time import requests def request_with_retry(url, headers, max_retries=3): for attempt in range(max_retries): response = requests.get(url, headers=headers) if response.status_code == 200: return response.json() if response.status_code in [429, 500, 502, 503, 504]: wait_time = (2 ** attempt) + 1 # 1s, 3s, 5s print(f"Retry {attempt + 1}/{max_retries} after {wait_time}s") time.sleep(wait_time) continue # Non-retryable error response.raise_for_status() raise Exception(f"Max retries exceeded for {url}") ``` ## Troubleshooting **Causes:** * Access token has expired * Token was not included in the request * Token format is incorrect **Solutions:** 1. Verify the token is included: `Authorization: Bearer YOUR_TOKEN` 2. Refresh the token using the `/oauth/refreshtoken` endpoint 3. Re-authenticate to obtain a new token pair **Causes:** * Missing required fields in the request body * Invalid data types or formats * Malformed JSON **Solutions:** 1. Check the API reference for required parameters 2. Validate JSON syntax before sending 3. Ensure dates are in the correct format (`YYYY-MM-DD`) **Causes:** * User lacks permission for the requested action * API key scope is limited **Solutions:** 1. Verify your user has the required permissions in COR 2. Contact your COR administrator to adjust permissions **Causes:** * High API traffic * Scheduled maintenance **Solutions:** 1. Wait 5 minutes and retry 2. Implement exponential backoff in your integration 3. Check [COR Status](https://cor.zendesk.com/) for known issues ## Next steps Make your first API call and authenticate with COR. Explore all available endpoints and parameters. Manage user capacity and project assignments. Use AI-powered tools to accelerate your integration development. **Need help?** Contact our support team at [help@projectcor.com](mailto:help@projectcor.com) or visit [COR Support](https://cor.zendesk.com/). # Introduction Source: https://developers.projectcor.com/index Welcome to the COR API Documentation v1.0 ## Welcome to COR API Build powerful integrations with COR's project management platform. Follow our three step quickstart guide to get up and running. Connect Claude, Cursor, Windsurf, and other AI clients to your COR workspace. ## Explore the API Discover the core capabilities of the COR API. Learn how to authenticate your API requests using OAuth 2.0. Create, update, and manage projects programmatically. Manage tasks, assignments, and track progress. Log hours and manage time entries for your team. ## What can you build? Discover how teams use the COR API to streamline their operations. Keep users, contracts, and schedules synchronized from your HR system using the Integrations API. Automatically create projects when a deal closes in your CRM. Connect hours logged in COR with your payroll or billing system. Sync clients, transactions, and costs with your financial system. **Rate Limits**: The COR API has rate limits in place. Make sure to handle rate limit responses appropriately in your integration. # Quickstart Source: https://developers.projectcor.com/quickstart Make your first COR API call in under 5 minutes This guide walks you through authenticating with the COR API and making your first requests to manage projects, tasks, and time entries. **Prerequisites**: Before you begin, make sure you have your API credentials ready. See the [Development guide](/development) to learn how to obtain your API Key and Client Secret from the COR dashboard. ## Step 1: Get an access token COR uses OAuth 2.0 for authentication. The **Client Credentials** flow is recommended for server-to-server integrations. ### Encode your credentials First, create a Base64 encoded string of your API Key and Client Secret: ```bash theme={null} echo -n "YOUR_API_KEY:YOUR_CLIENT_SECRET" | base64 ``` This produces a string like: `WU9VUl9BUElfS0VZOllPVVJfQ0xJRU5UX1NFQ1JFVA==` ### Request the token Use your encoded credentials to obtain an access token: ```bash cURL theme={null} curl --location --request POST 'https://api.projectcor.com/v1/oauth/token?grant_type=client_credentials' \ --header 'Authorization: Basic YOUR_BASE64_CREDENTIALS' ``` ```python Python theme={null} import requests import base64 api_key = "YOUR_API_KEY" client_secret = "YOUR_CLIENT_SECRET" credentials = base64.b64encode(f"{api_key}:{client_secret}".encode()).decode() response = requests.post( 'https://api.projectcor.com/v1/oauth/token', params={'grant_type': 'client_credentials'}, headers={'Authorization': f'Basic {credentials}'} ) token_data = response.json() access_token = token_data['access_token'] print(f"Access token: {access_token}") ``` ```javascript JavaScript theme={null} const apiKey = 'YOUR_API_KEY'; const clientSecret = 'YOUR_CLIENT_SECRET'; const credentials = btoa(`${apiKey}:${clientSecret}`); const response = await fetch( 'https://api.projectcor.com/v1/oauth/token?grant_type=client_credentials', { method: 'POST', headers: { 'Authorization': `Basic ${credentials}` } } ); const tokenData = await response.json(); console.log('Access token:', tokenData.access_token); ``` **Success response:** ```json theme={null} { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4uLi4" } ``` Save the `access_token` and `refresh_token`. You'll use the access token for all API calls. Store your tokens securely using environment variables. Never hardcode them in your source code. See [secure token management](/development#secure-token-management) for best practices. ### Alternative authentication methods Best for applications that act on behalf of users with their consent. **Step 1:** Redirect users to the consent screen: ``` https://YOUR_SUBDOMAIN.cor.works/oauth2/authorize?name=YourAppName&response_type=code&redirect_uri=YOUR_CALLBACK_URL ``` **Step 2:** Exchange the authorization code for a token: ```bash theme={null} curl --location --request POST 'https://api.projectcor.com/v1/oauth2/token?grant_type=authorization_code&code=AUTH_CODE' ``` For testing and development purposes only. This method is not recommended for production applications. ```bash theme={null} curl --location 'https://api.projectcor.com/v1/auth/login' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'email=your@email.com' \ --data-urlencode 'password=your_password' ``` *** ## Step 2: Verify your authentication Test your access token by retrieving your user profile: ```bash cURL theme={null} curl --location 'https://api.projectcor.com/v1/me' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` ```python Python theme={null} import requests headers = {'Authorization': f'Bearer {access_token}'} response = requests.get('https://api.projectcor.com/v1/me', headers=headers) user = response.json() print(f"Logged in as: {user['first_name']} {user['last_name']}") ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.projectcor.com/v1/me', { headers: { 'Authorization': `Bearer ${accessToken}` } }); const user = await response.json(); console.log(`Logged in as: ${user.first_name} ${user.last_name}`); ``` **Success response:** ```json theme={null} { "id": 12345, "first_name": "John", "last_name": "Doe", "email": "john.doe@company.com", "picture": "https://cdn.projectcor.com/avatars/12345.jpg", "role_id": 3, "user_position_id": 5, "daily_hours": 8, "remaining_hours": 6.5, "cuil": null, "labels": [] } ``` Role IDs: `1` (C-Level), `2` (Director), `3` (Project Manager), `4` (Collaborator), `5` (Freelancer), `6` (Client). If you see your user data, your authentication is working correctly. *** ## Step 3: Explore core endpoints Now that you're authenticated, here are the most common operations you'll perform with the COR API. ### List your projects All list endpoints in COR return **paginated responses** by default. Use `page` and `perPage` parameters to navigate results, and `filters` to narrow down the data. ```bash cURL theme={null} # Basic request (returns page 1 with 20 items) curl --location 'https://api.projectcor.com/v1/projects' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' # With pagination curl --location 'https://api.projectcor.com/v1/projects?page=1&perPage=10' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' # With filters (URL-encoded JSON) curl --location 'https://api.projectcor.com/v1/projects?page=1&filters=%7B%22client_id%22%3A25855%2C%22status%22%3A%22in_process%22%2C%22archived%22%3A2%7D' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` ```python Python theme={null} import json # Basic paginated request response = requests.get( 'https://api.projectcor.com/v1/projects', params={'page': 1, 'perPage': 10}, headers=headers ) result = response.json() print(f"Total projects: {result['total']}") print(f"Page {result['page']} of {result['lastPage']}") for project in result['data']: print(f"- {project['name']} ({project['status']})") # With filters filters = json.dumps({ "client_id": 25855, "status": "in_process", "archived": 2 }) response = requests.get( 'https://api.projectcor.com/v1/projects', params={'page': 1, 'filters': filters}, headers=headers ) ``` ```javascript JavaScript theme={null} // Basic paginated request const response = await fetch( 'https://api.projectcor.com/v1/projects?page=1&perPage=10', { headers: { 'Authorization': `Bearer ${accessToken}` } } ); const result = await response.json(); console.log(`Total projects: ${result.total}`); console.log(`Page ${result.page} of ${result.lastPage}`); result.data.forEach(p => console.log(`- ${p.name} (${p.status})`)); // With filters const filters = JSON.stringify({ client_id: 25855, status: 'in_process', archived: 2 }); const filtered = await fetch( `https://api.projectcor.com/v1/projects?page=1&filters=${encodeURIComponent(filters)}`, { headers: { 'Authorization': `Bearer ${accessToken}` } } ); ``` **Paginated response structure:** ```json theme={null} { "total": "14", "perPage": 20, "page": 1, "lastPage": 1, "meta_data": { "profitability_limit": "30.00" }, "data": [ { "id": 155693, "name": "Website Redesign", "brief": "Complete website overhaul for Q1", "client_id": 25855, "health": 1, "status": "active", "start": "2025-01-15 00:00:00", "end": "2025-03-31 00:00:00", "estimated_time": 200, "elapsed_time": 45, "profitability_now": 85, "estimated_profitability": 100, "archived": false, "billable": true, "income_type": "fee", "pm_id": 8546, "created_at": "2025-01-10 14:30:00", "client": { "id": 25855, "name": "Acme Corp", "client_status_id": 1 }, "pm": { "id": 8546, "first_name": "John", "last_name": "Doe", "email": "john@company.com", "role_id": 3 } } ] } ``` **Pagination parameters:** * `page`: Page number (default: 1). Set to `false` to disable pagination and get all results. * `perPage`: Items per page (default: 20). The table below lists filter fields for **GET /projects** (inside the `filters` JSON). **GET /tasks** uses different keys: use `projects` (project IDs, not `project_id`), `pm` (PM / assignee user IDs on the task, not `user_id`), and `status`, plus other task-specific fields—see [Get Tasks](/api-reference/tasks/get-tasks). | Field | Type | Description | | - | - | - | | `dateStart` | string | Start date range (YYYY-MM-DD) | | `dateEnd` | string | End date range (YYYY-MM-DD) | | `client_id` | number | Filter by client ID | | `team_id` | number | Filter by team ID | | `user_id` | number | Filter by user/PM ID | | `brand_id` | number | Filter by brand ID | | `product_id` | number | Filter by product ID | | `status` | string | `"finished"`, `"in_process"`, `"suspended"` | | `health` | number | 1 (on track), 2 (at risk), 3 (delayed), 4 (critical) | | `archived` | number | `1` (archived only), `2` (active only) | ### List tasks for a project Tasks are also paginated by default. Use the `filters` parameter with a URL-encoded JSON object. Filter by project with the **`projects`** key (a single ID or an array of IDs), by assignee with **`pm`**, and by workflow state with **`status`**. You can also pass an optional **`order`** query parameter as URL-encoded JSON for sort hints (see the API reference). ```bash cURL theme={null} curl --location 'https://api.projectcor.com/v1/tasks?page=1&filters=%7B%22projects%22%3A%5B5001%5D%7D' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` ```python Python theme={null} import json filters = json.dumps({"projects": [5001]}) response = requests.get( 'https://api.projectcor.com/v1/tasks', params={'page': 1, 'filters': filters}, headers=headers ) result = response.json() print(f"Total tasks: {result['total']}") for task in result['data']: print(f"- [{task['status']}] {task['title']}") ``` ```javascript JavaScript theme={null} const filters = JSON.stringify({ projects: [5001] }); const response = await fetch( `https://api.projectcor.com/v1/tasks?page=1&filters=${encodeURIComponent(filters)}`, { headers: { 'Authorization': `Bearer ${accessToken}` } } ); const result = await response.json(); console.log(`Total tasks: ${result.total}`); result.data.forEach(t => console.log(`- [${t.status}] ${t.title}`)); ``` The `filters` parameter accepts a URL-encoded JSON object. For tasks, common fields include `projects`, `pm`, and `status`. Send every filter inside `filters`—do not use separate query parameters like `?project_id=` or `?user_id=`. **Paginated response structure:** ```json theme={null} { "total": "25", "perPage": 20, "page": 1, "lastPage": 2, "data": [ { "id": 10001, "title": "Design homepage mockup", "project_id": 5001, "description": "Create wireframes and high-fidelity mockups for the new homepage", "status": "finalizada", "priority": 2, "deadline": "2024-01-15T18:00:00Z", "archived": false }, { "id": 10002, "title": "Implement responsive navigation", "project_id": 5001, "description": "Build mobile-first navigation component with hamburger menu", "status": "en_proceso", "priority": 1, "deadline": "2024-01-22T18:00:00Z", "archived": false } ] } ``` Task status values: `nueva` (new), `en_proceso` (in progress), `estancada` (stalled), `finalizada` (completed).\ Priority values: `0` (low), `1` (medium), `2` (high), `3` (urgent). ### Log time to a task Time entries use `start` and `stop` timestamps to track worked hours: ```bash cURL theme={null} curl --location 'https://api.projectcor.com/v1/hours' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "task_log_id": 10002, "start": "2024-01-18T09:00:00Z", "stop": "2024-01-18T11:30:00Z" }' ``` ```python Python theme={null} response = requests.post( 'https://api.projectcor.com/v1/hours', headers={**headers, 'Content-Type': 'application/json'}, json={ 'task_log_id': 10002, 'start': '2024-01-18T09:00:00Z', 'stop': '2024-01-18T11:30:00Z' } ) print(f"Time entry created: {response.json()}") ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.projectcor.com/v1/hours', { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ task_log_id: 10002, start: '2024-01-18T09:00:00Z', stop: '2024-01-18T11:30:00Z' }) }); const entry = await response.json(); console.log('Time entry created:', entry); ``` **Success response:** ```json theme={null} { "id": 50001, "task_log_id": 10002, "start": "2024-01-18T09:00:00Z", "stop": "2024-01-18T11:30:00Z", "status": "pending" } ``` The `stop` field is optional. If omitted, a timer will start for the task that you can stop later. ### Get your clients Clients are also paginated by default: ```bash cURL theme={null} curl --location 'https://api.projectcor.com/v1/clients?page=1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` ```python Python theme={null} response = requests.get( 'https://api.projectcor.com/v1/clients', params={'page': 1}, headers=headers ) result = response.json() print(f"Total clients: {result['total']}") for client in result['data']: print(f"- {client['name']} (ID: {client['id']})") ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.projectcor.com/v1/clients?page=1', { headers: { 'Authorization': `Bearer ${accessToken}` } }); const result = await response.json(); console.log(`Total clients: ${result.total}`); result.data.forEach(c => console.log(`- ${c.name} (ID: ${c.id})`)); ``` **Paginated response structure:** ```json theme={null} { "total": "45", "perPage": 20, "page": 1, "lastPage": 3, "data": [ { "id": 2001, "name": "Acme Corp", "business_name": "Acme Corporation LLC", "name_contact": "Jane", "last_name_contact": "Smith", "email_contact": "jane.smith@acme.com", "phone": "+1 555-0100", "website": "https://acme.com", "description": "Enterprise software solutions", "condition": "active" }, { "id": 2002, "name": "TechStart Inc", "business_name": "TechStart Incorporated", "name_contact": "Mike", "last_name_contact": "Johnson", "email_contact": "mike@techstart.io", "phone": "+1 555-0200", "website": "https://techstart.io", "description": "Startup accelerator", "condition": "active" } ] } ``` *** ## Step 4: Refresh your token Access tokens expire after the time specified in `expires_in` (typically 1 hour). Use the refresh token to obtain a new access token: ```bash theme={null} curl --location 'https://api.projectcor.com/v1/oauth/refreshtoken' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'refresh_token=YOUR_REFRESH_TOKEN' ``` **Success response:** ```json theme={null} { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.newtoken...", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "bmV3IHJlZnJlc2ggdG9rZW4uLi4" } ``` For production applications, implement automatic token refresh to ensure uninterrupted API access. See the [Development guide](/development#implement-automatic-token-refresh) for a complete implementation example. *** ## Handle errors When something goes wrong, the API returns standard HTTP status codes: | Code | Description | Solution | | - | - | - | | `400` | Bad Request | Check required fields and JSON syntax | | `401` | Unauthorized | Refresh or re-obtain access token | | `403` | Forbidden | Request necessary permissions from admin | | `404` | Not Found | Verify resource ID exists | | `429` | Too Many Requests | Implement backoff and retry | | `500` | Server Error | Retry with exponential backoff | **Common causes:** * Access token has expired * Token not included in Authorization header * Token format is incorrect (missing "Bearer " prefix) **Solutions:** 1. Verify header format: `Authorization: Bearer YOUR_TOKEN` 2. Refresh the token using `/oauth/refreshtoken` 3. Re-authenticate if refresh token is also expired **Common causes:** * Missing required fields in request body * Invalid date format (use `YYYY-MM-DD`) * Malformed JSON **Solutions:** 1. Check the [API Reference](/api-reference/introduction) for required parameters 2. Validate JSON syntax before sending 3. Ensure dates use ISO 8601 format **Common causes:** * Temporary service disruption * High API traffic **Solutions:** 1. Wait 5 minutes and retry 2. Implement exponential backoff in your integration 3. Check [COR Status](https://cor.zendesk.com/) for known issues *** ## Next steps Congratulations! You've successfully authenticated and made your first API calls. Here's where to go next: Set up your development environment with best practices for token management, error handling, and pagination. Explore all available endpoints with detailed parameters and response schemas. Create, update, and manage projects with budgets, timelines, and team assignments. Manage tasks, track progress, and handle assignments across your projects. Log hours, manage time entries, and generate reports for billing. Plan team capacity, allocate users to projects, and manage workload distribution. Connect external systems like Salesforce, Jira, and SAP with bidirectional sync. **Need help?** Contact our support team at [help@projectcor.com](mailto:help@projectcor.com) or visit [COR Support](https://cor.zendesk.com/).