# Custom Integrations {#custom-integrations}


Build custom integrations using Gauzy's plugin system and API.


## Plugin-Based Integrations {#plugin-based-integrations}


Create a NestJS module that registers as an integration:

```typescript
@Module({
  imports: [IntegrationModule],
  providers: [CustomIntegrationService],
  controllers: [CustomIntegrationController],
})
export class PluginCustomIntegrationModule {}
```


### Integration Entity {#integration-entity}


Register your integration type:

```typescript
const integration = await this.integrationTypeService.create({
  name: "Custom Service",
  groupName: "Custom",
  order: 100,
  icon: "custom-icon",
  redirectUrl: "/integrations/custom/setup",
});
```


## API-Based Integrations {#api-based-integrations}



### REST API {#rest-api}


Use the standard REST API to build external integrations:

```bash
# Create time log from external system
POST /api/timesheet/time-log
Authorization: Bearer <token>
Content-Type: application/json

{
  "startedAt": "2024-01-15T09:00:00Z",
  "stoppedAt": "2024-01-15T10:00:00Z",
  "source": "BROWSER_EXTENSION",
  "projectId": "project-uuid",
  "taskId": "task-uuid"
}
```


### GraphQL API {#graphql-api}


```graphql
mutation CreateTimeLog($input: TimeLogCreateInput!) {
  createTimeLog(input: $input) {
    id
    duration
    startedAt
    stoppedAt
  }
}
```


### Webhooks {#webhooks}


Subscribe to events via the webhook system:

```bash
POST /api/integration/webhook
{
  "url": "https://your-service.com/webhook",
  "events": ["time_log.created", "task.updated"],
  "secret": "your-webhook-secret"
}
```


## MCP Integration {#mcp-integration}


For AI-powered integrations, use the [MCP Server](https://sourcey-gauzy.pages.dev/mcp-server/mcp-overview/index.md):

- 323+ available tools
- OAuth 2.0 authentication
- HTTP, WebSocket, and Stdio transports


## Related Pages {#related-pages}


- [Integrations Overview](https://sourcey-gauzy.pages.dev/integrations/integrations-overview/index.md)
- [API Overview](https://sourcey-gauzy.pages.dev/api/overview/index.md) — REST and GraphQL API
- [MCP Server](https://sourcey-gauzy.pages.dev/mcp-server/mcp-overview/index.md) — AI integration
