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

# Get connection

> Find connections by Markifact connection ID or your external ID.

Returns matching connections as a list. Markifact connection ID lookup returns a list with one item. External ID lookup can return multiple connections.

## Endpoint

```http theme={"dark"}
GET /v1/connections/{connection_id}
```

## Path Parameters

| Parameter       | Type   | Description                                                                           |
| --------------- | ------ | ------------------------------------------------------------------------------------- |
| `connection_id` | string | Markifact connection ID by default, or your external ID when `lookup_by=external_id`. |

## Query Parameters

| Parameter   | Type   | Required | Default | Description                                                                         |
| ----------- | ------ | -------- | ------- | ----------------------------------------------------------------------------------- |
| `lookup_by` | string | No       | `id`    | Use `id` for Markifact connection ID lookup, or `external_id` for your external ID. |

## Get by Markifact Connection ID

```bash theme={"dark"}
curl "https://api.markifact.com/v1/connections/1f2e3d4c-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Get by External ID

```bash theme={"dark"}
curl "https://api.markifact.com/v1/connections/customer_123?lookup_by=external_id" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Response

```json theme={"dark"}
[
  {
    "id": "1f2e3d4c-0000-0000-0000-000000000000",
    "type": "ga4",
    "display_name": "login@example.com",
    "external_id": "customer_123",
    "is_private": false,
    "created_at": 1764000000000,
    "updated_at": 1764000000000
  }
]
```

## Notes

* The response is always a list.
* `lookup_by=id` only searches within your team.
* `lookup_by=external_id` can return more than one connection if you use the same external ID for multiple connection types.
* If no connection is found, the API returns `404`.


## OpenAPI

````yaml GET /v1/connections/{connection_id}
openapi: 3.1.0
info:
  title: Markifact API
  version: 1.0.0
  description: API for managing Markifact workspace connections.
servers:
  - url: https://api.markifact.com
security:
  - bearerAuth: []
paths:
  /v1/connections/{connection_id}:
    get:
      tags:
        - Connections
      summary: Get connection
      description: Find connections by Markifact connection ID or your external ID.
      operationId: getConnection
      parameters:
        - name: connection_id
          in: path
          required: true
          schema:
            type: string
          description: >-
            Markifact connection ID by default, or your external ID when
            lookup_by is external_id.
        - name: lookup_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - id
              - external_id
            default: id
          description: >-
            Use id for Markifact connection ID lookup, or external_id for your
            external ID.
      responses:
        '200':
          description: Matching connections returned.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Connection'
        '404':
          description: Connection not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Connection:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Public Markifact connection ID.
        type:
          type: string
          description: Connection type.
        display_name:
          type:
            - string
            - 'null'
        external_id:
          type:
            - string
            - 'null'
        is_private:
          type: boolean
        created_at:
          type:
            - integer
            - 'null'
          format: int64
        updated_at:
          type:
            - integer
            - 'null'
          format: int64
      required:
        - id
        - type
        - is_private
    Error:
      type: object
      properties:
        detail: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````