> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.trykeet.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.trykeet.com/_mcp/server.

# Send Message

POST https://api.trykeet.com/v1/linkedin/messages
Content-Type: application/json

Send a LinkedIn message

Reference: https://docs.trykeet.com/api-reference/api-reference/integrations/linkedin/send-message

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `X-Account-Token` (string, required) — The account token that is associated with the end user linked to this account

### Body (application/json)

This endpoint expects an object.

- `to` (string, required) — The profile name of the person to send the message to. For example for the account with the url "https://www.linkedin.com/in/zacharyashen/" the profile name would be "zacharyashen"
- `content` (string, required)

## Response

### 200

- `status` (enum, required)
  - Allowed values: `ok`, `error`

## Errors

### 401 Un Authorized Error

- `error` (string, required)

### 500 Internal Server Error

- `error` (string, required)

### 404 Not Found Error

- `error` (string, required)

### 400 Bad Request Error

- `error` (string, required)

### 500 Not Implemented Error

- `error` (string, required)

## Examples

**Request**

```json
{
  "to": "to",
  "content": "content"
}
```

**Response**

```json
{
  "status": "ok"
}
```

**SDK Code**

```typescript
import { KeetClient } from "@keet-tech/keet-node-client";

const client = new KeetClient({ token: "YOUR_TOKEN", accountToken: "YOUR_ACCOUNT_TOKEN" });
await client.integrations.linkedin.sendMessage({
    to: "string",
    content: "string"
});

```

```python
import requests

url = "https://api.trykeet.com/v1/linkedin/messages"

payload = {
    "to": "to",
    "content": "content"
}
headers = {
    "X-Account-Token": "X-Account-Token",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.trykeet.com/v1/linkedin/messages"

	payload := strings.NewReader("{\n  \"to\": \"to\",\n  \"content\": \"content\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Account-Token", "X-Account-Token")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.trykeet.com/v1/linkedin/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Account-Token"] = 'X-Account-Token'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"to\": \"to\",\n  \"content\": \"content\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.trykeet.com/v1/linkedin/messages")
  .header("X-Account-Token", "X-Account-Token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"to\": \"to\",\n  \"content\": \"content\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.trykeet.com/v1/linkedin/messages', [
  'body' => '{
  "to": "to",
  "content": "content"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Account-Token' => 'X-Account-Token',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.trykeet.com/v1/linkedin/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Account-Token", "X-Account-Token");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"to\": \"to\",\n  \"content\": \"content\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Account-Token": "X-Account-Token",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "to": "to",
  "content": "content"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trykeet.com/v1/linkedin/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```