# Integrations

Integration management endpoints

## GET /integrations

> List all integrations

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}},"schemas":{"Integration":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"type":{"type":"string","description":"Integration type (discord, telegram, custom_webhook, email, etc.)"},"name":{"type":"string"},"config":{"type":"object","description":"Configuration object specific to integration type"},"is_active":{"type":"boolean"},"supported":{"type":"boolean","description":"Whether this integration type is supported in flow"},"created_at":{"type":"string","format":"date-time"}}}}},"paths":{"/integrations":{"get":{"summary":"List all integrations","tags":["Integrations"],"responses":{"200":{"description":"List of integrations","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}}}}}}}}}}}}
```

## POST /integrations

> Create a new integration

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}},"schemas":{"Integration":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"type":{"type":"string","description":"Integration type (discord, telegram, custom_webhook, email, etc.)"},"name":{"type":"string"},"config":{"type":"object","description":"Configuration object specific to integration type"},"is_active":{"type":"boolean"},"supported":{"type":"boolean","description":"Whether this integration type is supported in flow"},"created_at":{"type":"string","format":"date-time"}}}}},"paths":{"/integrations":{"post":{"summary":"Create a new integration","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","name","config"],"properties":{"type":{"type":"string","minLength":1,"description":"Integration type (use /integrations/types to get available types)"},"name":{"type":"string","minLength":2,"maxLength":100},"config":{"type":"object","description":"Configuration object (varies by type, validated by integration handler)"}}}}}},"responses":{"201":{"description":"Integration created","content":{"application/json":{"schema":{"type":"object","properties":{"integration":{"allOf":[{"$ref":"#/components/schemas/Integration"},{"type":"object","properties":{"supported":{"type":"boolean"}}}]}}}}}},"400":{"description":"Validation error or unsupported integration type"},"401":{"description":"Unauthorized"}}}}}}
```

## GET /integrations/types

> Get available integration types

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}}},"paths":{"/integrations/types":{"get":{"summary":"Get available integration types","tags":["Integrations"],"responses":{"200":{"description":"List of integration types","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"supported":{"type":"boolean"},"displayName":{"type":"string"}}}}}}}}}}}}}}
```

## GET /integrations/{integrationId}

> Get integration details

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}}},"paths":{"/integrations/{integrationId}":{"get":{"summary":"Get integration details","tags":["Integrations"],"responses":{"200":{"description":"Integration details"}}}}}}
```

## PUT /integrations/{integrationId}

> Update integration

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}}},"paths":{"/integrations/{integrationId}":{"put":{"summary":"Update integration","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100},"config":{"type":"object","description":"Configuration object (validated by integration handler)"},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Integration updated"},"400":{"description":"Validation error"},"404":{"description":"Integration not found"}}}}}}
```

## DELETE /integrations/{integrationId}

> Delete integration

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Integrations","description":"Integration management endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}}},"paths":{"/integrations/{integrationId}":{"delete":{"summary":"Delete integration","tags":["Integrations"],"responses":{"200":{"description":"Integration deleted"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jnkie.com/rest-api/integrations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
