# My Lists API Reference

> Platform documentation snapshot. Access, charging and provider requirements remain operation-specific; examples do not execute requests.

### What it does

Programmatic access to the saved lists in your workspace: read lists, inspect their contacts and companies, and keep external systems synchronized with what your team saved in the UI.

### Use cases

- Sync a saved list into a sequencer or CRM campaign on a schedule.
- Let an internal dashboard report on list size, coverage and unlock rate.
- Trigger a workflow whenever a rep saves a new list of prospects.

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `name` | string | List name (required for create/update) |
| `pids` | string[] | Array of prospect PIDs to add to a list |
| `listId` | string | List ID (path parameter for get/update/delete) |

### Response Schema

_Complete documented fields for this section, with nested notation preserved. Endpoint-specific envelopes, availability and additional fields are described under each endpoint below._

| Field | Notes |
|-------|-------|
| id | |
| name | |
| created_at | |
| updated_at | |
| contact_count | |
| contacts[] → pid, first_name, last_name, email, job_title, company_name | |

**Illustrative Example Response (synthetic, not a complete endpoint schema):**

```json
{
  "data": {
    "id": "abc123",
    "name": "string",
    "created_at": "2025-06-01T12:00:00Z",
    "updated_at": "2025-06-01T12:00:00Z",
    "contact_count": 0,
    "contacts": [
      {
        "pid": "abc123",
        "first_name": "string",
        "last_name": "string",
        "email": "user@example.com",
        "job_title": "string",
        "company_name": "string"
      }
    ]
  }
}
```

### GET /lists — List My Lists

Retrieve all lists belonging to your account.

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists",
  "method": "GET"
}'
```

### GET /lists/{listId} — Get My List

Retrieve a specific list by its ID.

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists/{listId}",
  "method": "GET"
}'
```

### GET /lists/{listId}/contacts — Get My List Contacts

Retrieve all contacts within a specific list.

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists/{listId}/contacts",
  "method": "GET"
}'
```

### POST /lists — Create My List

Create a new list.

**Example Request Body:**

```json
{
  "name": "My New List"
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists",
  "method": "POST",
  "body": {
    "name": "My New List"
  }
}'
```

### POST /lists/{listId}/contacts — Add Contacts To My List

Add one or more contacts to a list by their PIDs.

**Example Request Body:**

```json
{
  "pids": [
    "10000000331"
  ]
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists/{listId}/contacts",
  "method": "POST",
  "body": {
    "pids": [
      "10000000331"
    ]
  }
}'
```

### PUT /lists/{listId} — Update My List

Update an existing list's name.

**Example Request Body:**

```json
{
  "name": "My Leads List"
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists/{listId}",
  "method": "PUT",
  "body": {
    "name": "My Leads List"
  }
}'
```

### DELETE /lists/{listId} — Delete My List

Permanently delete a list.

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/lists/{listId}",
  "method": "DELETE"
}'
```

