Skip to content

maton-ai/api-gateway-skill

api-gateway

Verified

Call third-party APIs through the Maton gateway, which injects the credential for an app the user has already connected. Use this skill when the user names a connected app and a concrete action in it - read a mailbox, query a CRM, file an issue, update a spreadsheet, run a query through a connected search or scraping provider. Every call goes to an app the user connected. It is not a general-purpose browser or network client, and it cannot reach a service with no Maton connection. It also manages event triggers, webhook destinations that forward event payloads to an external URL until deleted, and local `--exec` handlers that run a script per event - separate, high-risk capabilities beyond a normal API call. Default to read and list calls; every write, connection, trigger, destination, or handler needs explicit user confirmation.

FileKindSize
SKILL.mdskill md55.7 KB
references/active-campaign/README.mdmarkdown12.8 KB
references/acuity-scheduling/README.mdmarkdown11.3 KB
references/airtable/README.mdmarkdown5.8 KB
references/apify/README.mdmarkdown14.6 KB
references/apollo/README.mdmarkdown7.0 KB
references/asana/README.mdmarkdown12.6 KB
references/attio/README.mdmarkdown12.7 KB
references/basecamp/README.mdmarkdown14.9 KB
references/baserow/README.mdmarkdown15.8 KB
references/beehiiv/README.mdmarkdown12.2 KB
references/box/README.mdmarkdown21.8 KB
references/brave-search/README.mdmarkdown13.7 KB
references/brevo/README.mdmarkdown17.5 KB
references/buffer/README.mdmarkdown13.6 KB
references/cal-com/README.mdmarkdown14.9 KB
references/calendly/README.mdmarkdown16.0 KB
references/calendly/triggers.mdmarkdown9.6 KB
references/callrail/README.mdmarkdown11.0 KB
references/chargebee/README.mdmarkdown7.2 KB
references/clickfunnels/README.mdmarkdown17.2 KB
references/clicksend/README.mdmarkdown13.2 KB
references/clickup/README.mdmarkdown15.4 KB
references/clio/README.mdmarkdown11.0 KB
references/clockify/README.mdmarkdown12.2 KB
references/coda/README.mdmarkdown10.7 KB
references/cognito-forms/README.mdmarkdown5.4 KB
references/companycam/README.mdmarkdown14.2 KB
references/confluence/README.mdmarkdown19.0 KB
references/constant-contact/README.mdmarkdown26.7 KB
references/dropbox-business/README.mdmarkdown24.2 KB
references/dropbox/README.mdmarkdown16.8 KB
references/elevenlabs/README.mdmarkdown13.2 KB
references/eventbrite/README.mdmarkdown10.4 KB
references/exa/README.mdmarkdown14.1 KB
references/facebook-page/README.mdmarkdown15.5 KB
references/fal-ai/README.mdmarkdown8.0 KB
references/fastmail/README.mdmarkdown34.0 KB
references/fathom/README.mdmarkdown10.0 KB
references/figma/README.mdmarkdown18.1 KB
references/firebase/README.mdmarkdown11.4 KB
references/firecrawl/README.mdmarkdown17.3 KB
references/fireflies/README.mdmarkdown6.6 KB
references/front/README.mdmarkdown10.6 KB
references/getresponse/README.mdmarkdown15.0 KB
references/github/README.mdmarkdown19.6 KB
references/github/triggers.mdmarkdown63.8 KB
references/google-ads/README.mdmarkdown7.5 KB
references/google-analytics-admin/README.mdmarkdown9.6 KB
references/google-analytics-data/README.mdmarkdown5.7 KB
references/google-apps-script/README.mdmarkdown14.2 KB
references/google-bigquery/README.mdmarkdown13.2 KB
references/google-business-profile/README.mdmarkdown19.8 KB
references/google-calendar/README.mdmarkdown6.8 KB
references/google-classroom/README.mdmarkdown15.7 KB
references/google-contacts/README.mdmarkdown8.2 KB
references/google-docs/README.mdmarkdown4.3 KB
references/google-drive/README.mdmarkdown10.8 KB
references/google-forms/README.mdmarkdown5.2 KB
references/google-mail/README.mdmarkdown7.9 KB
references/google-mail/triggers.mdmarkdown2.1 KB
references/google-meet/README.mdmarkdown5.3 KB
references/google-merchant/README.mdmarkdown19.2 KB
references/google-play/README.mdmarkdown8.3 KB
references/google-search-console/README.mdmarkdown6.2 KB
references/google-sheets/README.mdmarkdown9.0 KB
references/google-slides/README.mdmarkdown8.1 KB
references/google-tag-manager/README.mdmarkdown17.9 KB
references/google-tasks/README.mdmarkdown11.1 KB
references/google-workspace-admin/README.mdmarkdown11.1 KB
references/grafana/README.mdmarkdown10.1 KB
references/granola-mcp/README.mdmarkdown7.2 KB
references/granola-mcp/schemas/get_meeting_transcript.jsonconfig819 B
references/granola-mcp/schemas/get_meetings.jsonconfig1.6 KB
references/granola-mcp/schemas/list_meetings.jsonconfig1.5 KB
references/granola-mcp/schemas/query_granola_meetings.jsonconfig2.1 KB
references/gumroad/README.mdmarkdown13.1 KB
references/highlevel-pit/README.mdmarkdown26.5 KB
references/hubspot/README.mdmarkdown20.3 KB
references/hubspot/triggers.mdmarkdown6.0 KB
references/icloud-mail/README.mdmarkdown21.3 KB
references/instantly/README.mdmarkdown12.6 KB
references/jira/README.mdmarkdown9.3 KB
references/jobber/README.mdmarkdown8.6 KB
references/jotform/README.mdmarkdown7.2 KB
references/kaggle/README.mdmarkdown7.3 KB
references/keap/README.mdmarkdown13.7 KB
references/kibana/README.mdmarkdown10.2 KB
references/kit/README.mdmarkdown10.4 KB
references/klaviyo/README.mdmarkdown36.7 KB
references/lemlist/README.mdmarkdown6.5 KB
references/linear/README.mdmarkdown7.9 KB
references/linear/triggers.mdmarkdown6.5 KB
references/linkedin-community-management/README.mdmarkdown19.6 KB
references/linkedin/README.mdmarkdown22.6 KB
references/mailchimp/README.mdmarkdown18.6 KB
references/mailerlite/README.mdmarkdown15.6 KB
references/mailgun/README.mdmarkdown16.8 KB
references/make/README.mdmarkdown14.3 KB
references/manus/README.mdmarkdown8.1 KB
references/manychat/README.mdmarkdown11.5 KB
references/memelord/README.mdmarkdown10.0 KB
references/microsoft-excel/README.mdmarkdown7.9 KB
references/microsoft-teams/README.mdmarkdown17.0 KB
references/microsoft-to-do/README.mdmarkdown9.2 KB
references/monday/README.mdmarkdown8.0 KB
references/motion/README.mdmarkdown9.9 KB
references/netlify/README.mdmarkdown15.6 KB
references/notion-mcp/README.mdmarkdown14.9 KB
references/notion-mcp/schemas/notion-create-comment.jsonconfig17.6 KB
references/notion-mcp/schemas/notion-create-database.jsonconfig4.6 KB
references/notion-mcp/schemas/notion-create-pages.jsonconfig10.6 KB
references/notion-mcp/schemas/notion-duplicate-page.jsonconfig927 B
references/notion-mcp/schemas/notion-fetch.jsonconfig2.1 KB
references/notion-mcp/schemas/notion-get-comments.jsonconfig1.6 KB
references/notion-mcp/schemas/notion-get-teams.jsonconfig863 B
references/notion-mcp/schemas/notion-get-users.jsonconfig2.3 KB
references/notion-mcp/schemas/notion-move-pages.jsonconfig3.3 KB
references/notion-mcp/schemas/notion-search.jsonconfig4.3 KB
references/notion-mcp/schemas/notion-update-data-source.jsonconfig6.4 KB
references/notion-mcp/schemas/notion-update-page.jsonconfig9.3 KB
references/notion/README.mdmarkdown12.0 KB
references/notion/triggers.mdmarkdown5.2 KB
references/one-drive/README.mdmarkdown16.8 KB
references/one-note/README.mdmarkdown11.3 KB
references/outlook/README.mdmarkdown10.4 KB
references/pdf-co/README.mdmarkdown9.9 KB
references/pipedrive/README.mdmarkdown9.1 KB
references/podio/README.mdmarkdown11.9 KB
references/posthog/README.mdmarkdown12.5 KB
references/quickbooks/README.mdmarkdown13.2 KB
references/quo/README.mdmarkdown11.2 KB
references/reducto/README.mdmarkdown9.4 KB
references/resend/README.mdmarkdown15.8 KB
references/salesforce/README.mdmarkdown14.6 KB
references/sendgrid/README.mdmarkdown16.8 KB
references/sentry/README.mdmarkdown9.8 KB
references/sharepoint/README.mdmarkdown15.6 KB
references/signnow/README.mdmarkdown9.7 KB
references/slack/README.mdmarkdown17.9 KB
references/slack/triggers.mdmarkdown5.6 KB
references/snapchat/README.mdmarkdown14.9 KB
references/squarespace/README.mdmarkdown18.0 KB
references/squareup/README.mdmarkdown21.1 KB
references/stripe/README.mdmarkdown23.6 KB
references/stripe/triggers.mdmarkdown24.6 KB
references/sunsama-mcp/README.mdmarkdown11.1 KB
references/sunsama-mcp/schemas/accept_meeting_invite.jsonconfig827 B
references/sunsama-mcp/schemas/add_subtasks_to_task.jsonconfig663 B
references/sunsama-mcp/schemas/add_task_to_channel.jsonconfig1.7 KB
references/sunsama-mcp/schemas/align_task_with_objective.jsonconfig414 B
references/sunsama-mcp/schemas/append_task_notes.jsonconfig1.3 KB
references/sunsama-mcp/schemas/change_backlog_folder.jsonconfig807 B
references/sunsama-mcp/schemas/create_braindump_task.jsonconfig616 B
references/sunsama-mcp/schemas/create_calendar_event.jsonconfig1.6 KB
references/sunsama-mcp/schemas/create_channel.jsonconfig1.3 KB
references/sunsama-mcp/schemas/create_follow_up_task_from_email.jsonconfig1.9 KB
references/sunsama-mcp/schemas/create_task.jsonconfig580 B
references/sunsama-mcp/schemas/create_weekly_objective.jsonconfig440 B
references/sunsama-mcp/schemas/decline_meeting_invite.jsonconfig695 B
references/sunsama-mcp/schemas/delete_all_incomplete_recurring_task_instances.jsonconfig1.2 KB
references/sunsama-mcp/schemas/delete_calendar_event.jsonconfig1.6 KB
references/sunsama-mcp/schemas/delete_email_thread.jsonconfig674 B
references/sunsama-mcp/schemas/delete_task.jsonconfig915 B
references/sunsama-mcp/schemas/edit_subtask_title.jsonconfig1.7 KB
references/sunsama-mcp/schemas/edit_task_recurrence_rule.jsonconfig448 B
references/sunsama-mcp/schemas/edit_task_time_estimate.jsonconfig418 B
references/sunsama-mcp/schemas/edit_task_title.jsonconfig375 B
references/sunsama-mcp/schemas/get_archived_tasks.jsonconfig162 B
references/sunsama-mcp/schemas/get_backlog_tasks.jsonconfig171 B
references/sunsama-mcp/schemas/get_task_time_estimate.jsonconfig309 B
references/sunsama-mcp/schemas/import_task_from_calendar_event.jsonconfig944 B
references/sunsama-mcp/schemas/list_email_threads.jsonconfig310 B
references/sunsama-mcp/schemas/log_user_feedback.jsonconfig772 B
references/sunsama-mcp/schemas/mark_email_thread_as_read.jsonconfig552 B
references/sunsama-mcp/schemas/mark_subtask_as_completed.jsonconfig409 B
references/sunsama-mcp/schemas/mark_subtask_as_incomplete.jsonconfig411 B
references/sunsama-mcp/schemas/mark_task_as_completed.jsonconfig441 B
references/sunsama-mcp/schemas/mark_task_as_incomplete.jsonconfig282 B
references/sunsama-mcp/schemas/move_calendar_event.jsonconfig2.0 KB
references/sunsama-mcp/schemas/move_task_from_backlog.jsonconfig432 B
references/sunsama-mcp/schemas/move_task_to_backlog.jsonconfig288 B
references/sunsama-mcp/schemas/move_task_to_day.jsonconfig428 B
references/sunsama-mcp/schemas/reorder_tasks.jsonconfig484 B
references/sunsama-mcp/schemas/reposition_task_in_backlog.jsonconfig622 B
references/sunsama-mcp/schemas/restore_task.jsonconfig279 B
references/sunsama-mcp/schemas/schedule_next_call.jsonconfig1.8 KB
references/sunsama-mcp/schemas/search_tasks.jsonconfig292 B
references/sunsama-mcp/schemas/set_calendar_event_allow_task_projections.jsonconfig902 B
references/sunsama-mcp/schemas/set_shutdown_time.jsonconfig508 B
references/sunsama-mcp/schemas/start_task_timer.jsonconfig276 B
references/sunsama-mcp/schemas/stop_task_timer.jsonconfig274 B
references/sunsama-mcp/schemas/timebox_a_task_to_calendar.jsonconfig1.2 KB
references/sunsama-mcp/schemas/toggle_auto_import_events.jsonconfig311 B
references/sunsama-mcp/schemas/unarchive_task.jsonconfig453 B
references/sunsama-mcp/schemas/update_all_incomplete_recurring_task_instances.jsonconfig1.8 KB
references/sunsama-mcp/schemas/update_calendar_preferences.jsonconfig1.1 KB
references/sunsama-mcp/schemas/update_import_event_filters.jsonconfig387 B
references/supabase/README.mdmarkdown10.7 KB
references/systeme/README.mdmarkdown8.7 KB

references/linkedin/README.md

View on GitHub
# LinkedIn

## API Reference

> **Safety:** All write operations (POST, PUT, PATCH, DELETE) require explicit user confirmation before execution. Verify the target resource and intended effect with the user first. See the main [SKILL.md](../../SKILL.md#security--permissions) for full security policy.

**App name:** `linkedin`
**Upstream base URL:** `api.linkedin.com`

Replace the upstream base URL with the app name. Everything after the base URL including query strings is kept as-is. Any account-specific part of the base URL and the API credentials are stored in the Maton connection, and the gateway injects both so requests never carry them. For example:

- Upstream: `https://api.linkedin.com/rest/me`
- Gateway: `https://api.maton.ai/linkedin/rest/me`

**Important:** REST API (`/rest/...`) calls take a `LinkedIn-Version` header (`YYYYMM`, e.g. `202606`). If you leave it out, Maton sends `202606`.

### Profile API

#### Get Current User Profile

```bash
maton api '/linkedin/rest/me' -H 'LinkedIn-Version: 202606'
```

**Example:**
```bash
maton api '/linkedin/rest/me' -H 'LinkedIn-Version: 202606'
```

**Response:**
```json
{
  "firstName": {
    "localized": {"en_US": "John"},
    "preferredLocale": {"country": "US", "language": "en"}
  },
  "localizedFirstName": "John",
  "lastName": {
    "localized": {"en_US": "Doe"},
    "preferredLocale": {"country": "US", "language": "en"}
  },
  "localizedLastName": "Doe",
  "id": "yrZCpj2Z12",
  "vanityName": "johndoe",
  "localizedHeadline": "Software Engineer at Example Corp",
  "profilePicture": {
    "displayImage": "urn:li:digitalmediaAsset:C4D00AAAAbBCDEFGhiJ"
  }
}
```

#### Create Article/URL Share

```bash
maton api -X POST '/linkedin/rest/posts' \
  -H 'Content-Type: application/json' \
  -H 'LinkedIn-Version: 202606' \
  --input - <<'EOF'
{
  "author": "urn:li:person:{personId}",
  "lifecycleState": "PUBLISHED",
  "visibility": "PUBLIC",
  "commentary": "Check this out!",
  "distribution": {
    "feedDistribution": "MAIN_FEED"
  },
  "content": {
    "article": {
      "source": "https://example.com",
      "title": "Title",
      "description": "Description"
    }
  }
}
EOF
```

**Note:** `{personId}` is a placeholder. Replace it with a real value before sending the request.

#### Create Text Post

First, initialize the image upload, then upload the image, then create the post.

**Step 1: Initialize Image Upload**
```bash
maton api -X POST '/linkedin/rest/images?action=initializeUpload' -H 'LinkedIn-Version: 202606' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "initializeUploadRequest": {
    "owner": "urn:li:person:{personId}"
  }
}
JSON
```

**Note:** `{personId}` is a placeholder. Replace it with a real value before sending the request.

**Response:**
```json
{
  "value": {
    "uploadUrlExpiresAt": 1770541529250,
    "uploadUrl": "https://www.linkedin.com/dms-uploads/...",
    "image": "urn:li:image:D4D10AQH4GJAjaFCkHQ"
  }
}
```

**Step 2: Upload Image Binary**
```bash
PUT {uploadUrl from step 1}
Content-Type: image/png

{binary image data}
```

**Step 3: Create Image Post**
```bash
maton api -X POST '/linkedin/rest/posts' -H 'LinkedIn-Version: 202606' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "author": "urn:li:person:{personId}",
  "lifecycleState": "PUBLISHED",
  "visibility": "PUBLIC",
  "commentary": "Check out this image!",
  "distribution": {
    "feedDistribution": "MAIN_FEED"
  },
  "content": {
    "media": {
      "id": "urn:li:image:D4D10AQH4GJAjaFCkHQ",
      "title": "Image Title"
    }
  }
}
JSON
```

**Note:** `{personId}` is a placeholder. Replace it with a real value before sending the request.

#### Ad Library - Search Ads

```bash
maton api '/linkedin/rest/adLibrary?q=criteria&keyword={keyword}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{keyword}` is a placeholder. Replace it with a real value before sending the request.

**Query parameters:**
- `keyword` (string): Search ad content (multiple keywords use AND logic)
- `advertiser` (string): Search by advertiser name
- `countries` (array): Filter by ISO 3166-1 alpha-2 country codes
- `dateRange` (object): Filter by served dates
- `start` (integer): Pagination offset
- `count` (integer): Results per page (max 25)

**Example - Search ads by keyword:**
```bash
maton api '/linkedin/rest/adLibrary?q=criteria&keyword=linkedin' -H 'LinkedIn-Version: 202606'
```

**Example - Search ads by advertiser:**
```bash
maton api '/linkedin/rest/adLibrary?q=criteria&advertiser=microsoft' -H 'LinkedIn-Version: 202606'
```

**Response:**
```json
{
  "paging": {
    "start": 0,
    "count": 10,
    "total": 11619543,
    "links": [...]
  },
  "elements": [
    {
      "adUrl": "https://www.linkedin.com/ad-library/detail/...",
      "details": {
        "advertiser": {...},
        "adType": "TEXT_AD",
        "targeting": {...},
        "statistics": {
          "firstImpressionDate": 1704067200000,
          "latestImpressionDate": 1706745600000,
          "impressionsFrom": 1000,
          "impressionsTo": 5000
        }
      },
      "isRestricted": false
    }
  ]
}
```

#### Job Library - Search Jobs

```bash
maton api '/linkedin/rest/jobLibrary?q=criteria&keyword={keyword}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{keyword}` is a placeholder. Replace it with a real value before sending the request.

**Note:** Job Library requires version `202606`.

**Query parameters:**
- `keyword` (string): Search job content
- `organization` (string): Filter by company name
- `countries` (array): Filter by country codes
- `dateRange` (object): Filter by posting dates
- `start` (integer): Pagination offset
- `count` (integer): Results per page (max 24)

**Example:**
```bash
maton api '/linkedin/rest/jobLibrary?q=criteria&keyword=software&organization=google' -H 'LinkedIn-Version: 202606'
```

**Response:**
- `jobPostingUrl`: Link to job listing
- `jobDetails`: Title, location, description, salary, benefits
- `statistics`: Impression data

### Marketing API

#### List Ad Accounts

```bash
maton api '/linkedin/rest/adAccounts?q=search' -H 'LinkedIn-Version: 202606'
```

Returns all ad accounts accessible by the authenticated user.

**Response:**
```json
{
  "paging": {
    "start": 0,
    "count": 10,
    "links": []
  },
  "elements": [
    {
      "id": 123456789,
      "name": "My Ad Account",
      "status": "ACTIVE",
      "type": "BUSINESS",
      "currency": "USD",
      "reference": "urn:li:organization:12345"
    }
  ]
}
```

#### Get Ad Account

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}'
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### Create Ad Account

```bash
maton api -X POST '/linkedin/rest/adAccounts' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "name": "New Ad Account",
  "currency": "USD",
  "reference": "urn:li:organization:{orgId}",
  "type": "BUSINESS"
}
JSON
```

**Note:** `{orgId}` is a placeholder. Replace it with a real value before sending the request.

#### Update Ad Account

```bash
maton api -X POST '/linkedin/rest/adAccounts/{adAccountId}' -H 'X-RestLi-Method: PARTIAL_UPDATE' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "patch": {
    "$set": {
      "name": "Updated Account Name"
    }
  }
}
JSON
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### List Campaign Groups

Campaign groups are nested under ad accounts:

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaignGroups' -H 'LinkedIn-Version: 202606'
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### Create Campaign Group

```bash
maton api -X POST '/linkedin/rest/adAccounts/{adAccountId}/adCampaignGroups' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "name": "Q1 2026 Campaigns",
  "status": "DRAFT",
  "runSchedule": {
    "start": 1704067200000,
    "end": 1711929600000
  },
  "totalBudget": {
    "amount": "10000",
    "currencyCode": "USD"
  }
}
JSON
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### Get Campaign Group

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaignGroups/{campaignGroupId}'
```

**Note:** `{adAccountId}` and `{campaignGroupId}` are placeholders. Replace each of them with real values before sending the request.

#### Update Campaign Group

```bash
maton api -X POST '/linkedin/rest/adAccounts/{adAccountId}/adCampaignGroups/{campaignGroupId}' -H 'X-RestLi-Method: PARTIAL_UPDATE' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "patch": {
    "$set": {
      "status": "ACTIVE"
    }
  }
}
JSON
```

**Note:** `{adAccountId}` and `{campaignGroupId}` are placeholders. Replace each of them with real values before sending the request.

#### Delete Campaign Group

> **Destructive operation.** Deleting a campaign group may be irreversible and will remove all associated data. Confirm the campaign group ID and that no active campaigns depend on it before proceeding.

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaignGroups/{campaignGroupId}' -X DELETE
```

**Note:** `{adAccountId}` and `{campaignGroupId}` are placeholders. Replace each of them with real values before sending the request.

#### List Campaigns

Campaigns are also nested under ad accounts:

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaigns' -H 'LinkedIn-Version: 202606'
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### Create Campaign

```bash
maton api -X POST '/linkedin/rest/adAccounts/{adAccountId}/adCampaigns' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "campaignGroup": "urn:li:sponsoredCampaignGroup:123456",
  "name": "Brand Awareness Campaign",
  "status": "DRAFT",
  "type": "SPONSORED_UPDATES",
  "objectiveType": "BRAND_AWARENESS",
  "dailyBudget": {
    "amount": "100",
    "currencyCode": "USD"
  },
  "costType": "CPM",
  "unitCost": {
    "amount": "5",
    "currencyCode": "USD"
  },
  "locale": {
    "country": "US",
    "language": "en"
  }
}
JSON
```

**Note:** `{adAccountId}` is a placeholder. Replace it with a real value before sending the request.

#### Get Campaign

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}'
```

**Note:** `{adAccountId}` and `{campaignId}` are placeholders. Replace each of them with real values before sending the request.

#### Update Campaign

```bash
maton api -X POST '/linkedin/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}' -H 'X-RestLi-Method: PARTIAL_UPDATE' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "patch": {
    "$set": {
      "status": "ACTIVE"
    }
  }
}
JSON
```

**Note:** `{adAccountId}` and `{campaignId}` are placeholders. Replace each of them with real values before sending the request.

#### Delete Campaign

> **Destructive operation.** Deleting a campaign is irreversible and will stop all ad delivery. Confirm the campaign ID and its current status with the user before proceeding.

```bash
maton api '/linkedin/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}' -X DELETE
```

**Note:** `{adAccountId}` and `{campaignId}` are placeholders. Replace each of them with real values before sending the request.

#### List Organization ACLs

Get organizations the authenticated user has access to:

```bash
maton api '/linkedin/rest/organizationAcls?q=roleAssignee' -H 'LinkedIn-Version: 202606'
```

**Response:**
```json
{
  "paging": {
    "start": 0,
    "count": 10,
    "total": 2
  },
  "elements": [
    {
      "role": "ADMINISTRATOR",
      "organization": "urn:li:organization:12345",
      "state": "APPROVED"
    }
  ]
}
```

#### Get Organization

```bash
maton api '/linkedin/rest/organizations/{organizationId}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{organizationId}` is a placeholder. Replace it with a real value before sending the request.

#### Lookup Organization by Vanity Name

```bash
maton api '/linkedin/rest/organizations?q=vanityName&vanityName={vanityName}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{vanityName}` is a placeholder. Replace it with a real value before sending the request.

**Example:**
```bash
maton api '/linkedin/rest/organizations?q=vanityName&vanityName=microsoft' -H 'LinkedIn-Version: 202606'
```

**Response:**
```json
{
  "elements": [
    {
      "vanityName": "microsoft",
      "localizedName": "Microsoft",
      "website": {
        "localized": {"en_US": "https://news.microsoft.com/"}
      }
    }
  ]
}
```

#### Get Organization Share Statistics

```bash
maton api '/linkedin/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity={orgUrn}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{orgUrn}` is a placeholder. Replace it with a real value before sending the request.

**Example:**
```bash
maton api '/linkedin/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:12345' -H 'LinkedIn-Version: 202606'
```

#### Get Organization Posts

```bash
maton api '/linkedin/rest/posts?q=author&author={orgUrn}' -H 'LinkedIn-Version: 202606'
```

**Note:** `{orgUrn}` is a placeholder. Replace it with a real value before sending the request.

**Example:**
```bash
maton api '/linkedin/rest/posts?q=author&author=urn:li:organization:12345' -H 'LinkedIn-Version: 202606'
```

#### Initialize Image Upload

```bash
maton api -X POST '/linkedin/rest/images?action=initializeUpload' -H 'LinkedIn-Version: 202606' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "initializeUploadRequest": {
    "owner": "urn:li:person:{personId}"
  }
}
JSON
```

**Response:**
```json
{
  "value": {
    "uploadUrlExpiresAt": 1770541529250,
    "uploadUrl": "https://www.linkedin.com/dms-uploads/...",
    "image": "urn:li:image:D4D10AQH4GJAjaFCkHQ"
  }
}
```

Use the `uploadUrl` to PUT your image binary, then use the `image` URN in your post.

#### Create a Video Post

Video uploads are a 4-step process: initialize, upload binary, finalize, then create the post.

> **CRITICAL — URL Encoding:** The upload URL returned by the initialize step contains URL-encoded characters (e.g., `%253D`) that get corrupted when passed through shell variables or `curl`. You **MUST** use Python `urllib` for the entire flow — parse the JSON response and use the URL directly in Python without passing it through the shell. This is the only reliable approach.

**Complete working example:**

```bash
python3 <<'EOF'
import json, os, subprocess, urllib.request

HEADERS = ['-H', 'LinkedIn-Version: 202606', '-H', 'X-Restli-Protocol-Version: 2.0.0']

def api(path, method=None, body=None):
    cmd = ['maton', 'api', path] + HEADERS
    if method:
        cmd += ['-X', method]
    if body is not None:
        cmd += ['-H', 'Content-Type: application/json', '--input', '-']
    p = subprocess.run(cmd, input=json.dumps(body) if body is not None else None,
                       capture_output=True, text=True, check=True)
    return json.loads(p.stdout)

# Step 0: get the person ID
owner = f"urn:li:person:{api('/linkedin/rest/me')['id']}"

# Step 1: initialize the upload through the gateway
file_path = '/path/to/video.mp4'
init = api('/linkedin/rest/videos?action=initializeUpload', 'POST', {
    'initializeUploadRequest': {
        'owner': owner,
        'fileSizeBytes': os.path.getsize(file_path),
        'uploadCaptions': False,
        'uploadThumbnail': False,
    }
})
upload_url = init['value']['uploadInstructions'][0]['uploadUrl']
video_urn = init['value']['video']

# Step 2: upload the bytes DIRECTLY to LinkedIn's pre-signed URL (not through the gateway).
# It needs no Authorization header. Use the URL exactly as returned — never via a shell string.
with open(file_path, 'rb') as f:
    upload_req = urllib.request.Request(upload_url, data=f.read(), method='PUT')
upload_req.add_header('Content-Type', 'application/octet-stream')
etag = urllib.request.urlopen(upload_req).headers['etag']

# Step 3: finalize the upload
api('/linkedin/rest/videos?action=finalizeUpload', 'POST', {
    'finalizeUploadRequest': {'video': video_urn, 'uploadToken': '', 'uploadedPartIds': [etag]}
})

# Step 4: create the post
print(api('/linkedin/rest/posts', 'POST', {
    'author': owner,
    'lifecycleState': 'PUBLISHED',
    'visibility': 'PUBLIC',
    'commentary': 'Check out this video!',
    'distribution': {'feedDistribution': 'MAIN_FEED'},
    'content': {'media': {'id': video_urn}},
}))
EOF
```

**How it works:**
- Steps 1, 3, 4 go through the gateway (`api.maton.ai/linkedin/...`) — Maton injects your OAuth token automatically.
- Step 2 goes **directly** to LinkedIn's pre-signed upload URL (`www.linkedin.com/dms-uploads/...`) — no auth header needed, no gateway.
- The `etag` from the upload response is required for the finalize step.
- For large videos (>4MB), LinkedIn returns multiple `uploadInstructions` — upload each chunk to its respective URL and collect all etags.

**Video specifications:**
- Length: 3 seconds to 30 minutes
- File size: 75KB to 500MB
- Format: MP4

##### Initialize Document Upload

```bash
maton api -X POST '/linkedin/rest/documents?action=initializeUpload' -H 'LinkedIn-Version: 202606' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "initializeUploadRequest": {
    "owner": "urn:li:person:{personId}"
  }
}
JSON
```

**Note:** `{personId}` is a placeholder. Replace it with a real value before sending the request.

**Response:**
```json
{
  "value": {
    "uploadUrlExpiresAt": 1770541530896,
    "uploadUrl": "https://www.linkedin.com/dms-uploads/...",
    "document": "urn:li:document:D4D10AQHr-e30QZCAjQ"
  }
}
```

### Ad Targeting API

#### Get Targeting Facets

```bash
maton api '/linkedin/rest/adTargetingFacets' \
  -H 'LinkedIn-Version: 202606'
```

Returns 31 targeting facets (skills, industries, titles, locations, etc.)

Returns all available targeting facets for ad campaigns (31 facets including employers, degrees, skills, locations, industries, etc.).

**Response:**

```json
{
  "elements": [
    {
      "facetName": "skills",
      "adTargetingFacetUrn": "urn:li:adTargetingFacet:skills",
      "entityTypes": ["SKILL"],
      "availableEntityFinders": ["AD_TARGETING_FACET", "TYPEAHEAD"]
    },
    {
      "facetName": "industries",
      "adTargetingFacetUrn": "urn:li:adTargetingFacet:industries"
    }
  ]
}
```

Available targeting facets include:
- `skills` - Member skills
- `industries` - Industry categories
- `titles` - Job titles
- `seniorities` - Seniority levels
- `degrees` - Educational degrees
- `schools` - Educational institutions
- `employers` / `employersPast` - Current/past employers
- `locations` / `geoLocations` - Geographic targeting
- `companySize` - Company size ranges
- `genders` - Gender targeting
- `ageRanges` - Age range targeting

### Little Text Format (Commentary Field)

The `commentary` field in posts uses LinkedIn's "Little Text Format". **Reserved characters must be escaped with a backslash or the post content will be truncated.**

### Reserved Characters (Must Escape)

| Character | Escape As |
|-----------|-----------|
| `\` | `\\` |
| `\|` | `\\|` |
| `{` | `\{` |
| `}` | `\}` |
| `@` | `\@` |
| `[` | `\[` |
| `]` | `\]` |
| `(` | `\(` |
| `)` | `\)` |
| `<` | `\<` |
| `>` | `\>` |
| `#` | `\#` |
| `*` | `\*` |
| `_` | `\_` |
| `~` | `\~` |

### Example

```json
{
  "commentary": "Hello\\! Check out these bullet points:\\n\\n\\* Point 1\\n\\* Point 2\\n\\* More info \\(details inside\\)"
}
```

### Mentions and Hashtags

- **Mention a person:** `@[Display Name](urn:li:person:123)`
- **Mention an organization:** `@[Company Name](urn:li:organization:456)`
- **Hashtag:** `{hashtag|\\#|MyTag}` or simply `#hashtag` for single words

### Campaign Status Values

| Status | Description |
|--------|-------------|
| `DRAFT` | Campaign is in draft mode |
| `ACTIVE` | Campaign is running |
| `PAUSED` | Campaign is paused |
| `ARCHIVED` | Campaign is archived |
| `COMPLETED` | Campaign has ended |
| `CANCELED` | Campaign was canceled |

### Campaign Objective Types

| Objective | Description |
|-----------|-------------|
| `BRAND_AWARENESS` | Increase brand visibility |
| `WEBSITE_VISITS` | Drive traffic to website |
| `ENGAGEMENT` | Increase post engagement |
| `VIDEO_VIEWS` | Maximize video views |
| `LEAD_GENERATION` | Collect leads via Lead Gen Forms |
| `WEBSITE_CONVERSIONS` | Drive website conversions |
| `JOB_APPLICANTS` | Attract job applications |

### OAuth Scopes

| Scope | Description |
|-------|-------------|
| `openid` | OpenID Connect authentication |
| `profile` | Read basic profile |
| `email` | Read email address |
| `w_member_social` | Create, modify, and delete posts |
| `r_organization_social` | Read organization posts and statistics |
| `w_organization_social` | Create and manage organization posts |
| `r_ads` | Read advertising account data |
| `rw_ads` | Create and manage ad campaigns, campaign groups, and accounts |

Note: Available scopes depend on your LinkedIn OAuth connection. Verify granted scopes at your [Maton connection settings](https://maton.ai/settings) before attempting advertising operations.

### Notes

- `LinkedIn-Version` (`YYYYMM`) selects the REST API version; Maton sends `202606` when it's left out. LinkedIn retires old monthly versions and returns HTTP 426 `NONEXISTENT_VERSION` for retired or future-dated ones, so use a recent month
- Author URN format: `urn:li:person:{personId}`
- Get person ID from `/rest/me` endpoint
- **Commentary uses Little Text Format** — escape reserved characters (`|{}@[]()<>#\*_~`) with backslash or content will be truncated
- Image uploads are 3-step: initialize, upload binary, create post
- Video uploads are 4-step: initialize, upload binary, finalize, create post
- **Media upload URLs point to `www.linkedin.com` (not `api.linkedin.com`).** They are pre-signed — do NOT send through the gateway, do NOT add an Authorization header. MUST use Python `urllib` (not shell `curl`) due to URL encoding issues.
- Rate limits: 150 requests/day per member, 100K/day per app

### Visibility Options

- `PUBLIC` - Viewable by anyone
- `CONNECTIONS` - 1st-degree connections only

### Share Media Categories

- `NONE` - Text only
- `ARTICLE` - URL share
- `IMAGE` - Image post
- `VIDEO` - Video post

### Resources

- [LinkedIn API Overview](https://learn.microsoft.com/en-us/linkedin/)
- [Share on LinkedIn](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin)
- [Profile API](https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api)
- [LinkedIn Marketing API](https://learn.microsoft.com/en-us/linkedin/marketing/)
- [Ad Accounts](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-accounts)
- [Campaigns](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaigns)
- [Maton CLI Manual](https://cli.maton.ai/manual)
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall