> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memsync.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Status

> Get the current status and details of an integration

Retrieves the current status, progress, and details of a specific integration.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.memchat.io/integrations/int_linkedin_123/status' \
    -H 'X-API-Key: YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.memchat.io/integrations/int_linkedin_123/status"
  headers = {
      "X-API-Key": "YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  status = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.memchat.io/integrations/int_linkedin_123/status', {
    method: 'GET',
    headers: {
      'X-API-Key': 'YOUR_API_KEY',
    },
  });

  const status = await response.json();
  ```
</RequestExample>

## Path Parameters

<ParamField path="integration_id" type="string" required>
  The unique identifier of the integration
</ParamField>

## Query Parameters

<ParamField query="include_logs" type="boolean" default="false">
  Whether to include processing logs in the response
</ParamField>

<ParamField query="include_errors" type="boolean" default="true">
  Whether to include error details in the response
</ParamField>

## Response

<ResponseField name="integration_id" type="string">
  Unique identifier of the integration
</ResponseField>

<ResponseField name="type" type="string">
  Integration type: `social`, `file`, `chat`, `api`
</ResponseField>

<ResponseField name="platform" type="string">
  Platform or service name (e.g., `linkedin`, `chatgpt`, `pdf`)
</ResponseField>

<ResponseField name="status" type="string">
  Current status: `pending`, `processing`, `completed`, `failed`, `cancelled`
</ResponseField>

<ResponseField name="progress" type="object">
  Progress information for the integration

  <Expandable title="Progress Details">
    <ResponseField name="percentage" type="number">
      Completion percentage (0-100)
    </ResponseField>

    <ResponseField name="current_step" type="string">
      Current processing step
    </ResponseField>

    <ResponseField name="total_steps" type="number">
      Total number of steps
    </ResponseField>

    <ResponseField name="estimated_completion" type="string">
      Estimated completion time (ISO 8601)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="stats" type="object">
  Processing statistics

  <Expandable title="Statistics">
    <ResponseField name="items_processed" type="number">
      Number of items processed so far
    </ResponseField>

    <ResponseField name="items_total" type="number">
      Total number of items to process
    </ResponseField>

    <ResponseField name="memories_created" type="number">
      Number of memories successfully created
    </ResponseField>

    <ResponseField name="errors_count" type="number">
      Number of errors encountered
    </ResponseField>

    <ResponseField name="processing_time" type="number">
      Processing time in seconds
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="last_activity" type="string">
  ISO 8601 timestamp of last processing activity
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when integration was created
</ResponseField>

<ResponseField name="completed_at" type="string">
  ISO 8601 timestamp when integration completed (if finished)
</ResponseField>

<ResponseField name="errors" type="array">
  List of errors encountered (if include\_errors=true)

  <Expandable title="Error Details">
    <ResponseField name="error_id" type="string">
      Unique identifier for the error
    </ResponseField>

    <ResponseField name="message" type="string">
      Error message
    </ResponseField>

    <ResponseField name="code" type="string">
      Error code
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      When the error occurred
    </ResponseField>

    <ResponseField name="item_id" type="string">
      ID of the item that caused the error
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="logs" type="array">
  Processing logs (if include\_logs=true)

  <Expandable title="Log Entries">
    <ResponseField name="timestamp" type="string">
      Log entry timestamp
    </ResponseField>

    <ResponseField name="level" type="string">
      Log level: `info`, `warning`, `error`
    </ResponseField>

    <ResponseField name="message" type="string">
      Log message
    </ResponseField>

    <ResponseField name="step" type="string">
      Processing step
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Processing Response theme={null}
  {
    "integration_id": "int_linkedin_123",
    "type": "social",
    "platform": "linkedin",
    "status": "processing",
    "progress": {
      "percentage": 65,
      "current_step": "extracting_posts",
      "total_steps": 4,
      "estimated_completion": "2024-01-15T16:45:00Z"
    },
    "stats": {
      "items_processed": 95,
      "items_total": 147,
      "memories_created": 67,
      "errors_count": 3,
      "processing_time": 145
    },
    "last_activity": "2024-01-15T16:32:15Z",
    "created_at": "2024-01-15T16:30:00Z",
    "errors": [
      {
        "error_id": "err_001",
        "message": "Failed to parse post content",
        "code": "PARSE_ERROR",
        "timestamp": "2024-01-15T16:31:30Z",
        "item_id": "post_xyz789"
      }
    ]
  }
  ```

  ```json Completed Response theme={null}
  {
    "integration_id": "int_linkedin_123",
    "type": "social", 
    "platform": "linkedin",
    "status": "completed",
    "progress": {
      "percentage": 100,
      "current_step": "completed",
      "total_steps": 4,
      "estimated_completion": null
    },
    "stats": {
      "items_processed": 147,
      "items_total": 147,
      "memories_created": 89,
      "errors_count": 6,
      "processing_time": 267
    },
    "last_activity": "2024-01-15T16:34:27Z",
    "created_at": "2024-01-15T16:30:00Z",
    "completed_at": "2024-01-15T16:34:27Z"
  }
  ```
</ResponseExample>

## Status Types

<Accordion title="Pending">
  Integration is queued and waiting to start processing.
</Accordion>

<Accordion title="Processing">
  Integration is currently being processed. Check progress for details.
</Accordion>

<Accordion title="Completed">
  Integration has finished successfully. All processable items have been handled.
</Accordion>

<Accordion title="Failed">
  Integration failed due to a critical error. Check errors array for details.
</Accordion>

<Accordion title="Cancelled">
  Integration was cancelled by the user or system before completion.
</Accordion>

## Processing Steps

Different integration types have different processing steps:

<Accordion title="Social Media Integration">
  1. **authentication** - Validating access tokens
  2. **discovery** - Finding available content
  3. **extraction** - Downloading content
  4. **processing** - Creating memories from content
</Accordion>

<Accordion title="File Integration">
  1. **upload** - Receiving and storing file
  2. **parsing** - Extracting text content
  3. **chunking** - Breaking content into chunks
  4. **memory\_creation** - Creating memories from chunks
</Accordion>

<Accordion title="Chat Integration">
  1. **validation** - Validating chat data format
  2. **conversation\_detection** - Identifying conversations
  3. **content\_extraction** - Extracting meaningful content
  4. **memory\_creation** - Creating memories from conversations
</Accordion>

## Error Responses

<ResponseField name="404" type="object">
  Integration not found

  ```json theme={null}
  {
    "error": "Integration not found",
    "code": "INTEGRATION_NOT_FOUND",
    "integration_id": "int_invalid_123"
  }
  ```
</ResponseField>

<ResponseField name="401" type="object">
  Unauthorized access

  ```json theme={null}
  {
    "error": "Invalid or expired token",
    "code": "UNAUTHORIZED"
  }
  ```
</ResponseField>

## Real-time Updates

For real-time status updates, consider using:

* **Webhooks**: Configure webhook endpoints to receive status updates
* **Polling**: Poll this endpoint every 10-30 seconds during processing
* **WebSocket**: Connect to the WebSocket endpoint for live updates (coming soon)
