@linqapp/sdk-mcp 0.70.1 β†’ 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,14 +60,14 @@ const EMBEDDED_METHODS = [
60
60
  response: "{ chat: { id: string; display_name: string; handles: object[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_group: boolean; message: object; service: 'iMessage' | 'SMS' | 'RCS'; }; }",
61
61
  markdown: "## create\n\n`client.chats.create(from: string, message: { effect?: message_effect; experience?: object; idempotency_key?: string; parts?: text_part | media_part | link_part | object | object[]; preferred_service?: service_type; reply_to?: reply_to; }, to: string[], override_optout?: boolean): { chat: object; }`\n\n**post** `/v3/chats`\n\nCreate a new chat with specified participants and send an initial message.\nThe initial message is required when creating a chat.\n\n## Message Effects\n\nYou can add iMessage effects to make your messages more expressive. Effects are\noptional and can be either screen effects (full-screen animations) or bubble effects\n(message bubble animations).\n\n**Screen Effects:** `confetti`, `fireworks`, `lasers`, `sparkles`, `celebration`,\n`hearts`, `love`, `balloons`, `happy_birthday`, `echo`, `spotlight`\n\n**Bubble Effects:** `slam`, `loud`, `gentle`, `invisible`\n\nOnly one effect type can be applied per message.\n\n## Inline Text Decorations (iMessage only)\n\nUse the `text_decorations` array on a text part to apply styling and animations to character ranges.\n\nEach decoration specifies a `range: [start, end)` and exactly one of `style` or `animation`.\n\n**Styles:** `bold`, `italic`, `strikethrough`, `underline`\n**Animations:** `big`, `small`, `shake`, `nod`, `explode`, `ripple`, `bloom`, `jitter`\n\n```json\n{\n \"type\": \"text\",\n \"value\": \"Hello world\",\n \"text_decorations\": [\n { \"range\": [0, 5], \"style\": \"bold\" },\n { \"range\": [6, 11], \"animation\": \"shake\" }\n ]\n}\n```\n\n**Note:** Style ranges (bold, italic, etc.) may overlap, but animation ranges must not overlap with other animations or styles. Decorations render per recipient, not per message:\nin a group with both iMessage and SMS/RCS participants, iMessage recipients see the decorations and SMS/RCS recipients receive the same message as plain text.\n\n## Inline Stickers (iMessage only)\n\nUse the `inline_stickers` array on a text part to place stickers inside the text. Each sticker\nreplaces the characters in its `range: [start, end)` and takes its image from exactly one of\n`url` or `attachment_id` β€” an image uploaded with `POST /v3/attachments`.\n\n```json\n{\n \"type\": \"text\",\n \"value\": \"Happy birthday πŸŽ‚! πŸŽ‰πŸŽ‰\",\n \"inline_stickers\": [\n { \"range\": [15, 17], \"attachment_id\": \"550e8400-e29b-41d4-a716-446655440000\" },\n { \"range\": [19, 21], \"attachment_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\" },\n { \"range\": [21, 23], \"attachment_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\" }\n ]\n}\n```\n\n**Note:** A sticker takes the place of the characters it covers, so they are hidden on\niMessage: `\"Sip cup\"` with a sticker on `cup` reads \"Sip [sticker]\". Those characters are what\nSMS and RCS recipients receive (the stickers are dropped and `value` is sent as written) and\nwhat VoiceOver reads. To keep a word visible, give the sticker its own placeholder:\n`\"Sip cup πŸ₯€\"` with the range on `πŸ₯€`. Up to 100 stickers and 10 different images per part;\ncopies of one image count as one.\n\n## First-Message Link Restriction\n\nTo protect sender deliverability, the **first outbound message** of a new chat cannot be a link.\nThe request is rejected with `400` (error code `1005`) when:\n\n- The message contains a `link` part (explicit rich-preview link), or\n- Any `text` part contains a URL.\n\nThis rule applies only to `POST /v3/chats`. Follow-up messages on an existing chat\n(`POST /v3/chats/{chatId}/messages`) are not subject to this restriction.\n\n## Reusing an Existing Chat\n\nChats are keyed on the `from` line plus the exact set of `to` handles. Repeating this\nrequest with the same `from` and `to` returns the **existing** chat and sends the message\ninto it instead of starting a second conversation.\n\nA group chat that has a `display_name` is excluded from that matching. To run several\nparallel groups over the same participants, name each one with `PUT /v3/chats/{chatId}`\nbefore creating the next: the following `POST /v3/chats` with the same `to` then returns a\nnew, separate `chat_id`. Two other cases also produce a new chat instead of reusing one β€”\nthe participant set changed (a participant was added or removed), or the `from` line left\nthe group.\n\nWhenever the response is a new chat, the first-message rules above apply to that request:\nno link in the first message, and no `reply_to` or message effect. To send into a chat you\nalready know, use `POST /v3/chats/{chatId}/messages` with its `chat_id`.\n\n\n### Parameters\n\n- `from: string`\n Sender phone number in E.164 format. Must be a phone number that the\nauthenticated partner has permission to send from.\n\n\n- `message: { effect?: { name?: string; type?: 'screen' | 'bubble'; }; experience?: { action: string; name: string; params?: object; }; idempotency_key?: string; parts?: { type: 'text'; value: string; inline_stickers?: inline_sticker[]; mention?: string; mention_range?: number[]; text_decorations?: text_decoration[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; }`\n Message content container. Groups all message-related fields together,\nseparating the \"what\" (message content) from the \"where\" (routing fields like from/to).\n\nA message carries EITHER `parts` β€” text and attachments, which compose\ninto one bubble β€” or a single `experience` invocation, which renders an\nexperience inside Linq's iMessage app. Never both: an app card is the whole message\n(Apple's `MSMessage` cannot coexist with text), so copy and a card are\ntwo sends, not one.\n\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n iMessage effect to apply to this message (screen or bubble effect)\n - `experience?: { action: string; name: string; params?: object; }`\n Invokes an action on an experience β€” a third party that renders inside\nLinq's iMessage app. Linq resolves the recipient's connection, mints any\nsession the action needs, composes the card and sends it; none of that\nis visible to you.\n\nCall `GET /v3/experiences/{experience}` for the actions you may invoke\nand the fields each accepts.\n\n - `idempotency_key?: string`\n Optional idempotency key for this message.\nUse this to prevent duplicate sends of the same message. Reusing a key\nwhose message was deleted β€” or was an ephemeral message that has since\nexpired β€” returns 404; the message is never resent.\n\n - `parts?: { type: 'text'; value: string; inline_stickers?: { range: number[]; attachment_id?: string; url?: string; }[]; mention?: string; mention_range?: number[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]`\n Array of message parts. Each part can be text, media, or link.\nParts are displayed in order. Text and media can be mixed freely,\nbut a `link` part must be the only part in the message.\n\n**Rich Link Previews:**\n- Use a `link` part to send a URL with a rich preview card\n- A `link` part must be the **only** part in the message\n- To send a URL as plain text (no preview), use a `text` part instead\n\n**App Clip Payment Cards:**\n- Use an `app_clip` part to send a Linq checkout link as an Apple Pay\n App Clip card (the payment preview with the Open button)\n- An `app_clip` part must be the **only** part in the message\n- iMessage-only: unlike `link`, it never downgrades to SMS/RCS β€” the\n send fails instead of delivering a bare URL\n\n**Supported Media:**\n- Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp\n- Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp\n- Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr\n- Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pages, .numbers, .key, .epub, .zip, .html, .htm\n- Contact & Calendar: .vcf, .ics\n\n**Audio:**\n- Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as media parts\n- To send audio as an **iMessage voice memo bubble** (inline playback UI), use the dedicated\n `/v3/chats/{chatId}/voicememo` endpoint instead\n\n**Validation Rules:**\n- A `link` part must be the **only** part in the message. It cannot be combined\n with text or media parts.\n- An `app_clip` part must be the **only** part in the message. Its `value`\n must be a Linq checkout link (e.g. from `POST /v3/payment_requests`);\n any other URL is rejected.\n- Consecutive text parts are not allowed. Text parts must be separated by\n media parts. For example, [text, text] is invalid, but [text, media, text] is valid.\n- Maximum of **100 parts** total.\n- Media parts using a public `url` (downloaded by the server on send) are\n capped at **40**. Parts using `attachment_id` or presigned URLs\n are exempt from this sub-limit. For bulk media sends exceeding 40 files,\n pre-upload via `POST /v3/attachments` and reference by `attachment_id` or `download_url`.\n\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n Messaging service type. Where this names the transport a message used,\nit is per-message: a chat's own `service` can differ from a message in\nit, and Apple can downgrade an individual message.\n\n - `reply_to?: { message_id: string; part_index?: number; }`\n Reply to another message to create a threaded conversation\n\n- `to: string[]`\n Array of recipient handles (phone numbers in E.164 format or email addresses).\nFor individual chats, provide one recipient. For group chats, provide multiple.\n\n\n- `override_optout?: boolean`\n Send even though the recipient asked you to stop (`403`, error code\n`2024`). Applies to this request only: the opt-out stays in place, so\nthe next send without this flag is rejected again. Every override is\nrecorded against your API key.\n\n\n### Returns\n\n- `{ chat: { id: string; display_name: string; handles: object[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_group: boolean; message: object; service: 'iMessage' | 'SMS' | 'RCS'; }; }`\n Response for creating a new chat with an initial message\n\n - `chat: { id: string; display_name: string; handles: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_group: boolean; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: object | object | object | { app: object; layout: object; reactions: reaction[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: reaction[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; sent_at: string; delivered_at?: string; effect?: object; from_handle?: object; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: object; service?: 'iMessage' | 'SMS' | 'RCS'; }; service: 'iMessage' | 'SMS' | 'RCS'; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst chat = await client.chats.create({\n from: '+12052535597',\n message: {},\n to: ['+12052532136'],\n});\n\nconsole.log(chat);\n```",
62
62
  perLanguage: {
63
- python: {
64
- method: 'chats.create',
65
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.create(\n from_="+12052535597",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello! How can I help you today?",\n }]\n },\n to=["+12052532136"],\n)\nprint(chat.chat)',
66
- },
67
63
  go: {
68
64
  method: 'client.Chats.New',
69
65
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tchat, err := client.Chats.New(context.TODO(), linqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{\n\t\t\tParts: []linqgo.MessageContentPartUnionParam{{\n\t\t\t\tOfText: &linqgo.TextPartParam{\n\t\t\t\t\tType: linqgo.TextPartTypeText,\n\t\t\t\t\tValue: "Hello! How can I help you today?",\n\t\t\t\t},\n\t\t\t}},\n\t\t},\n\t\tTo: []string{"+12052532136"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.Chat)\n}\n',
70
66
  },
67
+ python: {
68
+ method: 'chats.create',
69
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.create(\n from_="+12052535597",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello! How can I help you today?",\n }]\n },\n to=["+12052532136"],\n)\nprint(chat.chat)',
70
+ },
71
71
  typescript: {
72
72
  method: 'client.chats.create',
73
73
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst chat = await client.chats.create({\n from: '+12052535597',\n message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },\n to: ['+12052532136'],\n});\n\nconsole.log(chat.chat);",
@@ -89,14 +89,14 @@ const EMBEDDED_METHODS = [
89
89
  response: "{ id: string; created_at: string; display_name: string; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
90
90
  markdown: "## list_chats\n\n`client.chats.listChats(cursor?: string, from?: string, limit?: number, to?: string): { id: string; created_at: string; display_name: string; handles: chat_handle[]; health_status: object; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: service_type; }`\n\n**get** `/v3/chats`\n\nRetrieves a paginated list of chats for the authenticated partner.\n\n**Filtering:**\n- If `from` is provided, returns chats for that specific phone number\n- If `from` is omitted, returns chats across all phone numbers owned by the partner\n- If `to` is provided, only returns chats where the specified handle is a participant\n\n**Pagination:**\n- Use `limit` to control page size (default: 20, max: 100)\n- The response includes `next_cursor` for fetching the next page\n- When `next_cursor` is `null`, there are no more results to fetch\n- Pass the `next_cursor` value as the `cursor` parameter for the next request\n\n**Example pagination flow:**\n1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`\n2. Response includes `next_cursor: \"20\"` (more results exist)\n3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`\n4. Response includes `next_cursor: null` (no more results)\n\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor from the previous response's `next_cursor` field.\nOmit this parameter for the first page of results.\n\n\n- `from?: string`\n Phone number to filter chats by. Returns chats made from this phone number.\nMust be in E.164 format (e.g., `+13343284472`). The `+` is automatically URL-encoded by HTTP clients.\nIf omitted, returns chats across all phone numbers owned by the partner.\n\n\n- `limit?: number`\n Maximum number of chats to return per page\n\n- `to?: string`\n Filter chats by a participant handle. Only returns chats where this handle is a participant.\nCan be an E.164 phone number (e.g., `+13343284472`) or an email address (e.g., `user@example.com`).\nFor phone numbers, the `+` is automatically URL-encoded by HTTP clients.\n\n\n### Returns\n\n- `{ id: string; created_at: string; display_name: string; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `created_at: string`\n - `display_name: string`\n - `handles: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]`\n - `health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }`\n - `is_archived: boolean`\n - `is_group: boolean`\n - `updated_at: string`\n - `group_chat_icon?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.listChats()) {\n console.log(chat);\n}\n```",
91
91
  perLanguage: {
92
- python: {
93
- method: 'chats.list_chats',
94
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.chats.list_chats()\npage = page.chats[0]\nprint(page.id)',
95
- },
96
92
  go: {
97
93
  method: 'client.Chats.ListChats',
98
94
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Chats.ListChats(context.TODO(), linqgo.ChatListChatsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
99
95
  },
96
+ python: {
97
+ method: 'chats.list_chats',
98
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.chats.list_chats()\npage = page.chats[0]\nprint(page.id)',
99
+ },
100
100
  typescript: {
101
101
  method: 'client.chats.listChats',
102
102
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.listChats()) {\n console.log(chat.id);\n}",
@@ -118,14 +118,14 @@ const EMBEDDED_METHODS = [
118
118
  response: "{ id: string; created_at: string; display_name: string; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
119
119
  markdown: "## retrieve\n\n`client.chats.retrieve(chatId: string): { id: string; created_at: string; display_name: string; handles: chat_handle[]; health_status: object; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: service_type; }`\n\n**get** `/v3/chats/{chatId}`\n\nRetrieve a chat by its unique identifier.\n\n### Parameters\n\n- `chatId: string`\n\n### Returns\n\n- `{ id: string; created_at: string; display_name: string; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }; is_archived: boolean; is_group: boolean; updated_at: string; group_chat_icon?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `created_at: string`\n - `display_name: string`\n - `handles: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]`\n - `health_status: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT'; updated_at: string; }`\n - `is_archived: boolean`\n - `is_group: boolean`\n - `updated_at: string`\n - `group_chat_icon?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst chat = await client.chats.retrieve('550e8400-e29b-41d4-a716-446655440000');\n\nconsole.log(chat);\n```",
120
120
  perLanguage: {
121
- python: {
122
- method: 'chats.retrieve',
123
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.retrieve(\n "550e8400-e29b-41d4-a716-446655440000",\n)\nprint(chat.id)',
124
- },
125
121
  go: {
126
122
  method: 'client.Chats.Get',
127
123
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tchat, err := client.Chats.Get(context.TODO(), "550e8400-e29b-41d4-a716-446655440000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ID)\n}\n',
128
124
  },
125
+ python: {
126
+ method: 'chats.retrieve',
127
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.retrieve(\n "550e8400-e29b-41d4-a716-446655440000",\n)\nprint(chat.id)',
128
+ },
129
129
  typescript: {
130
130
  method: 'client.chats.retrieve',
131
131
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst chat = await client.chats.retrieve('550e8400-e29b-41d4-a716-446655440000');\n\nconsole.log(chat.id);",
@@ -147,14 +147,14 @@ const EMBEDDED_METHODS = [
147
147
  response: '{ chat_id?: string; status?: string; }',
148
148
  markdown: "## update\n\n`client.chats.update(chatId: string, display_name?: string, group_chat_icon?: string): { chat_id?: string; status?: string; }`\n\n**put** `/v3/chats/{chatId}`\n\nUpdate chat properties such as display name and group chat icon.\n\nListen for `chat.group_name_updated`, `chat.group_icon_updated`,\n`chat.group_name_update_failed`, or `chat.group_icon_update_failed`\nwebhook events to confirm the outcome.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `display_name?: string`\n New display name for the chat (group chats only)\n\n- `group_chat_icon?: string`\n URL of an image to set as the group chat icon (group chats only)\n\n### Returns\n\n- `{ chat_id?: string; status?: string; }`\n\n - `chat_id?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst chat = await client.chats.update('550e8400-e29b-41d4-a716-446655440000');\n\nconsole.log(chat);\n```",
149
149
  perLanguage: {
150
- python: {
151
- method: 'chats.update',
152
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.update(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n display_name="Team Discussion",\n)\nprint(chat.chat_id)',
153
- },
154
150
  go: {
155
151
  method: 'client.Chats.Update',
156
152
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tchat, err := client.Chats.Update(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatUpdateParams{\n\t\t\tDisplayName: linqgo.String("Team Discussion"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ChatID)\n}\n',
157
153
  },
154
+ python: {
155
+ method: 'chats.update',
156
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nchat = client.chats.update(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n display_name="Team Discussion",\n)\nprint(chat.chat_id)',
157
+ },
158
158
  typescript: {
159
159
  method: 'client.chats.update',
160
160
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst chat = await client.chats.update('550e8400-e29b-41d4-a716-446655440000', {\n display_name: 'Team Discussion',\n});\n\nconsole.log(chat.chat_id);",
@@ -175,14 +175,14 @@ const EMBEDDED_METHODS = [
175
175
  params: ['chatId: string;'],
176
176
  markdown: "## mark_as_read\n\n`client.chats.markAsRead(chatId: string): void`\n\n**post** `/v3/chats/{chatId}/read`\n\nMark all messages in a chat as read.\n\n\n### Parameters\n\n- `chatId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.markAsRead('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```",
177
177
  perLanguage: {
178
- python: {
179
- method: 'chats.mark_as_read',
180
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.mark_as_read(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)',
181
- },
182
178
  go: {
183
179
  method: 'client.Chats.MarkAsRead',
184
180
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.MarkAsRead(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
185
181
  },
182
+ python: {
183
+ method: 'chats.mark_as_read',
184
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.mark_as_read(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)',
185
+ },
186
186
  typescript: {
187
187
  method: 'client.chats.markAsRead',
188
188
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.markAsRead('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');",
@@ -204,14 +204,14 @@ const EMBEDDED_METHODS = [
204
204
  response: '{ message?: string; status?: string; trace_id?: string; }',
205
205
  markdown: "## leave_chat\n\n`client.chats.leaveChat(chatId: string): { message?: string; status?: string; trace_id?: string; }`\n\n**post** `/v3/chats/{chatId}/leave`\n\nRemoves your phone number from a group chat. Once you leave, you will no longer receive messages from the group and all interaction endpoints (send message, typing, mark read, etc.) will return 409.\n\nA `participant.removed` webhook will fire once the leave has been processed.\n\n**Supported**\n- iMessage group chats with 4 or more active participants (including yourself)\n\n**Not supported**\n- DM (1-on-1) chats β€” use the chat directly to continue the conversation\n\n\n### Parameters\n\n- `chatId: string`\n\n### Returns\n\n- `{ message?: string; status?: string; trace_id?: string; }`\n\n - `message?: string`\n - `status?: string`\n - `trace_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.chats.leaveChat('550e8400-e29b-41d4-a716-446655440000');\n\nconsole.log(response);\n```",
206
206
  perLanguage: {
207
- python: {
208
- method: 'chats.leave_chat',
209
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.leave_chat(\n "550e8400-e29b-41d4-a716-446655440000",\n)\nprint(response.trace_id)',
210
- },
211
207
  go: {
212
208
  method: 'client.Chats.LeaveChat',
213
209
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Chats.LeaveChat(context.TODO(), "550e8400-e29b-41d4-a716-446655440000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TraceID)\n}\n',
214
210
  },
211
+ python: {
212
+ method: 'chats.leave_chat',
213
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.leave_chat(\n "550e8400-e29b-41d4-a716-446655440000",\n)\nprint(response.trace_id)',
214
+ },
215
215
  typescript: {
216
216
  method: 'client.chats.leaveChat',
217
217
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.chats.leaveChat('550e8400-e29b-41d4-a716-446655440000');\n\nconsole.log(response.trace_id);",
@@ -232,14 +232,14 @@ const EMBEDDED_METHODS = [
232
232
  params: ['chatId: string;'],
233
233
  markdown: "## share_contact_card\n\n`client.chats.shareContactCard(chatId: string): void`\n\n**post** `/v3/chats/{chatId}/share_contact_card`\n\nShare your contact information (Name and Photo Sharing) with a chat.\n\n**Note:** A contact card must be configured before sharing. You can set up your contact card via the [Contact Card API](#tag/Contact-Card) or on the [Linq dashboard](https://dashboard.linqapp.com/contact-cards).\n\n\n### Parameters\n\n- `chatId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.shareContactCard('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```",
234
234
  perLanguage: {
235
- python: {
236
- method: 'chats.share_contact_card',
237
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.share_contact_card(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)',
238
- },
239
235
  go: {
240
236
  method: 'client.Chats.ShareContactCard',
241
237
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.ShareContactCard(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
242
238
  },
239
+ python: {
240
+ method: 'chats.share_contact_card',
241
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.share_contact_card(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)',
242
+ },
243
243
  typescript: {
244
244
  method: 'client.chats.shareContactCard',
245
245
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.shareContactCard('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');",
@@ -266,14 +266,14 @@ const EMBEDDED_METHODS = [
266
266
  response: "{ voice_memo: { id: string; chat: { id: string; handles: chat_handle[]; is_active: boolean; is_group: boolean; service: service_type; }; created_at: string; from: string; status: string; to: string[]; voice_memo: { id: string; filename: string; mime_type: string; size_bytes: number; url: string; duration_ms?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }; }",
267
267
  markdown: "## send_voicememo\n\n`client.chats.sendVoicememo(chatId: string, attachment_id?: string, override_optout?: boolean, voice_memo_url?: string): { voice_memo: object; }`\n\n**post** `/v3/chats/{chatId}/voicememo`\n\nSend an audio file as an **iMessage voice memo bubble** to all participants in a chat.\nVoice memos appear with iMessage's native inline playback UI, unlike regular audio\nattachments sent via media parts which appear as downloadable files.\n\n**Supported audio formats:**\n- MP3 (audio/mpeg)\n- M4A (audio/x-m4a, audio/mp4)\n- AAC (audio/aac)\n- CAF (audio/x-caf) - Core Audio Format\n- WAV (audio/wav)\n- AIFF (audio/aiff, audio/x-aiff)\n- AMR (audio/amr)\n\n\n### Parameters\n\n- `chatId: string`\n\n- `attachment_id?: string`\n Reference to a voice memo file pre-uploaded via `POST /v3/attachments`.\nThe file is already stored, so sends using this ID skip the download step.\n\nEither `voice_memo_url` or `attachment_id` must be provided, but not both.\n\n\n- `override_optout?: boolean`\n Send even though the recipient asked you to stop (`403`, error code\n`2024`). Applies to this request only: the opt-out stays in place, so\nthe next send without this flag is rejected again. Every override is\nrecorded against your API key.\n\n\n- `voice_memo_url?: string`\n URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.\n\nEither `voice_memo_url` or `attachment_id` must be provided, but not both.\n\n\n### Returns\n\n- `{ voice_memo: { id: string; chat: { id: string; handles: chat_handle[]; is_active: boolean; is_group: boolean; service: service_type; }; created_at: string; from: string; status: string; to: string[]; voice_memo: { id: string; filename: string; mime_type: string; size_bytes: number; url: string; duration_ms?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }; }`\n Response for sending a voice memo to a chat\n\n - `voice_memo: { id: string; chat: { id: string; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; is_active: boolean; is_group: boolean; service: 'iMessage' | 'SMS' | 'RCS'; }; created_at: string; from: string; status: string; to: string[]; voice_memo: { id: string; filename: string; mime_type: string; size_bytes: number; url: string; duration_ms?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.chats.sendVoicememo('f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd');\n\nconsole.log(response);\n```",
268
268
  perLanguage: {
269
- python: {
270
- method: 'chats.send_voicememo',
271
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.send_voicememo(\n chat_id="f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",\n voice_memo_url="https://example.com/voice-memo.m4a",\n)\nprint(response.voice_memo)',
272
- },
273
269
  go: {
274
270
  method: 'client.Chats.SendVoicememo',
275
271
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Chats.SendVoicememo(\n\t\tcontext.TODO(),\n\t\t"f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",\n\t\tlinqgo.ChatSendVoicememoParams{\n\t\t\tVoiceMemoURL: linqgo.String("https://example.com/voice-memo.m4a"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.VoiceMemo)\n}\n',
276
272
  },
273
+ python: {
274
+ method: 'chats.send_voicememo',
275
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.send_voicememo(\n chat_id="f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",\n voice_memo_url="https://example.com/voice-memo.m4a",\n)\nprint(response.voice_memo)',
276
+ },
277
277
  typescript: {
278
278
  method: 'client.chats.sendVoicememo',
279
279
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.chats.sendVoicememo('f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd', {\n voice_memo_url: 'https://example.com/voice-memo.m4a',\n});\n\nconsole.log(response.voice_memo);",
@@ -295,14 +295,14 @@ const EMBEDDED_METHODS = [
295
295
  response: '{ message?: string; status?: string; trace_id?: string; }',
296
296
  markdown: "## add\n\n`client.chats.participants.add(chatId: string, handle: string): { message?: string; status?: string; trace_id?: string; }`\n\n**post** `/v3/chats/{chatId}/participants`\n\nAdd a new participant to an existing group chat.\n\n**Requirements:**\n- Group chats only (3+ existing participants)\n- New participant must support the same messaging service as the group\n- Cross-service additions not allowed (e.g., can't add RCS-only user to iMessage group)\n- For cross-service scenarios, create a new chat instead\n\n\n### Parameters\n\n- `chatId: string`\n\n- `handle: string`\n Phone number (E.164 format) or email address of the participant to add\n\n### Returns\n\n- `{ message?: string; status?: string; trace_id?: string; }`\n\n - `message?: string`\n - `status?: string`\n - `trace_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.chats.participants.add('550e8400-e29b-41d4-a716-446655440000', { handle: '+12052499136' });\n\nconsole.log(response);\n```",
297
297
  perLanguage: {
298
- python: {
299
- method: 'chats.participants.add',
300
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.participants.add(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n handle="+12052499136",\n)\nprint(response.trace_id)',
301
- },
302
298
  go: {
303
299
  method: 'client.Chats.Participants.Add',
304
300
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Chats.Participants.Add(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatParticipantAddParams{\n\t\t\tHandle: "+12052499136",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TraceID)\n}\n',
305
301
  },
302
+ python: {
303
+ method: 'chats.participants.add',
304
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.participants.add(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n handle="+12052499136",\n)\nprint(response.trace_id)',
305
+ },
306
306
  typescript: {
307
307
  method: 'client.chats.participants.add',
308
308
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.chats.participants.add('550e8400-e29b-41d4-a716-446655440000', {\n handle: '+12052499136',\n});\n\nconsole.log(response.trace_id);",
@@ -324,14 +324,14 @@ const EMBEDDED_METHODS = [
324
324
  response: '{ message?: string; status?: string; trace_id?: string; }',
325
325
  markdown: "## remove\n\n`client.chats.participants.remove(chatId: string, handle: string): { message?: string; status?: string; trace_id?: string; }`\n\n**delete** `/v3/chats/{chatId}/participants`\n\nRemove a participant from an existing group chat.\n\n**Requirements:**\n- Group chats only\n- Must have 3+ participants after removal\n\n\n### Parameters\n\n- `chatId: string`\n\n- `handle: string`\n Phone number (E.164 format) or email address of the participant to remove\n\n### Returns\n\n- `{ message?: string; status?: string; trace_id?: string; }`\n\n - `message?: string`\n - `status?: string`\n - `trace_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst participant = await client.chats.participants.remove('550e8400-e29b-41d4-a716-446655440000', { handle: '+12052499136' });\n\nconsole.log(participant);\n```",
326
326
  perLanguage: {
327
- python: {
328
- method: 'chats.participants.remove',
329
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nparticipant = client.chats.participants.remove(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n handle="+12052499136",\n)\nprint(participant.trace_id)',
330
- },
331
327
  go: {
332
328
  method: 'client.Chats.Participants.Remove',
333
329
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tparticipant, err := client.Chats.Participants.Remove(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatParticipantRemoveParams{\n\t\t\tHandle: "+12052499136",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", participant.TraceID)\n}\n',
334
330
  },
331
+ python: {
332
+ method: 'chats.participants.remove',
333
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nparticipant = client.chats.participants.remove(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n handle="+12052499136",\n)\nprint(participant.trace_id)',
334
+ },
335
335
  typescript: {
336
336
  method: 'client.chats.participants.remove',
337
337
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst participant = await client.chats.participants.remove('550e8400-e29b-41d4-a716-446655440000', {\n handle: '+12052499136',\n});\n\nconsole.log(participant.trace_id);",
@@ -352,14 +352,14 @@ const EMBEDDED_METHODS = [
352
352
  params: ['chatId: string;'],
353
353
  markdown: "## start\n\n`client.chats.typing.start(chatId: string): void`\n\n**post** `/v3/chats/{chatId}/typing`\n\nSend a typing indicator to show that someone is typing in the chat.\n\n## Behavior\n\nTyping indicators are best-effort signals that behave as follows:\n\n- **iMessage chats only:** Typing indicators are only supported for iMessage chats.\n Requests for RCS or SMS chats are accepted (`204`) but no indicator is delivered.\n\n- **Send a message first for reliable delivery:** Typing indicators are best-effort.\n If you have not sent a message in this chat recently (roughly the **last 5 minutes**),\n a typing indicator may not reach the recipient β€” the request is still accepted (`204`),\n but delivery is not deterministic. Once you have sent a message in the chat, typing\n indicators reliably reach the recipient.\n\n- **No delivery guarantee:** Even for active chats, a `204` response only indicates\n the request was accepted for processing.\n\n- **Direct and group chats:** Typing indicators work in both direct and group chats.\n\n## Duration & keeping it visible\n\n- A single call shows the indicator for about **85–90 seconds**, then it clears\n automatically.\n\n- To keep it visible longer, call this endpoint again every **60 seconds**. Each call\n refreshes the indicator so it stays visible continuously.\n\n- Sending a message clears the indicator.\n\n- To resume typing after sending a message, call this endpoint again.\n\n- Incoming messages do not affect the indicator.\n\n## Recipient re-opening the chat\n\nIf the recipient brings their messaging app to the foreground while the chat has an\nunread message, their device clears any showing typing indicator. Calling this endpoint\nagain on its own may not bring it back. To make it reappear, either send a message, or\ncall `DELETE /v3/chats/{chatId}/typing` (stop) and then call start typing again.\n\n## Recommended usage\n\nCall this endpoint when composing begins, call it again every 60 seconds while\ncomposing, and send the message to clear the indicator. To clear the indicator without\nsending a message, call `DELETE /v3/chats/{chatId}/typing`.\n\n\n### Parameters\n\n- `chatId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.typing.start('550e8400-e29b-41d4-a716-446655440000')\n```",
354
354
  perLanguage: {
355
- python: {
356
- method: 'chats.typing.start',
357
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.typing.start(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
358
- },
359
355
  go: {
360
356
  method: 'client.Chats.Typing.Start',
361
357
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.Typing.Start(context.TODO(), "550e8400-e29b-41d4-a716-446655440000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
362
358
  },
359
+ python: {
360
+ method: 'chats.typing.start',
361
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.typing.start(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
362
+ },
363
363
  typescript: {
364
364
  method: 'client.chats.typing.start',
365
365
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.typing.start('550e8400-e29b-41d4-a716-446655440000');",
@@ -380,14 +380,14 @@ const EMBEDDED_METHODS = [
380
380
  params: ['chatId: string;'],
381
381
  markdown: "## stop\n\n`client.chats.typing.stop(chatId: string): void`\n\n**delete** `/v3/chats/{chatId}/typing`\n\nImmediately clears the typing indicator for the chat, without sending a message.\n\nThe typing indicator also clears automatically when you send a message, or about\n85–90 seconds after the last `POST /v3/chats/{chatId}/typing` (start typing) request.\n\nSee the start typing endpoint (`POST /v3/chats/{chatId}/typing`) above for behavior\ndetails.\n\n**Note:** Works in both direct and group chats.\n\n\n### Parameters\n\n- `chatId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.typing.stop('550e8400-e29b-41d4-a716-446655440000')\n```",
382
382
  perLanguage: {
383
- python: {
384
- method: 'chats.typing.stop',
385
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.typing.stop(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
386
- },
387
383
  go: {
388
384
  method: 'client.Chats.Typing.Stop',
389
385
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.Typing.Stop(context.TODO(), "550e8400-e29b-41d4-a716-446655440000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
390
386
  },
387
+ python: {
388
+ method: 'chats.typing.stop',
389
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.typing.stop(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
390
+ },
391
391
  typescript: {
392
392
  method: 'client.chats.typing.stop',
393
393
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.typing.stop('550e8400-e29b-41d4-a716-446655440000');",
@@ -413,14 +413,14 @@ const EMBEDDED_METHODS = [
413
413
  response: "{ chat_id: string; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; }",
414
414
  markdown: "## send\n\n`client.chats.messages.send(chatId: string, message: { effect?: message_effect; experience?: object; idempotency_key?: string; parts?: text_part | media_part | link_part | object | object[]; preferred_service?: service_type; reply_to?: reply_to; }, override_optout?: boolean): { chat_id: string; message: sent_message; }`\n\n**post** `/v3/chats/{chatId}/messages`\n\nSend a message to an existing chat. Use this endpoint when you already have\na chat ID and want to send additional messages to it.\n\n## Message Effects\n\nYou can add iMessage effects to make your messages more expressive. Effects are\noptional and can be either screen effects (full-screen animations) or bubble effects\n(message bubble animations).\n\n**Screen Effects:** `confetti`, `fireworks`, `lasers`, `sparkles`, `celebration`,\n`hearts`, `love`, `balloons`, `happy_birthday`, `echo`, `spotlight`\n\n**Bubble Effects:** `slam`, `loud`, `gentle`, `invisible`\n\nOnly one effect type can be applied per message.\n\n## Inline Text Decorations (iMessage only)\n\nUse the `text_decorations` array on a text part to apply styling and animations to character ranges.\n\nEach decoration specifies a `range: [start, end)` and exactly one of `style` or `animation`.\n\n**Styles:** `bold`, `italic`, `strikethrough`, `underline`\n**Animations:** `big`, `small`, `shake`, `nod`, `explode`, `ripple`, `bloom`, `jitter`\n\n```json\n{\n \"type\": \"text\",\n \"value\": \"Hello world\",\n \"text_decorations\": [\n { \"range\": [0, 5], \"style\": \"bold\" },\n { \"range\": [6, 11], \"animation\": \"shake\" }\n ]\n}\n```\n\n**Note:** Style ranges (bold, italic, etc.) may overlap, but animation ranges must not overlap with other animations or styles. Decorations render per recipient, not per message:\nin a group with both iMessage and SMS/RCS participants, iMessage recipients see the decorations and SMS/RCS recipients receive the same message as plain text.\n\n## Inline Stickers (iMessage only)\n\nUse the `inline_stickers` array on a text part to place stickers inside the text. Each sticker\nreplaces the characters in its `range: [start, end)` and takes its image from exactly one of\n`url` or `attachment_id` β€” an image uploaded with `POST /v3/attachments`.\n\n```json\n{\n \"type\": \"text\",\n \"value\": \"Happy birthday πŸŽ‚! πŸŽ‰πŸŽ‰\",\n \"inline_stickers\": [\n { \"range\": [15, 17], \"attachment_id\": \"550e8400-e29b-41d4-a716-446655440000\" },\n { \"range\": [19, 21], \"attachment_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\" },\n { \"range\": [21, 23], \"attachment_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\" }\n ]\n}\n```\n\n**Note:** A sticker takes the place of the characters it covers, so they are hidden on\niMessage: `\"Sip cup\"` with a sticker on `cup` reads \"Sip [sticker]\". Those characters are what\nSMS and RCS recipients receive (the stickers are dropped and `value` is sent as written) and\nwhat VoiceOver reads. To keep a word visible, give the sticker its own placeholder:\n`\"Sip cup πŸ₯€\"` with the range on `πŸ₯€`. Up to 100 stickers and 10 different images per part;\ncopies of one image count as one.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `message: { effect?: { name?: string; type?: 'screen' | 'bubble'; }; experience?: { action: string; name: string; params?: object; }; idempotency_key?: string; parts?: { type: 'text'; value: string; inline_stickers?: inline_sticker[]; mention?: string; mention_range?: number[]; text_decorations?: text_decoration[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; }`\n Message content container. Groups all message-related fields together,\nseparating the \"what\" (message content) from the \"where\" (routing fields like from/to).\n\nA message carries EITHER `parts` β€” text and attachments, which compose\ninto one bubble β€” or a single `experience` invocation, which renders an\nexperience inside Linq's iMessage app. Never both: an app card is the whole message\n(Apple's `MSMessage` cannot coexist with text), so copy and a card are\ntwo sends, not one.\n\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n iMessage effect to apply to this message (screen or bubble effect)\n - `experience?: { action: string; name: string; params?: object; }`\n Invokes an action on an experience β€” a third party that renders inside\nLinq's iMessage app. Linq resolves the recipient's connection, mints any\nsession the action needs, composes the card and sends it; none of that\nis visible to you.\n\nCall `GET /v3/experiences/{experience}` for the actions you may invoke\nand the fields each accepts.\n\n - `idempotency_key?: string`\n Optional idempotency key for this message.\nUse this to prevent duplicate sends of the same message. Reusing a key\nwhose message was deleted β€” or was an ephemeral message that has since\nexpired β€” returns 404; the message is never resent.\n\n - `parts?: { type: 'text'; value: string; inline_stickers?: { range: number[]; attachment_id?: string; url?: string; }[]; mention?: string; mention_range?: number[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]`\n Array of message parts. Each part can be text, media, or link.\nParts are displayed in order. Text and media can be mixed freely,\nbut a `link` part must be the only part in the message.\n\n**Rich Link Previews:**\n- Use a `link` part to send a URL with a rich preview card\n- A `link` part must be the **only** part in the message\n- To send a URL as plain text (no preview), use a `text` part instead\n\n**App Clip Payment Cards:**\n- Use an `app_clip` part to send a Linq checkout link as an Apple Pay\n App Clip card (the payment preview with the Open button)\n- An `app_clip` part must be the **only** part in the message\n- iMessage-only: unlike `link`, it never downgrades to SMS/RCS β€” the\n send fails instead of delivering a bare URL\n\n**Supported Media:**\n- Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp\n- Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp\n- Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr\n- Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pages, .numbers, .key, .epub, .zip, .html, .htm\n- Contact & Calendar: .vcf, .ics\n\n**Audio:**\n- Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as media parts\n- To send audio as an **iMessage voice memo bubble** (inline playback UI), use the dedicated\n `/v3/chats/{chatId}/voicememo` endpoint instead\n\n**Validation Rules:**\n- A `link` part must be the **only** part in the message. It cannot be combined\n with text or media parts.\n- An `app_clip` part must be the **only** part in the message. Its `value`\n must be a Linq checkout link (e.g. from `POST /v3/payment_requests`);\n any other URL is rejected.\n- Consecutive text parts are not allowed. Text parts must be separated by\n media parts. For example, [text, text] is invalid, but [text, media, text] is valid.\n- Maximum of **100 parts** total.\n- Media parts using a public `url` (downloaded by the server on send) are\n capped at **40**. Parts using `attachment_id` or presigned URLs\n are exempt from this sub-limit. For bulk media sends exceeding 40 files,\n pre-upload via `POST /v3/attachments` and reference by `attachment_id` or `download_url`.\n\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n Messaging service type. Where this names the transport a message used,\nit is per-message: a chat's own `service` can differ from a message in\nit, and Apple can downgrade an individual message.\n\n - `reply_to?: { message_id: string; part_index?: number; }`\n Reply to another message to create a threaded conversation\n\n- `override_optout?: boolean`\n Send even though the recipient asked you to stop (`403`, error code\n`2024`). Applies to this request only: the opt-out stays in place, so\nthe next send without this flag is rejected again. Every override is\nrecorded against your API key.\n\n\n### Returns\n\n- `{ chat_id: string; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; }`\n Response for sending a message to a chat\n\n - `chat_id: string`\n - `message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; sent_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.chats.messages.send('550e8400-e29b-41d4-a716-446655440000', { message: {} });\n\nconsole.log(response);\n```",
415
415
  perLanguage: {
416
- python: {
417
- method: 'chats.messages.send',
418
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.messages.send(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello, world!",\n }]\n },\n)\nprint(response.chat_id)',
419
- },
420
416
  go: {
421
417
  method: 'client.Chats.Messages.Send',
422
418
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Chats.Messages.Send(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatMessageSendParams{\n\t\t\tMessage: linqgo.MessageContentParam{\n\t\t\t\tParts: []linqgo.MessageContentPartUnionParam{{\n\t\t\t\t\tOfText: &linqgo.TextPartParam{\n\t\t\t\t\t\tType: linqgo.TextPartTypeText,\n\t\t\t\t\t\tValue: "Hello, world!",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ChatID)\n}\n',
423
419
  },
420
+ python: {
421
+ method: 'chats.messages.send',
422
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chats.messages.send(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello, world!",\n }]\n },\n)\nprint(response.chat_id)',
423
+ },
424
424
  typescript: {
425
425
  method: 'client.chats.messages.send',
426
426
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.chats.messages.send('550e8400-e29b-41d4-a716-446655440000', {\n message: { parts: [{ type: 'text', value: 'Hello, world!' }] },\n});\n\nconsole.log(response.chat_id);",
@@ -442,14 +442,14 @@ const EMBEDDED_METHODS = [
442
442
  response: "{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: object; from?: string; from_handle?: object; parts?: object | object | object | { app: object; layout: object; reactions: reaction[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: reaction[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: object; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
443
443
  markdown: "## list\n\n`client.chats.messages.list(chatId: string, cursor?: string, limit?: number): { id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: message_effect; from?: string; from_handle?: chat_handle; parts?: text_part_response | media_part_response | link_part_response | object | object[]; preferred_service?: service_type; read_at?: string; reconciled_at?: string; reply_to?: reply_to; sent_at?: string; service?: service_type; }`\n\n**get** `/v3/chats/{chatId}/messages`\n\nRetrieve messages from a specific chat with pagination support.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `cursor?: string`\n Pagination cursor from previous next_cursor response\n\n- `limit?: number`\n Maximum number of messages to return\n\n### Returns\n\n- `{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from?: string; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; parts?: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: { message_id: string; part_index?: number; }; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `chat_id: string`\n - `created_at: string`\n - `delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'`\n - `is_delivered: boolean`\n - `is_from_me: boolean`\n - `is_read: boolean`\n - `updated_at: string`\n - `delivered_at?: string`\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n - `from?: string`\n - `from_handle?: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }`\n - `parts?: { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'text'; value: string; inline_stickers?: { range: number[]; id?: string; file_name?: string; mime_type?: string; url?: string; }[]; mention?: string; mention_range?: number[]; mentions?: { handle: string; is_me: boolean; range: number[]; }[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { id: string; filename: string; mime_type: string; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; size_bytes: number; type: 'media'; url: string; } | { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]`\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n - `read_at?: string`\n - `reconciled_at?: string`\n - `reply_to?: { message_id: string; part_index?: number; }`\n - `sent_at?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.chats.messages.list('550e8400-e29b-41d4-a716-446655440000')) {\n console.log(message);\n}\n```",
444
444
  perLanguage: {
445
- python: {
446
- method: 'chats.messages.list',
447
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.chats.messages.list(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n)\npage = page.messages[0]\nprint(page.id)',
448
- },
449
445
  go: {
450
446
  method: 'client.Chats.Messages.List',
451
447
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Chats.Messages.List(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatMessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
452
448
  },
449
+ python: {
450
+ method: 'chats.messages.list',
451
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.chats.messages.list(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n)\npage = page.messages[0]\nprint(page.id)',
452
+ },
453
453
  typescript: {
454
454
  method: 'client.chats.messages.list',
455
455
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.chats.messages.list('550e8400-e29b-41d4-a716-446655440000')) {\n console.log(message.id);\n}",
@@ -471,14 +471,14 @@ const EMBEDDED_METHODS = [
471
471
  response: '{ message: string; success: boolean; }',
472
472
  markdown: '## request\n\n`client.chats.location.request(chatId: string): { message: string; success: boolean; }`\n\n**post** `/v3/chats/{chatId}/location/request`\n\nRequest a contact in a chat to share their location. They receive an iMessage\nprompt and must accept before any location is available; once they do, read their\nlocation coordinates with `GET /v3/chats/{chatId}/location`.\n\nThe request is delivered asynchronously. The endpoint returns immediately with\n`{ "success": true, "message": "Location request sent" }` and does not return\ncoordinates.\n\nRejected with `409` if the recipient is already sharing β€” read their\nlocation with `GET /v3/chats/{chatId}/location` instead of re-requesting.\n\nRate limited per chat, since each request prompts the recipient\'s device.\nExceeding it returns `429` with a `Retry-After` header.\n\nLocation requests only work in **1:1 iMessage chats** (Apple limitation):\n\n- Group chats (any service) return `409` with code `2016`\n (`GroupChatNotSupported`).\n- 1:1 SMS and RCS chats return `409` with code `2017`\n (`ChatServiceNotSupported`).\n\n\n### Parameters\n\n- `chatId: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from \'@linqapp/sdk\';\n\nconst client = new LinqAPIV3();\n\nconst locationRequestResponse = await client.chats.location.request(\'975d0776-bd17-4273-8337-f346b4c661b0\');\n\nconsole.log(locationRequestResponse);\n```',
473
473
  perLanguage: {
474
- python: {
475
- method: 'chats.location.request',
476
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nlocation_request_response = client.chats.location.request(\n "975d0776-bd17-4273-8337-f346b4c661b0",\n)\nprint(location_request_response.message)',
477
- },
478
474
  go: {
479
475
  method: 'client.Chats.Location.Request',
480
476
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tlocationRequestResponse, err := client.Chats.Location.Request(context.TODO(), "975d0776-bd17-4273-8337-f346b4c661b0")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", locationRequestResponse.Message)\n}\n',
481
477
  },
478
+ python: {
479
+ method: 'chats.location.request',
480
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nlocation_request_response = client.chats.location.request(\n "975d0776-bd17-4273-8337-f346b4c661b0",\n)\nprint(location_request_response.message)',
481
+ },
482
482
  typescript: {
483
483
  method: 'client.chats.location.request',
484
484
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst locationRequestResponse = await client.chats.location.request(\n '975d0776-bd17-4273-8337-f346b4c661b0',\n);\n\nconsole.log(locationRequestResponse.message);",
@@ -500,14 +500,14 @@ const EMBEDDED_METHODS = [
500
500
  response: "{ data: { features: { geometry: object; properties: object; type: 'Feature'; }[]; type: 'FeatureCollection'; }; success: boolean; }",
501
501
  markdown: "## retrieve\n\n`client.chats.location.retrieve(chatId: string): { data: object; success: boolean; }`\n\n**get** `/v3/chats/{chatId}/location`\n\nRetrieve the current location for contacts sharing with you in a chat.\n\nThe response is wrapped in the standard `{ \"success\": true, \"data\": ... }` envelope β€”\nthe body is **not** a bare GeoJSON document. `data` is a\n[GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) `FeatureCollection` with a\n`Feature` for each participant actively sharing their location.\n\nWorks for both 1:1 and group chats. In group chats, `data.features` contains a separate\nfeature for each participant who is sharing. Each feature's `properties.handle` identifies the user.\n\nA participant appears as soon as their first position arrives, typically\nwithin a second or two of sharing starting.\n\nReturns an empty `data.features` array if no one is sharing or no location data is\navailable yet. If sharing started but this stays empty, see the **Location Sharing**\noverview.\n\nPoll this endpoint to track a moving contact. `properties.updated_at`\nreflects when each participant's location was last updated. There is no\ncoordinate-update webhook. See the **Location Sharing** overview for polling\nguidance.\n\n\n### Parameters\n\n- `chatId: string`\n\n### Returns\n\n- `{ data: { features: { geometry: object; properties: object; type: 'Feature'; }[]; type: 'FeatureCollection'; }; success: boolean; }`\n\n - `data: { features: { geometry: { coordinates: number[]; type: 'Point'; }; properties: { handle: string; address?: string; locality?: string; updated_at?: string; }; type: 'Feature'; }[]; type: 'FeatureCollection'; }`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst getChatLocationResponse = await client.chats.location.retrieve('975d0776-bd17-4273-8337-f346b4c661b0');\n\nconsole.log(getChatLocationResponse);\n```",
502
502
  perLanguage: {
503
- python: {
504
- method: 'chats.location.retrieve',
505
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nget_chat_location_response = client.chats.location.retrieve(\n "975d0776-bd17-4273-8337-f346b4c661b0",\n)\nprint(get_chat_location_response.data)',
506
- },
507
503
  go: {
508
504
  method: 'client.Chats.Location.Get',
509
505
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tgetChatLocationResponse, err := client.Chats.Location.Get(context.TODO(), "975d0776-bd17-4273-8337-f346b4c661b0")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", getChatLocationResponse.Data)\n}\n',
510
506
  },
507
+ python: {
508
+ method: 'chats.location.retrieve',
509
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nget_chat_location_response = client.chats.location.retrieve(\n "975d0776-bd17-4273-8337-f346b4c661b0",\n)\nprint(get_chat_location_response.data)',
510
+ },
511
511
  typescript: {
512
512
  method: 'client.chats.location.retrieve',
513
513
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst getChatLocationResponse = await client.chats.location.retrieve(\n '975d0776-bd17-4273-8337-f346b4c661b0',\n);\n\nconsole.log(getChatLocationResponse.data);",
@@ -529,14 +529,14 @@ const EMBEDDED_METHODS = [
529
529
  response: '{ message: string; success: boolean; }',
530
530
  markdown: "## stop\n\n`client.chats.location.stop(chatId: string, handle: string): { message: string; success: boolean; }`\n\n**delete** `/v3/chats/{chatId}/location`\n\nStop a contact's location share with you. `handle` is required and names whose\nshare to end.\n\nReturns `202` when the request is accepted. The stop is carried out on the contact's\ndevice, and the `location.sharing.stopped` webhook fires once sharing has ended.\n\nSharing is per contact, so this ends that contact's share in every chat you have\nwith them.\n\nReturns `404` if the contact isn't currently sharing.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `handle: string`\n Phone number (E.164 format) or email address of the contact whose share to end\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst stopChatLocationSharingResponse = await client.chats.location.stop('975d0776-bd17-4273-8337-f346b4c661b0', { handle: '+15551234567' });\n\nconsole.log(stopChatLocationSharingResponse);\n```",
531
531
  perLanguage: {
532
- python: {
533
- method: 'chats.location.stop',
534
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nstop_chat_location_sharing_response = client.chats.location.stop(\n chat_id="975d0776-bd17-4273-8337-f346b4c661b0",\n handle="+15551234567",\n)\nprint(stop_chat_location_sharing_response.message)',
535
- },
536
532
  go: {
537
533
  method: 'client.Chats.Location.Stop',
538
534
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tstopChatLocationSharingResponse, err := client.Chats.Location.Stop(\n\t\tcontext.TODO(),\n\t\t"975d0776-bd17-4273-8337-f346b4c661b0",\n\t\tlinqgo.ChatLocationStopParams{\n\t\t\tHandle: "+15551234567",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", stopChatLocationSharingResponse.Message)\n}\n',
539
535
  },
536
+ python: {
537
+ method: 'chats.location.stop',
538
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nstop_chat_location_sharing_response = client.chats.location.stop(\n chat_id="975d0776-bd17-4273-8337-f346b4c661b0",\n handle="+15551234567",\n)\nprint(stop_chat_location_sharing_response.message)',
539
+ },
540
540
  typescript: {
541
541
  method: 'client.chats.location.stop',
542
542
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst stopChatLocationSharingResponse = await client.chats.location.stop(\n '975d0776-bd17-4273-8337-f346b4c661b0',\n { handle: '+15551234567' },\n);\n\nconsole.log(stopChatLocationSharingResponse.message);",
@@ -558,14 +558,14 @@ const EMBEDDED_METHODS = [
558
558
  response: '{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }',
559
559
  markdown: "## create\n\n`client.chats.polls.create(chatId: string, poll: { options: { text: string; }[]; idempotency_key?: string; }): { chat_id: string; created_at: string; message_id: string; poll: poll; reactions: reaction[]; updated_at: string; }`\n\n**post** `/v3/chats/{chatId}/polls`\n\nCreate an iMessage poll in an existing chat and send it. Polls are iMessage-only.\n\nThe chat must already exist β€” **a poll cannot be the first message of a\nnew chat** (use `POST /v3/chats` for that). Options are **add-only and immutable**: you\ncan add options later via `POST /v3/messages/{messageId}/poll/options`, but never edit\nor remove them.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `poll: { options: { text: string; }[]; idempotency_key?: string; }`\n Poll content to create. A poll needs at least two options. Options are add-only and\nimmutable β€” there is no title/question (send that as a normal text message).\n\n - `options: { text: string; }[]`\n - `idempotency_key?: string`\n Optional key to deduplicate the poll creation.\n\n### Returns\n\n- `{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }`\n Message-level envelope returned by every poll endpoint.\n\n - `chat_id: string`\n - `created_at: string`\n - `message_id: string`\n - `poll: { options: { can_be_edited: boolean; creator_handle: object; option_id: string; text: string; voters: { handle: string; voted_at: string; }[]; }[]; total_voters: number; }`\n - `reactions: { handle: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst pollEnvelope = await client.chats.polls.create('550e8400-e29b-41d4-a716-446655440000', { poll: { options: [{ text: 'Tacos' }, { text: 'Sushi' }] } });\n\nconsole.log(pollEnvelope);\n```",
560
560
  perLanguage: {
561
- python: {
562
- method: 'chats.polls.create',
563
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.chats.polls.create(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n poll={\n "options": [{\n "text": "Tacos"\n }, {\n "text": "Sushi"\n }],\n "idempotency_key": "poll-abc123",\n },\n)\nprint(poll_envelope.chat_id)',
564
- },
565
561
  go: {
566
562
  method: 'client.Chats.Polls.New',
567
563
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpollEnvelope, err := client.Chats.Polls.New(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatPollNewParams{\n\t\t\tPoll: linqgo.ChatPollNewParamsPoll{\n\t\t\t\tOptions: []linqgo.ChatPollNewParamsPollOption{{\n\t\t\t\t\tText: "Tacos",\n\t\t\t\t}, {\n\t\t\t\t\tText: "Sushi",\n\t\t\t\t}},\n\t\t\t\tIdempotencyKey: linqgo.String("poll-abc123"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", pollEnvelope.ChatID)\n}\n',
568
564
  },
565
+ python: {
566
+ method: 'chats.polls.create',
567
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.chats.polls.create(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n poll={\n "options": [{\n "text": "Tacos"\n }, {\n "text": "Sushi"\n }],\n "idempotency_key": "poll-abc123",\n },\n)\nprint(poll_envelope.chat_id)',
568
+ },
569
569
  typescript: {
570
570
  method: 'client.chats.polls.create',
571
571
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst pollEnvelope = await client.chats.polls.create('550e8400-e29b-41d4-a716-446655440000', {\n poll: { options: [{ text: 'Tacos' }, { text: 'Sushi' }], idempotency_key: 'poll-abc123' },\n});\n\nconsole.log(pollEnvelope.chat_id);",
@@ -593,14 +593,14 @@ const EMBEDDED_METHODS = [
593
593
  ],
594
594
  markdown: "## set\n\n`client.chats.background.set(chatId: string, type: 'color' | 'dynamic' | 'photo', image_url?: string, shades?: string[], style?: 'sky' | 'water' | 'aurora', variant?: string): void`\n\n**post** `/v3/chats/{chatId}/background`\n\nSet the transcript background for a chat.\n\nProvide one of: a **color** (a named preset or a custom 2-stop gradient),\na **dynamic** animated style, or a **photo** (by URL). The request is accepted\nasynchronously; the terminal result arrives via the `chat.background_updated`\nwebhook on success, or `chat.background_update_failed` on failure.\n\n**Group chats are supported.** Requests for RCS or SMS chats are accepted (`202`)\nbut no background is applied and no `chat.background_updated` webhook fires.\n\n\n### Parameters\n\n- `chatId: string`\n\n- `type: 'color' | 'dynamic' | 'photo'`\n The background family.\n\n- `image_url?: string`\n Photo: the image URL to embed in the background. Must be an absolute `https`\nURL pointing at an image (`.jpg`, `.png`, `.heic`, `.webp`), and the image is\nfetched and re-hosted on our CDN before the request is accepted β€” the same way\n`group_chat_icon` works. A URL we cannot fetch, or one that isn't an image, is\nrejected with a `400` (`5007`/`5006`) rather than failing later on the device.\n\nExample: `https://cdn.linqapp.com/u/bg.jpg`.\n\n\n- `shades?: string[]`\n Color with `variant: custom`: the two gradient stops as hex, top then bottom β€”\ne.g. `[\"#F2C4E1\", \"#F5A623\"]`. Ignored for named color variants (they carry\ntheir own two colors).\n\n\n- `style?: 'sky' | 'water' | 'aurora'`\n Dynamic: the animated style β€” `sky`, `water`, or `aurora`.\n\n- `variant?: string`\n Color: a named swatch β€” `mango`, `ice`, `plum`, `deep_sea`, `green_apple`,\n`cherry`, `bubblegum`, `tangerine`, `magenta`, `lime`, `silver`, `carbon`,\n`stone` β€” or `custom` (supply `shades`). Omitting `variant` is equivalent to\n`custom`, so it still requires `shades`.\n\nDynamic: required β€” the variant within the `style`. `sky`: `dusk`, `haze`,\n`sunset`, `clear`, `sunrise`, `dawn`. `water`: `light`, `dark`. `aurora`:\n`green`, `purple`, `pink`.\n\nAn unrecognized value is rejected with `400`.\n\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.background.set('550e8400-e29b-41d4-a716-446655440000', { type: 'color' })\n```",
595
595
  perLanguage: {
596
- python: {
597
- method: 'chats.background.set',
598
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.background.set(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n type="color",\n variant="mango",\n)',
599
- },
600
596
  go: {
601
597
  method: 'client.Chats.Background.Set',
602
598
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.Background.Set(\n\t\tcontext.TODO(),\n\t\t"550e8400-e29b-41d4-a716-446655440000",\n\t\tlinqgo.ChatBackgroundSetParams{\n\t\t\tType: linqgo.ChatBackgroundSetParamsTypeColor,\n\t\t\tVariant: linqgo.String("mango"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
603
599
  },
600
+ python: {
601
+ method: 'chats.background.set',
602
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.background.set(\n chat_id="550e8400-e29b-41d4-a716-446655440000",\n type="color",\n variant="mango",\n)',
603
+ },
604
604
  typescript: {
605
605
  method: 'client.chats.background.set',
606
606
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.background.set('550e8400-e29b-41d4-a716-446655440000', {\n type: 'color',\n variant: 'mango',\n});",
@@ -621,14 +621,14 @@ const EMBEDDED_METHODS = [
621
621
  params: ['chatId: string;'],
622
622
  markdown: "## remove\n\n`client.chats.background.remove(chatId: string): void`\n\n**delete** `/v3/chats/{chatId}/background`\n\nRemove the transcript background from a chat, resetting it to the default.\n\n\n### Parameters\n\n- `chatId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.chats.background.remove('550e8400-e29b-41d4-a716-446655440000')\n```",
623
623
  perLanguage: {
624
- python: {
625
- method: 'chats.background.remove',
626
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.background.remove(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
627
- },
628
624
  go: {
629
625
  method: 'client.Chats.Background.Remove',
630
626
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Chats.Background.Remove(context.TODO(), "550e8400-e29b-41d4-a716-446655440000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
631
627
  },
628
+ python: {
629
+ method: 'chats.background.remove',
630
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.chats.background.remove(\n "550e8400-e29b-41d4-a716-446655440000",\n)',
631
+ },
632
632
  typescript: {
633
633
  method: 'client.chats.background.remove',
634
634
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chats.background.remove('550e8400-e29b-41d4-a716-446655440000');",
@@ -657,14 +657,14 @@ const EMBEDDED_METHODS = [
657
657
  response: "{ chat_id: string; created_new_chat: boolean; from: string; from_selection: { reason: 'reused_active_chat' | 'new_best_number' | 'failover_flagged'; reused_existing_chat: boolean; }; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; is_group: boolean; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; service: 'iMessage' | 'SMS' | 'RCS'; previous_chat_id?: string; }",
658
658
  markdown: "## create\n\n`client.messages.create(message: { effect?: message_effect; experience?: object; idempotency_key?: string; parts?: text_part | media_part | link_part | object | object[]; preferred_service?: service_type; reply_to?: reply_to; }, to: string[], continuation_message?: { text: string; }, exclude_from?: string[], override_optout?: boolean, Idempotency-Key?: string): { chat_id: string; created_new_chat: boolean; from: string; from_selection: object; handles: chat_handle[]; is_group: boolean; message: sent_message; service: service_type; previous_chat_id?: string; }`\n\n**post** `/v3/messages`\n\nSend a message to one or more recipients **without supplying a `from`\nnumber**. Linq resolves both the sending line and the target chat for you,\nthen returns exactly which line was used, which chat the message landed in,\nwhether a new chat was created, and every resulting message id.\n\nThis fuses \"create chat\" and \"send message\" behind a single\nmessage-centric resource. Provide only the recipients (`to`) and the\n`message`; the platform decides the rest.\n\n## How the from-number and chat are chosen\n\n- **Reuse** β€” if a chat with exactly these recipients already exists on a\n line that can still send, the message is sent into that chat on its\n existing line (`from_selection.reason = reused_active_chat`). The\n most-recently-active such chat wins; chats stranded on flagged lines\n (e.g. by an earlier failover) are skipped.\n- **New** β€” if no such chat exists, a new chat is created on the best\n available line (`from_selection.reason = new_best_number`).\n- **Failover** β€” if matching chats exist but none is on a line that can\n send, a **new** chat is created on a fresh best line and the flagged chat\n is abandoned (`from_selection.reason = failover_flagged`,\n `previous_chat_id` set). If you supply `continuation_message`, that\n text is sent as the single message INSTEAD of `message` (useful as a\n fresh-number-appropriate opener). Exactly one message is sent either way.\n\nRecipients (`to`) are an order-independent set: a single handle is a direct\nchat, multiple handles a group chat.\n\n## Excluding lines\n\n`exclude_from` keeps specific lines out of **this** send's line pick. It\nonly affects picking a line for a new chat β€” an existing chat is always\nreused on its own line, preferring a chat on a non-excluded line when the\nrecipients have more than one. An exclusion never abandons a live chat or\nmoves it to a new number, so if the only chat these recipients have is on\nan excluded line, that chat is still used. `from` tells you the line that\nwas actually used.\n\n## Differences from POST /v3/chats\n\n- The first message **may contain a link** (including for a newly created\n chat). Note: sending a link as the very first message on a freshly\n selected line can elevate that line's flagging risk β€” it is allowed, not\n recommended.\n- Voice memos are **not** supported here. To send an iMessage voice-memo\n bubble, use `POST /v3/chats/{chatId}/voicememo` with a known chat id.\n\n## Service preference, effects, decorations, inline stickers\n\nSet `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,\nand per-part `text_decorations` and `inline_stickers` exactly as on the other send\nendpoints.\n\nAlways responds `202 Accepted` β€” chat creation is incidental to the send.\n\n\n### Parameters\n\n- `message: { effect?: { name?: string; type?: 'screen' | 'bubble'; }; experience?: { action: string; name: string; params?: object; }; idempotency_key?: string; parts?: { type: 'text'; value: string; inline_stickers?: inline_sticker[]; mention?: string; mention_range?: number[]; text_decorations?: text_decoration[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; }`\n Message content container. Groups all message-related fields together,\nseparating the \"what\" (message content) from the \"where\" (routing fields like from/to).\n\nA message carries EITHER `parts` β€” text and attachments, which compose\ninto one bubble β€” or a single `experience` invocation, which renders an\nexperience inside Linq's iMessage app. Never both: an app card is the whole message\n(Apple's `MSMessage` cannot coexist with text), so copy and a card are\ntwo sends, not one.\n\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n iMessage effect to apply to this message (screen or bubble effect)\n - `experience?: { action: string; name: string; params?: object; }`\n Invokes an action on an experience β€” a third party that renders inside\nLinq's iMessage app. Linq resolves the recipient's connection, mints any\nsession the action needs, composes the card and sends it; none of that\nis visible to you.\n\nCall `GET /v3/experiences/{experience}` for the actions you may invoke\nand the fields each accepts.\n\n - `idempotency_key?: string`\n Optional idempotency key for this message.\nUse this to prevent duplicate sends of the same message. Reusing a key\nwhose message was deleted β€” or was an ephemeral message that has since\nexpired β€” returns 404; the message is never resent.\n\n - `parts?: { type: 'text'; value: string; inline_stickers?: { range: number[]; attachment_id?: string; url?: string; }[]; mention?: string; mention_range?: number[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { type: 'media'; attachment_id?: string; sticker?: boolean; url?: string; } | { type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; type: 'imessage_app'; fallback_text?: string; interactive?: boolean; url?: string; } | { type: 'app_clip'; value: string; caption?: string; }[]`\n Array of message parts. Each part can be text, media, or link.\nParts are displayed in order. Text and media can be mixed freely,\nbut a `link` part must be the only part in the message.\n\n**Rich Link Previews:**\n- Use a `link` part to send a URL with a rich preview card\n- A `link` part must be the **only** part in the message\n- To send a URL as plain text (no preview), use a `text` part instead\n\n**App Clip Payment Cards:**\n- Use an `app_clip` part to send a Linq checkout link as an Apple Pay\n App Clip card (the payment preview with the Open button)\n- An `app_clip` part must be the **only** part in the message\n- iMessage-only: unlike `link`, it never downgrades to SMS/RCS β€” the\n send fails instead of delivering a bare URL\n\n**Supported Media:**\n- Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp\n- Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp\n- Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr\n- Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pages, .numbers, .key, .epub, .zip, .html, .htm\n- Contact & Calendar: .vcf, .ics\n\n**Audio:**\n- Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as media parts\n- To send audio as an **iMessage voice memo bubble** (inline playback UI), use the dedicated\n `/v3/chats/{chatId}/voicememo` endpoint instead\n\n**Validation Rules:**\n- A `link` part must be the **only** part in the message. It cannot be combined\n with text or media parts.\n- An `app_clip` part must be the **only** part in the message. Its `value`\n must be a Linq checkout link (e.g. from `POST /v3/payment_requests`);\n any other URL is rejected.\n- Consecutive text parts are not allowed. Text parts must be separated by\n media parts. For example, [text, text] is invalid, but [text, media, text] is valid.\n- Maximum of **100 parts** total.\n- Media parts using a public `url` (downloaded by the server on send) are\n capped at **40**. Parts using `attachment_id` or presigned URLs\n are exempt from this sub-limit. For bulk media sends exceeding 40 files,\n pre-upload via `POST /v3/attachments` and reference by `attachment_id` or `download_url`.\n\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n Messaging service type. Where this names the transport a message used,\nit is per-message: a chat's own `service` can differ from a message in\nit, and Apple can downgrade an individual message.\n\n - `reply_to?: { message_id: string; part_index?: number; }`\n Reply to another message to create a threaded conversation\n\n- `to: string[]`\n Recipient handles (E.164 phone numbers or email addresses). One handle\nis a direct chat; multiple handles a group chat. Order-independent β€” the\nset identifies the chat.\n\n\n- `continuation_message?: { text: string; }`\n Text-only fallback that **replaces** `message` ONLY on the failover branch β€”\nwhen a chat with these recipients already existed but its line was flagged,\nso a new chat is created on a fresh line. On that branch this text is sent as\nthe single message instead of `message` (the recipient is on a new number, so\nyou typically want a fresh-number-appropriate opener rather than the original\ncontent). Ignored otherwise (a healthy reuse, or genuine first contact).\nCarries no parts, media, or effects β€” exactly one message is ever sent.\n\n - `text: string`\n The replacement message text, sent as the single message on failover.\n\n- `exclude_from?: string[]`\n Lines (E.164) not to pick for this send. Applies for this request\nonly β€” nothing is remembered between calls.\n\n**Exclusion only affects picking a line for a new chat.** If `to`\nalready has a chat, that chat is reused on its own line, and a chat on\na non-excluded line is preferred when there is more than one. If the\nonly chat these recipients have is on an excluded line, it is still\nreused β€” an exclusion never abandons a live chat or moves it to a new\nnumber. Check `from` in the response to see the line that was actually\nused.\n\nNumbers that are not your lines are ignored. Every entry must be\nE.164 β€” a value like `4155551234` is rejected rather than silently\nskipped. Excluding every one of your available lines returns 400 when\na line has to be picked.\n\n\n- `override_optout?: boolean`\n Send even though the recipient asked you to stop (`403`, error code\n`2024`). Applies to this request only: the opt-out stays in place, so\nthe next send without this flag is rejected again. Every override is\nrecorded against your API key.\n\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ chat_id: string; created_new_chat: boolean; from: string; from_selection: { reason: 'reused_active_chat' | 'new_best_number' | 'failover_flagged'; reused_existing_chat: boolean; }; handles: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]; is_group: boolean; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; service: 'iMessage' | 'SMS' | 'RCS'; previous_chat_id?: string; }`\n Result of an auto-from send. Self-describing: which line was used, which\nchat the message landed in, whether a new chat was created, and the\nresulting message id(s).\n\n\n - `chat_id: string`\n - `created_new_chat: boolean`\n - `from: string`\n - `from_selection: { reason: 'reused_active_chat' | 'new_best_number' | 'failover_flagged'; reused_existing_chat: boolean; }`\n - `handles: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }[]`\n - `is_group: boolean`\n - `message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; sent_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n - `service: 'iMessage' | 'SMS' | 'RCS'`\n - `previous_chat_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst message = await client.messages.create({\n message: {},\n to: ['+14155559876'],\n});\n\nconsole.log(message);\n```",
659
659
  perLanguage: {
660
- python: {
661
- method: 'messages.create',
662
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.create(\n message={\n "parts": [{\n "type": "text",\n "value": "Hi! Thanks for reaching out β€” how can we help?",\n }]\n },\n to=["+14155559876"],\n)\nprint(message.chat_id)',
663
- },
664
660
  go: {
665
661
  method: 'client.Messages.New',
666
662
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmessage, err := client.Messages.New(context.TODO(), linqgo.MessageNewParams{\n\t\tMessage: linqgo.MessageContentParam{\n\t\t\tParts: []linqgo.MessageContentPartUnionParam{{\n\t\t\t\tOfText: &linqgo.TextPartParam{\n\t\t\t\t\tType: linqgo.TextPartTypeText,\n\t\t\t\t\tValue: "Hi! Thanks for reaching out β€” how can we help?",\n\t\t\t\t},\n\t\t\t}},\n\t\t},\n\t\tTo: []string{"+14155559876"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", message.ChatID)\n}\n',
667
663
  },
664
+ python: {
665
+ method: 'messages.create',
666
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.create(\n message={\n "parts": [{\n "type": "text",\n "value": "Hi! Thanks for reaching out β€” how can we help?",\n }]\n },\n to=["+14155559876"],\n)\nprint(message.chat_id)',
667
+ },
668
668
  typescript: {
669
669
  method: 'client.messages.create',
670
670
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.create({\n message: { parts: [{ type: 'text', value: 'Hi! Thanks for reaching out β€” how can we help?' }] },\n to: ['+14155559876'],\n});\n\nconsole.log(message.chat_id);",
@@ -686,14 +686,14 @@ const EMBEDDED_METHODS = [
686
686
  response: "{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: object; from?: string; from_handle?: object; parts?: object | object | object | { app: object; layout: object; reactions: reaction[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: reaction[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: object; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
687
687
  markdown: "## list_messages_thread\n\n`client.messages.listMessagesThread(messageId: string, cursor?: string, limit?: number, order?: 'asc' | 'desc'): { id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: message_effect; from?: string; from_handle?: chat_handle; parts?: text_part_response | media_part_response | link_part_response | object | object[]; preferred_service?: service_type; read_at?: string; reconciled_at?: string; reply_to?: reply_to; sent_at?: string; service?: service_type; }`\n\n**get** `/v3/messages/{messageId}/thread`\n\nRetrieve all messages in a conversation thread. Given any message ID in the thread,\nreturns the originator message and all replies in chronological order.\n\nIf the message is not part of a thread, returns just that single message.\n\nSupports pagination and configurable ordering.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `cursor?: string`\n Pagination cursor from previous next_cursor response\n\n- `limit?: number`\n Maximum number of messages to return\n\n- `order?: 'asc' | 'desc'`\n Sort order for messages (asc = oldest first, desc = newest first)\n\n### Returns\n\n- `{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from?: string; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; parts?: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: { message_id: string; part_index?: number; }; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `chat_id: string`\n - `created_at: string`\n - `delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'`\n - `is_delivered: boolean`\n - `is_from_me: boolean`\n - `is_read: boolean`\n - `updated_at: string`\n - `delivered_at?: string`\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n - `from?: string`\n - `from_handle?: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }`\n - `parts?: { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'text'; value: string; inline_stickers?: { range: number[]; id?: string; file_name?: string; mime_type?: string; url?: string; }[]; mention?: string; mention_range?: number[]; mentions?: { handle: string; is_me: boolean; range: number[]; }[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { id: string; filename: string; mime_type: string; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; size_bytes: number; type: 'media'; url: string; } | { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]`\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n - `read_at?: string`\n - `reconciled_at?: string`\n - `reply_to?: { message_id: string; part_index?: number; }`\n - `sent_at?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.listMessagesThread('69a37c7d-af4f-4b5e-af42-e28e98ce873a')) {\n console.log(message);\n}\n```",
688
688
  perLanguage: {
689
- python: {
690
- method: 'messages.list_messages_thread',
691
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.messages.list_messages_thread(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\npage = page.messages[0]\nprint(page.id)',
692
- },
693
689
  go: {
694
690
  method: 'client.Messages.ListMessagesThread',
695
691
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Messages.ListMessagesThread(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessageListMessagesThreadParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
696
692
  },
693
+ python: {
694
+ method: 'messages.list_messages_thread',
695
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npage = client.messages.list_messages_thread(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\npage = page.messages[0]\nprint(page.id)',
696
+ },
697
697
  typescript: {
698
698
  method: 'client.messages.listMessagesThread',
699
699
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.listMessagesThread(\n '69a37c7d-af4f-4b5e-af42-e28e98ce873a',\n)) {\n console.log(message.id);\n}",
@@ -715,14 +715,14 @@ const EMBEDDED_METHODS = [
715
715
  response: "{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: object; from?: string; from_handle?: object; parts?: object | object | object | { app: object; layout: object; reactions: reaction[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: reaction[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: object; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
716
716
  markdown: "## retrieve\n\n`client.messages.retrieve(messageId: string): { id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: message_effect; from?: string; from_handle?: chat_handle; parts?: text_part_response | media_part_response | link_part_response | object | object[]; preferred_service?: service_type; read_at?: string; reconciled_at?: string; reply_to?: reply_to; sent_at?: string; service?: service_type; }`\n\n**get** `/v3/messages/{messageId}`\n\nRetrieve a specific message by its ID. This endpoint returns the full message\ndetails including text, attachments, reactions, and metadata.\n\n\n### Parameters\n\n- `messageId: string`\n\n### Returns\n\n- `{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from?: string; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; parts?: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: { message_id: string; part_index?: number; }; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `chat_id: string`\n - `created_at: string`\n - `delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'`\n - `is_delivered: boolean`\n - `is_from_me: boolean`\n - `is_read: boolean`\n - `updated_at: string`\n - `delivered_at?: string`\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n - `from?: string`\n - `from_handle?: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }`\n - `parts?: { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'text'; value: string; inline_stickers?: { range: number[]; id?: string; file_name?: string; mime_type?: string; url?: string; }[]; mention?: string; mention_range?: number[]; mentions?: { handle: string; is_me: boolean; range: number[]; }[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { id: string; filename: string; mime_type: string; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; size_bytes: number; type: 'media'; url: string; } | { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]`\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n - `read_at?: string`\n - `reconciled_at?: string`\n - `reply_to?: { message_id: string; part_index?: number; }`\n - `sent_at?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst message = await client.messages.retrieve('69a37c7d-af4f-4b5e-af42-e28e98ce873a');\n\nconsole.log(message);\n```",
717
717
  perLanguage: {
718
- python: {
719
- method: 'messages.retrieve',
720
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.retrieve(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\nprint(message.id)',
721
- },
722
718
  go: {
723
719
  method: 'client.Messages.Get',
724
720
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmessage, err := client.Messages.Get(context.TODO(), "69a37c7d-af4f-4b5e-af42-e28e98ce873a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", message.ID)\n}\n',
725
721
  },
722
+ python: {
723
+ method: 'messages.retrieve',
724
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.retrieve(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\nprint(message.id)',
725
+ },
726
726
  typescript: {
727
727
  method: 'client.messages.retrieve',
728
728
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.retrieve('69a37c7d-af4f-4b5e-af42-e28e98ce873a');\n\nconsole.log(message.id);",
@@ -743,14 +743,14 @@ const EMBEDDED_METHODS = [
743
743
  params: ['messageId: string;'],
744
744
  markdown: "## delete\n\n`client.messages.delete(messageId: string): void`\n\n**delete** `/v3/messages/{messageId}`\n\nDeletes a message from the Linq API only. This does NOT unsend or remove the message\nfrom the actual chat β€” recipients will still see the message.\nRe-sending with a deleted message's idempotency key returns 404 β€” a deleted message is never resent.\n\n\n### Parameters\n\n- `messageId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.messages.delete('69a37c7d-af4f-4b5e-af42-e28e98ce873a')\n```",
745
745
  perLanguage: {
746
- python: {
747
- method: 'messages.delete',
748
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.messages.delete(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)',
749
- },
750
746
  go: {
751
747
  method: 'client.Messages.Delete',
752
748
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Messages.Delete(context.TODO(), "69a37c7d-af4f-4b5e-af42-e28e98ce873a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
753
749
  },
750
+ python: {
751
+ method: 'messages.delete',
752
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.messages.delete(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)',
753
+ },
754
754
  typescript: {
755
755
  method: 'client.messages.delete',
756
756
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.messages.delete('69a37c7d-af4f-4b5e-af42-e28e98ce873a');",
@@ -782,14 +782,14 @@ const EMBEDDED_METHODS = [
782
782
  response: '{ message?: string; status?: string; trace_id?: string; }',
783
783
  markdown: "## add_reaction\n\n`client.messages.addReaction(messageId: string, operation: 'add' | 'remove', type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker', attachment_id?: string, custom_emoji?: string, emoji?: string, part_index?: number, placement?: { rotation?: number; scale?: number; x?: number; y?: number; }, url?: string): { message?: string; status?: string; trace_id?: string; }`\n\n**post** `/v3/messages/{messageId}/reactions`\n\nAdd or remove emoji reactions to messages. Reactions let users express\ntheir response to a message without sending a new message.\n\n**Supported Reactions:**\n- love ❀️\n- like πŸ‘\n- dislike πŸ‘Ž\n- laugh πŸ˜‚\n- emphasize ‼️\n- question ❓\n- custom - any emoji as a tapback (use `custom_emoji` field to specify)\n- sticker - an emoji or image peeled onto the message (use `emoji`, `url` or `attachment_id`)\n\n**`custom` and `sticker` are different products.** A `custom` reaction is a\ntapback: the emoji sits in a small bubble on the corner of the message. A\n`sticker` is peeled onto the bubble itself, and can be dragged, resized and\nrotated. Both accept an emoji; they do not look alike.\n\n**Stickers** are iMessage-only and cannot be removed, so\n`operation: \"remove\"` with `type: \"sticker\"` is rejected. Position, size\nand rotation are optional via `placement`, and can be changed afterwards\nwith `PATCH /v3/messages/{messageId}/reactions/{reactionId}`. An animated\nimage peels as an animated sticker, in whatever shape the file already has.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `operation: 'add' | 'remove'`\n Whether to add or remove the reaction\n\n- `type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'`\n Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.\nCustom emoji reactions have type \"custom\" with the actual emoji in the custom_emoji field.\nSticker reactions have type \"sticker\" with sticker attachment details in the sticker field.\n\n\n- `attachment_id?: string`\n Reference to a sticker image pre-uploaded via `POST /v3/attachments`.\nOnly valid when type is \"sticker\".\n\nExactly one of `emoji`, `url` or `attachment_id` is required when\ntype is \"sticker\".\n\n\n- `custom_emoji?: string`\n Custom emoji string. Required when type is \"custom\".\n\nThis is a **tapback** β€” the emoji sits in the tapback bubble on the\ncorner of the message. To peel an emoji onto the message as a\ndraggable sticker instead, use type \"sticker\" with `emoji`.\n\n\n- `emoji?: string`\n A single emoji to peel onto the message as a sticker. Only valid\nwhen type is \"sticker\".\n\nExactly one of `emoji`, `url` or `attachment_id` is required when\ntype is \"sticker\".\n\nNot to be confused with `custom_emoji`, which produces a tapback.\n\n\n- `part_index?: number`\n Optional index of the message part to react to.\nIf not provided, reacts to the entire message (part 0).\n\n\n- `placement?: { rotation?: number; scale?: number; x?: number; y?: number; }`\n Optional position, size and rotation of a sticker on the target\nbubble. Only valid when type is \"sticker\".\n\nEvery field is independent and optional β€” omit the object entirely,\nor any field within it, to keep the default (centred, default size,\nunrotated).\n\n - `rotation?: number`\n Clockwise rotation in degrees.\n\n - `scale?: number`\n How large the sticker is drawn. Omit it for the default size β€”\nequivalent to `1` for an image, or `0.5` for an emoji.\n\nValues outside 0.05–2.5 are clamped rather than rejected.\n\nScale is linear, so 2.5 is a little over six times the area.\n\n - `x?: number`\n Horizontal position on the target bubble, from -1 (far left) to\n1 (far right). 0 is centred.\n\n - `y?: number`\n Vertical position on the target bubble, from -1 (top) to\n1 (bottom). 0 is centred.\n\n\n- `url?: string`\n Linq attachment URL of the sticker image β€” the `download_url`\nreturned by `POST /v3/attachments`. Only valid when type is\n\"sticker\".\n\nThe image must already be stored with us. To send a sticker from\nelsewhere, upload it with `POST /v3/attachments` first and pass\n`attachment_id`.\n\nExactly one of `emoji`, `url` or `attachment_id` is required when\ntype is \"sticker\".\n\n\n### Returns\n\n- `{ message?: string; status?: string; trace_id?: string; }`\n\n - `message?: string`\n - `status?: string`\n - `trace_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.messages.addReaction('69a37c7d-af4f-4b5e-af42-e28e98ce873a', { operation: 'add', type: 'love' });\n\nconsole.log(response);\n```",
784
784
  perLanguage: {
785
- python: {
786
- method: 'messages.add_reaction',
787
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.add_reaction(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n operation="add",\n type="love",\n)\nprint(response.trace_id)',
788
- },
789
785
  go: {
790
786
  method: 'client.Messages.AddReaction',
791
787
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n\t"github.com/linq-team/linq-go/shared"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Messages.AddReaction(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessageAddReactionParams{\n\t\t\tOperation: linqgo.MessageAddReactionParamsOperationAdd,\n\t\t\tType: shared.ReactionTypeLove,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TraceID)\n}\n',
792
788
  },
789
+ python: {
790
+ method: 'messages.add_reaction',
791
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.add_reaction(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n operation="add",\n type="love",\n)\nprint(response.trace_id)',
792
+ },
793
793
  typescript: {
794
794
  method: 'client.messages.addReaction',
795
795
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.messages.addReaction('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {\n operation: 'add',\n type: 'love',\n});\n\nconsole.log(response.trace_id);",
@@ -815,14 +815,14 @@ const EMBEDDED_METHODS = [
815
815
  response: '{ status?: string; success?: boolean; trace_id?: string; }',
816
816
  markdown: "## update_sticker_placement\n\n`client.messages.updateStickerPlacement(messageId: string, reactionId: string, placement: { rotation?: number; scale?: number; x?: number; y?: number; }): { status?: string; success?: boolean; trace_id?: string; }`\n\n**patch** `/v3/messages/{messageId}/reactions/{reactionId}`\n\nMove, resize or rotate a sticker that has already been peeled onto a message.\nThe change is sent to every device in the conversation, exactly as dragging the\nsticker by hand would.\n\nOnly stickers can be repositioned β€” a tapback has no placement, so a non-sticker\n`reactionId` is rejected. Any field omitted from `placement` keeps its current value.\n\n`reactionId` is the `id` from the reaction on the message, or from the\n`reaction.added` webhook. Stickers stack, so this id is what distinguishes one\nsticker from another on the same message.\n\nStickers peeled before this endpoint existed cannot be moved: addressing one\nrequires an identifier that was not recorded at the time, and it returns 404.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `reactionId: string`\n\n- `placement: { rotation?: number; scale?: number; x?: number; y?: number; }`\n Optional position, size and rotation of a sticker on the target\nbubble. Only valid when type is \"sticker\".\n\nEvery field is independent and optional β€” omit the object entirely,\nor any field within it, to keep the default (centred, default size,\nunrotated).\n\n - `rotation?: number`\n Clockwise rotation in degrees.\n\n - `scale?: number`\n How large the sticker is drawn. Omit it for the default size β€”\nequivalent to `1` for an image, or `0.5` for an emoji.\n\nValues outside 0.05–2.5 are clamped rather than rejected.\n\nScale is linear, so 2.5 is a little over six times the area.\n\n - `x?: number`\n Horizontal position on the target bubble, from -1 (far left) to\n1 (far right). 0 is centred.\n\n - `y?: number`\n Vertical position on the target bubble, from -1 (top) to\n1 (bottom). 0 is centred.\n\n\n### Returns\n\n- `{ status?: string; success?: boolean; trace_id?: string; }`\n\n - `status?: string`\n - `success?: boolean`\n - `trace_id?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.messages.updateStickerPlacement('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n messageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n placement: {},\n});\n\nconsole.log(response);\n```",
817
817
  perLanguage: {
818
- python: {
819
- method: 'messages.update_sticker_placement',
820
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.update_sticker_placement(\n reaction_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n message_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n placement={\n "x": 0.6,\n "y": 0.5,\n "scale": 0.75,\n },\n)\nprint(response.trace_id)',
821
- },
822
818
  go: {
823
819
  method: 'client.Messages.UpdateStickerPlacement',
824
820
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Messages.UpdateStickerPlacement(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlinqgo.MessageUpdateStickerPlacementParams{\n\t\t\tMessageID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t\tPlacement: linqgo.MessageUpdateStickerPlacementParamsPlacement{\n\t\t\t\tX: linqgo.Float(0.6),\n\t\t\t\tY: linqgo.Float(0.5),\n\t\t\t\tScale: linqgo.Float(0.75),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TraceID)\n}\n',
825
821
  },
822
+ python: {
823
+ method: 'messages.update_sticker_placement',
824
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.update_sticker_placement(\n reaction_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n message_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n placement={\n "x": 0.6,\n "y": 0.5,\n "scale": 0.75,\n },\n)\nprint(response.trace_id)',
825
+ },
826
826
  typescript: {
827
827
  method: 'client.messages.updateStickerPlacement',
828
828
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.messages.updateStickerPlacement(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n {\n messageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n placement: {\n x: 0.6,\n y: 0.5,\n scale: 0.75,\n },\n },\n);\n\nconsole.log(response.trace_id);",
@@ -844,14 +844,14 @@ const EMBEDDED_METHODS = [
844
844
  response: "{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: object; from?: string; from_handle?: object; parts?: object | object | object | { app: object; layout: object; reactions: reaction[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: reaction[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: object; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }",
845
845
  markdown: "## update\n\n`client.messages.update(messageId: string, text: string, part_index?: number): { id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: message_effect; from?: string; from_handle?: chat_handle; parts?: text_part_response | media_part_response | link_part_response | object | object[]; preferred_service?: service_type; read_at?: string; reconciled_at?: string; reply_to?: reply_to; sent_at?: string; service?: service_type; }`\n\n**patch** `/v3/messages/{messageId}`\n\nEdit the text content of a specific part of a previously sent message.\n\n**Note:** A message can be edited up to 5 times, and only within 15 minutes of when it was originally sent.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `text: string`\n New text content for the message part\n\n- `part_index?: number`\n Index of the message part to edit. Defaults to 0.\n\n### Returns\n\n- `{ id: string; chat_id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_delivered: boolean; is_from_me: boolean; is_read: boolean; updated_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from?: string; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; parts?: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; read_at?: string; reconciled_at?: string; reply_to?: { message_id: string; part_index?: number; }; sent_at?: string; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n - `id: string`\n - `chat_id: string`\n - `created_at: string`\n - `delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'`\n - `is_delivered: boolean`\n - `is_from_me: boolean`\n - `is_read: boolean`\n - `updated_at: string`\n - `delivered_at?: string`\n - `effect?: { name?: string; type?: 'screen' | 'bubble'; }`\n - `from?: string`\n - `from_handle?: { id: string; handle: string; joined_at: string; service: 'iMessage' | 'SMS' | 'RCS'; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }`\n - `parts?: { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'text'; value: string; inline_stickers?: { range: number[]; id?: string; file_name?: string; mime_type?: string; url?: string; }[]; mention?: string; mention_range?: number[]; mentions?: { handle: string; is_me: boolean; range: number[]; }[]; text_decorations?: { range: number[]; animation?: 'big' | 'small' | 'shake' | 'nod' | 'explode' | 'ripple' | 'bloom' | 'jitter'; style?: 'bold' | 'italic' | 'strikethrough' | 'underline'; }[]; } | { id: string; filename: string; mime_type: string; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; size_bytes: number; type: 'media'; url: string; } | { reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: { handle: object; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]`\n - `preferred_service?: 'iMessage' | 'SMS' | 'RCS'`\n - `read_at?: string`\n - `reconciled_at?: string`\n - `reply_to?: { message_id: string; part_index?: number; }`\n - `sent_at?: string`\n - `service?: 'iMessage' | 'SMS' | 'RCS'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst message = await client.messages.update('69a37c7d-af4f-4b5e-af42-e28e98ce873a', { text: 'This is the edited message content' });\n\nconsole.log(message);\n```",
846
846
  perLanguage: {
847
- python: {
848
- method: 'messages.update',
849
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.update(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n text="This is the edited message content",\n part_index=0,\n)\nprint(message.id)',
850
- },
851
847
  go: {
852
848
  method: 'client.Messages.Update',
853
849
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmessage, err := client.Messages.Update(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessageUpdateParams{\n\t\t\tText: "This is the edited message content",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", message.ID)\n}\n',
854
850
  },
851
+ python: {
852
+ method: 'messages.update',
853
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nmessage = client.messages.update(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n text="This is the edited message content",\n part_index=0,\n)\nprint(message.id)',
854
+ },
855
855
  typescript: {
856
856
  method: 'client.messages.update',
857
857
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.update('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {\n text: 'This is the edited message content',\n});\n\nconsole.log(message.id);",
@@ -881,14 +881,14 @@ const EMBEDDED_METHODS = [
881
881
  response: "{ chat_id: string; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; }",
882
882
  markdown: "## update_app_card\n\n`client.messages.updateAppCard(messageId: string, layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }, app?: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }, experience?: { action: string; name: string; params?: object; }, fallback_text?: string, interactive?: boolean, url?: string): { chat_id: string; message: sent_message; }`\n\n**post** `/v3/messages/{messageId}/update`\n\nReplaces a previously delivered `imessage_app` card on the recipient's screen with new\ncontent, instead of posting a new bubble (like a game move redrawing the board).\n\nThe update is delivered as a **new message** with its own id and delivery lifecycle\n(`message.sent` / `message.delivered` / `message.failed` webhooks fire for the new id).\nTo update the card again, reference the message id returned by this call.\n\nConstraints:\n- The referenced message must be an `imessage_app` card sent by you (`400` otherwise β€”\n inbound cards cannot be updated).\n- The referenced card must already be delivered (`409` otherwise β€” retry after the\n `message.delivered` webhook for it).\n- The app identity (`team_id`, `bundle_id`, name) is inherited from the original card and\n cannot change; only `url`, `fallback_text`, and `layout` are replaced.\n- iMessage-only, like all app cards.\n- Concurrent updates against the same card are not serialized server-side; the last one\n delivered wins on the recipient's screen. Serialize updates by always referencing the\n message id returned by the previous call.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }`\n Visible layout of the card. At least one of\n`caption`, `subcaption`, `trailing_caption`, `trailing_subcaption`, or `image_url` must be\nset, otherwise the card renders as an empty bubble.\n\n`image_url` displays a preview image at the top of the card. The image renders on the\nrecipient's card whether or not they have your app installed. The small icon beside the\ncaption is the app's own icon and is not settable here.\n\n`* Note - requires a trusted chat w/ inbound activity`\n\n`image_title` and `image_subtitle` render as text overlaid on the image (title bold, subtitle\nbeneath it). They only appear when `image_url` is set β€” without an image there is nothing to\noverlay β€” so setting either without `image_url` is rejected.\n\n - `caption?: string`\n Primary label, top-left and bold.\n - `image_subtitle?: string`\n Text shown below `image_title`, overlaid on the card image. Requires `image_url`.\n - `image_title?: string`\n Bold text overlaid on the card image. Requires `image_url` (rejected without it).\n - `image_url?: string`\n URL of an image (JPEG, PNG, HEIF, or WebP) to display as the card's preview image; an unreachable or non-image URL returns a validation error. Renders for all recipients regardless of whether they have the app. Note - requires a trusted chat w/ inbound activity. In responses, this is the re-hosted `cdn.linqapp.com` copy of the image you supplied, not your original URL.\n - `subcaption?: string`\n Secondary label, below `caption` on the left.\n - `trailing_caption?: string`\n Label shown top-right.\n - `trailing_subcaption?: string`\n Label shown below `trailing_caption`, on the right.\n\n- `app?: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }`\n Identifies the iMessage app (Messages app extension) that backs the card.\n - `bundle_id: string`\n Bundle identifier of the Messages app extension. Must not contain `:`.\n\n - `name: string`\n Display name of the app, shown by Messages' fallback UI.\n - `team_id: string`\n The app's 10-character uppercase alphanumeric team identifier.\n - `app_store_id?: number`\n The owning app's App Store id (optional). When set, recipients without the iMessage app\ninstalled see a \"Get the app\" affordance.\n\n\n- `experience?: { action: string; name: string; params?: object; }`\n Invokes an action on an experience β€” a third party that renders inside\nLinq's iMessage app. Linq resolves the recipient's connection, mints any\nsession the action needs, composes the card and sends it; none of that\nis visible to you.\n\nCall `GET /v3/experiences/{experience}` for the actions you may invoke\nand the fields each accepts.\n\n - `action: string`\n Which of its actions, e.g. `attach_card`.\n - `name: string`\n The experience to invoke, e.g. `agentcard` or `agentpay`.\n - `params?: object`\n Values for the fields this action exposes. Keys are exactly the\nfield names listed for the action β€” no mapping, no nesting.\n\nDisplay copy only, except a `url`-type field β€” that value sets the\ndestination, and must be an absolute `https` URL.\n\nSome fields are read rather than sent: `agentpay`'s\n`request_payment` takes only a `checkout_url` and resolves the\namount and reason from that payment request itself, so the card\ncannot state a figure the checkout will not charge.\n\n\n- `fallback_text?: string`\n Text shown on surfaces that cannot render the card (notifications, lock screen). Defaults\nto the caption when omitted.\n\n\n- `interactive?: boolean`\n Whether the updated card renders as your app's interactive balloon for recipients who\nhave your iMessage app installed. `true` (default) lets your installed extension draw its\nlive view; `false` always shows the static `layout` card. Recipients without your app\nalways see the static card regardless of this flag.\n\nDefaults to `true` when omitted β€” it is **not** inherited from the original card. To keep a\ncard static across updates, re-send `interactive: false` on each update.\n\n\n- `url?: string`\n URL the recipient's app opens when they tap the updated card.\n\nMutually exclusive with `experience` and `raw_payload_data`.\n\n\n### Returns\n\n- `{ chat_id: string; message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: text_part_response | media_part_response | link_part_response | object | object[]; sent_at: string; delivered_at?: string; effect?: message_effect; from_handle?: chat_handle; preferred_service?: service_type; reply_to?: reply_to; service?: service_type; }; }`\n Response for sending a message to a chat\n\n - `chat_id: string`\n - `message: { id: string; created_at: string; delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed'; is_read: boolean; parts: { reactions: reaction[]; type: 'text'; value: string; inline_stickers?: inline_sticker_response[]; mention?: string; mention_range?: number[]; mentions?: object[]; text_decorations?: text_decoration[]; } | { id: string; filename: string; mime_type: string; reactions: reaction[]; size_bytes: number; type: 'media'; url: string; } | { reactions: reaction[]; type: 'link'; value: string; } | { app: { bundle_id: string; name: string; team_id: string; app_store_id?: number; }; layout: { caption?: string; image_subtitle?: string; image_title?: string; image_url?: string; subcaption?: string; trailing_caption?: string; trailing_subcaption?: string; }; reactions: object[]; type: 'imessage_app'; url: string; fallback_text?: string; } | { reactions: object[]; type: 'app_clip'; value: string; description?: string; image_url?: string; title?: string; }[]; sent_at: string; delivered_at?: string; effect?: { name?: string; type?: 'screen' | 'bubble'; }; from_handle?: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; preferred_service?: 'iMessage' | 'SMS' | 'RCS'; reply_to?: { message_id: string; part_index?: number; }; service?: 'iMessage' | 'SMS' | 'RCS'; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.messages.updateAppCard('69a37c7d-af4f-4b5e-af42-e28e98ce873a', { layout: {} });\n\nconsole.log(response);\n```",
883
883
  perLanguage: {
884
- python: {
885
- method: 'messages.update_app_card',
886
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.update_app_card(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n layout={\n "caption": "Score: 2 – 1"\n },\n fallback_text="Score update",\n url="https://app.example.com/card?game=7f3a&move=2",\n)\nprint(response.chat_id)',
887
- },
888
884
  go: {
889
885
  method: 'client.Messages.UpdateAppCard',
890
886
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Messages.UpdateAppCard(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessageUpdateAppCardParams{\n\t\t\tLayout: linqgo.MessageUpdateAppCardParamsLayout{\n\t\t\t\tCaption: linqgo.String("Score: 2 – 1"),\n\t\t\t},\n\t\t\tFallbackText: linqgo.String("Score update"),\n\t\t\tURL: linqgo.String("https://app.example.com/card?game=7f3a&move=2"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ChatID)\n}\n',
891
887
  },
888
+ python: {
889
+ method: 'messages.update_app_card',
890
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.messages.update_app_card(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n layout={\n "caption": "Score: 2 – 1"\n },\n fallback_text="Score update",\n url="https://app.example.com/card?game=7f3a&move=2",\n)\nprint(response.chat_id)',
891
+ },
892
892
  typescript: {
893
893
  method: 'client.messages.updateAppCard',
894
894
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.messages.updateAppCard('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {\n layout: { caption: 'Score: 2 – 1' },\n fallback_text: 'Score update',\n url: 'https://app.example.com/card?game=7f3a&move=2',\n});\n\nconsole.log(response.chat_id);",
@@ -910,14 +910,14 @@ const EMBEDDED_METHODS = [
910
910
  response: '{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }',
911
911
  markdown: "## retrieve\n\n`client.messages.poll.retrieve(messageId: string): { chat_id: string; created_at: string; message_id: string; poll: poll; reactions: reaction[]; updated_at: string; }`\n\n**get** `/v3/messages/{messageId}/poll`\n\nReturn a poll's current results β€” its options, each option's voters, and the distinct\ntotal number of voters β€” by the poll-definition message's ID.\n\n\n### Parameters\n\n- `messageId: string`\n\n### Returns\n\n- `{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }`\n Message-level envelope returned by every poll endpoint.\n\n - `chat_id: string`\n - `created_at: string`\n - `message_id: string`\n - `poll: { options: { can_be_edited: boolean; creator_handle: object; option_id: string; text: string; voters: { handle: string; voted_at: string; }[]; }[]; total_voters: number; }`\n - `reactions: { handle: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst pollEnvelope = await client.messages.poll.retrieve('69a37c7d-af4f-4b5e-af42-e28e98ce873a');\n\nconsole.log(pollEnvelope);\n```",
912
912
  perLanguage: {
913
- python: {
914
- method: 'messages.poll.retrieve',
915
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.retrieve(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\nprint(poll_envelope.chat_id)',
916
- },
917
913
  go: {
918
914
  method: 'client.Messages.Poll.Get',
919
915
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpollEnvelope, err := client.Messages.Poll.Get(context.TODO(), "69a37c7d-af4f-4b5e-af42-e28e98ce873a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", pollEnvelope.ChatID)\n}\n',
920
916
  },
917
+ python: {
918
+ method: 'messages.poll.retrieve',
919
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.retrieve(\n "69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n)\nprint(poll_envelope.chat_id)',
920
+ },
921
921
  typescript: {
922
922
  method: 'client.messages.poll.retrieve',
923
923
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst pollEnvelope = await client.messages.poll.retrieve('69a37c7d-af4f-4b5e-af42-e28e98ce873a');\n\nconsole.log(pollEnvelope.chat_id);",
@@ -939,14 +939,14 @@ const EMBEDDED_METHODS = [
939
939
  response: '{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }',
940
940
  markdown: "## add_options\n\n`client.messages.poll.addOptions(messageId: string, options: { text: string; }[]): { chat_id: string; created_at: string; message_id: string; poll: poll; reactions: reaction[]; updated_at: string; }`\n\n**post** `/v3/messages/{messageId}/poll/options`\n\nAdd one or more options to an existing poll. Options are **add-only and immutable** β€” you\ncan append options but never edit or remove them (Apple constraint). Returns the full poll.\n\n**On a zero-day-retention line, `options` must include every existing option (in the order\nthey were originally created) followed by the new one(s)**, not just the new option(s).\nZero-day-retention polls never store option text, so this request is the only place that\ntext still exists β€” it's required to correctly render the poll's existing options on the\nrecipient's device when the update is sent. Omitting an existing option returns `400`.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `options: { text: string; }[]`\n\n### Returns\n\n- `{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }`\n Message-level envelope returned by every poll endpoint.\n\n - `chat_id: string`\n - `created_at: string`\n - `message_id: string`\n - `poll: { options: { can_be_edited: boolean; creator_handle: object; option_id: string; text: string; voters: { handle: string; voted_at: string; }[]; }[]; total_voters: number; }`\n - `reactions: { handle: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst pollEnvelope = await client.messages.poll.addOptions('69a37c7d-af4f-4b5e-af42-e28e98ce873a', { options: [{ text: 'Pizza' }] });\n\nconsole.log(pollEnvelope);\n```",
941
941
  perLanguage: {
942
- python: {
943
- method: 'messages.poll.add_options',
944
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.add_options(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n options=[{\n "text": "Pizza"\n }],\n)\nprint(poll_envelope.chat_id)',
945
- },
946
942
  go: {
947
943
  method: 'client.Messages.Poll.AddOptions',
948
944
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpollEnvelope, err := client.Messages.Poll.AddOptions(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessagePollAddOptionsParams{\n\t\t\tOptions: []linqgo.MessagePollAddOptionsParamsOption{{\n\t\t\t\tText: "Pizza",\n\t\t\t}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", pollEnvelope.ChatID)\n}\n',
949
945
  },
946
+ python: {
947
+ method: 'messages.poll.add_options',
948
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.add_options(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n options=[{\n "text": "Pizza"\n }],\n)\nprint(poll_envelope.chat_id)',
949
+ },
950
950
  typescript: {
951
951
  method: 'client.messages.poll.addOptions',
952
952
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst pollEnvelope = await client.messages.poll.addOptions('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {\n options: [{ text: 'Pizza' }],\n});\n\nconsole.log(pollEnvelope.chat_id);",
@@ -968,14 +968,14 @@ const EMBEDDED_METHODS = [
968
968
  response: '{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }',
969
969
  markdown: "## vote\n\n`client.messages.poll.vote(messageId: string, operation: 'add' | 'remove', option_id: string): { chat_id: string; created_at: string; message_id: string; poll: poll; reactions: reaction[]; updated_at: string; }`\n\n**post** `/v3/messages/{messageId}/poll/votes`\n\nAdd or remove your line's vote on **one** poll option (per-option toggle β€” iMessage polls\nare toggled one option at a time). Returns the poll reflecting the toggle.\n\n\n### Parameters\n\n- `messageId: string`\n\n- `operation: 'add' | 'remove'`\n Add or remove your line's vote on the option.\n\n- `option_id: string`\n The option to toggle a vote on.\n\n### Returns\n\n- `{ chat_id: string; created_at: string; message_id: string; poll: { options: object[]; total_voters: number; }; reactions: { handle: chat_handle; is_me: boolean; type: reaction_type; id?: string; custom_emoji?: string; sticker?: object; }[]; updated_at: string; }`\n Message-level envelope returned by every poll endpoint.\n\n - `chat_id: string`\n - `created_at: string`\n - `message_id: string`\n - `poll: { options: { can_be_edited: boolean; creator_handle: object; option_id: string; text: string; voters: { handle: string; voted_at: string; }[]; }[]; total_voters: number; }`\n - `reactions: { handle: { id: string; handle: string; joined_at: string; service: service_type; is_me?: boolean; left_at?: string; status?: 'active' | 'left' | 'removed'; }; is_me: boolean; type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker'; id?: string; custom_emoji?: string; sticker?: { file_name?: string; height?: number; mime_type?: string; url?: string; width?: number; }; }[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst pollEnvelope = await client.messages.poll.vote('69a37c7d-af4f-4b5e-af42-e28e98ce873a', { operation: 'add', option_id: '97ce8c17-7ef6-4bbc-a89a-6b93d189712f' });\n\nconsole.log(pollEnvelope);\n```",
970
970
  perLanguage: {
971
- python: {
972
- method: 'messages.poll.vote',
973
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.vote(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n operation="add",\n option_id="97ce8c17-7ef6-4bbc-a89a-6b93d189712f",\n)\nprint(poll_envelope.chat_id)',
974
- },
975
971
  go: {
976
972
  method: 'client.Messages.Poll.Vote',
977
973
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpollEnvelope, err := client.Messages.Poll.Vote(\n\t\tcontext.TODO(),\n\t\t"69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n\t\tlinqgo.MessagePollVoteParams{\n\t\t\tOperation: linqgo.MessagePollVoteParamsOperationAdd,\n\t\t\tOptionID: "97ce8c17-7ef6-4bbc-a89a-6b93d189712f",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", pollEnvelope.ChatID)\n}\n',
978
974
  },
975
+ python: {
976
+ method: 'messages.poll.vote',
977
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npoll_envelope = client.messages.poll.vote(\n message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",\n operation="add",\n option_id="97ce8c17-7ef6-4bbc-a89a-6b93d189712f",\n)\nprint(poll_envelope.chat_id)',
978
+ },
979
979
  typescript: {
980
980
  method: 'client.messages.poll.vote',
981
981
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst pollEnvelope = await client.messages.poll.vote('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {\n operation: 'add',\n option_id: '97ce8c17-7ef6-4bbc-a89a-6b93d189712f',\n});\n\nconsole.log(pollEnvelope.chat_id);",
@@ -997,14 +997,14 @@ const EMBEDDED_METHODS = [
997
997
  response: "{ attachment_id: string; download_url: string; expires_at: string; http_method: 'PUT'; required_headers: object; upload_url: string; }",
998
998
  markdown: '## create\n\n`client.attachments.create(content_type: string, filename: string, size_bytes: number): { attachment_id: string; download_url: string; expires_at: string; http_method: \'PUT\'; required_headers: object; upload_url: string; }`\n\n**post** `/v3/attachments`\n\n**This endpoint is optional.** You can send media by simply providing a URL in your\nmessage\'s media part β€” no pre-upload required. Use this endpoint only when you want\nto upload a file ahead of time for reuse or latency optimization.\n\nReturns a presigned upload URL and a reusable `attachment_id` you can reference\nin future messages. Attachments stored on the **ephemeral attachments tier**\n(and their URLs) are removed within roughly 24–48 hours of upload, independently of\nany message retention window. Attachments on the persistent tier are kept\nuntil you `DELETE` them, regardless of message expiry.\n\n## Step 1: Request an upload URL\n\nCall `POST /v3/attachments` with file metadata:\n\n```json\n{\n "filename": "photo.jpg",\n "content_type": "image/jpeg",\n "size_bytes": 1024000\n}\n```\n\nThe response includes an `upload_url` (valid for 15 minutes) and a reusable `attachment_id`.\n\n## Step 2: Upload the file\n\nMake a PUT request to the `upload_url` with the raw file bytes as the request body.\nYou **must** include all headers from `required_headers` exactly as returned β€” the presigned URL\nis signed with these values and S3 will reject the upload if they don\'t match.\n\nThe request body is the binary file content β€” **not** JSON, **not** multipart form data.\nThe file must equal `size_bytes` bytes (the value you declared in step 1).\n\n```bash\ncurl -X PUT "<upload_url from step 1>" \\\n -H "Content-Type: image/jpeg" \\\n -H "Content-Length: 1024000" \\\n --data-binary @photo.jpg\n```\n\n## Step 3: Send a message with the attachment\n\nReference the `attachment_id` in a media part with `POST /v3/chats`. The ID stays valid\nfor as many messages as you want β€” unless the attachment is stored on the ephemeral\nattachments tier, in which case it is removed within roughly 24–48 hours of upload.\n\n```json\n{\n "from": "+15559876543",\n "to": ["+15551234567"],\n "message": {\n "parts": [\n { "type": "media", "attachment_id": "<attachment_id from step 1>" }\n ]\n }\n}\n```\n\n## When to use this instead of a URL in the media part\n\n- Sending the same file to multiple recipients (avoids re-downloading each time)\n- Large files where you want to separate upload from message send\n- Latency-sensitive sends where the file should already be stored\n\nIf you just need to send a file once, skip all of this and pass a `url` directly in the media part instead.\n\n**File Size Limit:** 100MB\n\n**Unsupported Types:** WebP, SVG, FLAC, OGG, and executable files are explicitly rejected.\n\n\n### Parameters\n\n- `content_type: string`\n Supported MIME types for file attachments and media URLs.\n\n**Images:** image/jpeg, image/png, image/gif, image/heic, image/heif, image/tiff, image/bmp, image/svg+xml, image/webp, image/x-icon\n\n**Videos:** video/mp4, video/quicktime, video/mpeg, video/mpeg2, video/x-msvideo, video/3gpp\n\n**Audio:** audio/mpeg, audio/x-m4a, audio/x-caf, audio/x-wav, audio/x-aiff, audio/aac, audio/midi, audio/amr\n\n**Wallet passes:** application/vnd.apple.pkpass\n\n**Documents:** application/pdf, text/plain, text/markdown, text/vcard, text/rtf, text/csv, text/html, text/calendar, text/xml, application/json, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/x-iwork-pages-sffpages, application/x-iwork-numbers-sffnumbers, application/x-iwork-keynote-sffkey, application/epub+zip, application/zip, application/x-gzip\n\n**Transcoded on delivery:**\n- `audio/x-caf` β€” CAF files are transcoded to `audio/mp4` for delivery.\n\n**Deprecated (accepted but transcoded):**\n- `audio/mp3` β€” Deprecated. Use `audio/mpeg` instead. Files sent as audio/mp3 will be delivered as audio/mpeg.\n- `audio/mp4` β€” Deprecated. Use `audio/x-m4a` instead. Files sent as audio/mp4 will be delivered as audio/x-m4a.\n- `audio/aiff` β€” Deprecated. Use `audio/x-aiff` instead. Files sent as audio/aiff will be delivered as audio/x-aiff.\n- `image/tiff` β€” Accepted, but TIFF images are transcoded to JPEG for delivery.\n\n**Unsupported:** FLAC, OGG, and executable files are explicitly rejected.\n\n\n- `filename: string`\n Name of the file to upload\n\n- `size_bytes: number`\n Size of the file in bytes (max 100MB)\n\n### Returns\n\n- `{ attachment_id: string; download_url: string; expires_at: string; http_method: \'PUT\'; required_headers: object; upload_url: string; }`\n\n - `attachment_id: string`\n - `download_url: string`\n - `expires_at: string`\n - `http_method: \'PUT\'`\n - `required_headers: object`\n - `upload_url: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from \'@linqapp/sdk\';\n\nconst client = new LinqAPIV3();\n\nconst attachment = await client.attachments.create({\n content_type: \'image/jpeg\',\n filename: \'photo.jpg\',\n size_bytes: 1024000,\n});\n\nconsole.log(attachment);\n```',
999
999
  perLanguage: {
1000
- python: {
1001
- method: 'attachments.create',
1002
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nattachment = client.attachments.create(\n content_type="image/jpeg",\n filename="photo.jpg",\n size_bytes=1024000,\n)\nprint(attachment.attachment_id)',
1003
- },
1004
1000
  go: {
1005
1001
  method: 'client.Attachments.New',
1006
1002
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tattachment, err := client.Attachments.New(context.TODO(), linqgo.AttachmentNewParams{\n\t\tContentType: linqgo.SupportedContentTypeImageJpeg,\n\t\tFilename: "photo.jpg",\n\t\tSizeBytes: 1024000,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", attachment.AttachmentID)\n}\n',
1007
1003
  },
1004
+ python: {
1005
+ method: 'attachments.create',
1006
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nattachment = client.attachments.create(\n content_type="image/jpeg",\n filename="photo.jpg",\n size_bytes=1024000,\n)\nprint(attachment.attachment_id)',
1007
+ },
1008
1008
  typescript: {
1009
1009
  method: 'client.attachments.create',
1010
1010
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst attachment = await client.attachments.create({\n content_type: 'image/jpeg',\n filename: 'photo.jpg',\n size_bytes: 1024000,\n});\n\nconsole.log(attachment.attachment_id);",
@@ -1026,14 +1026,14 @@ const EMBEDDED_METHODS = [
1026
1026
  response: "{ id: string; content_type: string; created_at: string; filename: string; size_bytes: number; status: 'pending' | 'complete' | 'failed'; download_url?: string; }",
1027
1027
  markdown: "## retrieve\n\n`client.attachments.retrieve(attachmentId: string): { id: string; content_type: supported_content_type; created_at: string; filename: string; size_bytes: number; status: 'pending' | 'complete' | 'failed'; download_url?: string; }`\n\n**get** `/v3/attachments/{attachmentId}`\n\nRetrieve metadata for a specific attachment including file\ninformation, and URLs for downloading.\n\n`status`: (**deprecated** β€” will be removed in a future API version)\n\n\n### Parameters\n\n- `attachmentId: string`\n\n### Returns\n\n- `{ id: string; content_type: string; created_at: string; filename: string; size_bytes: number; status: 'pending' | 'complete' | 'failed'; download_url?: string; }`\n\n - `id: string`\n - `content_type: string`\n - `created_at: string`\n - `filename: string`\n - `size_bytes: number`\n - `status: 'pending' | 'complete' | 'failed'`\n - `download_url?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst attachment = await client.attachments.retrieve('abc12345-1234-5678-9abc-def012345678');\n\nconsole.log(attachment);\n```",
1028
1028
  perLanguage: {
1029
- python: {
1030
- method: 'attachments.retrieve',
1031
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nattachment = client.attachments.retrieve(\n "abc12345-1234-5678-9abc-def012345678",\n)\nprint(attachment.id)',
1032
- },
1033
1029
  go: {
1034
1030
  method: 'client.Attachments.Get',
1035
1031
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tattachment, err := client.Attachments.Get(context.TODO(), "abc12345-1234-5678-9abc-def012345678")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", attachment.ID)\n}\n',
1036
1032
  },
1033
+ python: {
1034
+ method: 'attachments.retrieve',
1035
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nattachment = client.attachments.retrieve(\n "abc12345-1234-5678-9abc-def012345678",\n)\nprint(attachment.id)',
1036
+ },
1037
1037
  typescript: {
1038
1038
  method: 'client.attachments.retrieve',
1039
1039
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst attachment = await client.attachments.retrieve('abc12345-1234-5678-9abc-def012345678');\n\nconsole.log(attachment.id);",
@@ -1054,14 +1054,14 @@ const EMBEDDED_METHODS = [
1054
1054
  params: ['attachmentId: string;'],
1055
1055
  markdown: "## delete\n\n`client.attachments.delete(attachmentId: string): void`\n\n**delete** `/v3/attachments/{attachmentId}`\n\nPermanently delete an attachment owned by the authenticated partner.\n\n### Parameters\n\n- `attachmentId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.attachments.delete('abc12345-1234-5678-9abc-def012345678')\n```",
1056
1056
  perLanguage: {
1057
- python: {
1058
- method: 'attachments.delete',
1059
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.attachments.delete(\n "abc12345-1234-5678-9abc-def012345678",\n)',
1060
- },
1061
1057
  go: {
1062
1058
  method: 'client.Attachments.Delete',
1063
1059
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Attachments.Delete(context.TODO(), "abc12345-1234-5678-9abc-def012345678")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
1064
1060
  },
1061
+ python: {
1062
+ method: 'attachments.delete',
1063
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.attachments.delete(\n "abc12345-1234-5678-9abc-def012345678",\n)',
1064
+ },
1065
1065
  typescript: {
1066
1066
  method: 'client.attachments.delete',
1067
1067
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.attachments.delete('abc12345-1234-5678-9abc-def012345678');",
@@ -1082,14 +1082,14 @@ const EMBEDDED_METHODS = [
1082
1082
  response: '{ phone_numbers: { id: string; phone_number: string; capabilities?: { mms: boolean; sms: boolean; voice: boolean; }; country_code?: string; type?: string; }[]; }',
1083
1083
  markdown: "## list\n\n`client.phonenumbers.list(): { phone_numbers: object[]; }`\n\n**get** `/v3/phonenumbers`\n\n**Deprecated.** Use `GET /v3/phone_numbers` instead.\n\n\n### Returns\n\n- `{ phone_numbers: { id: string; phone_number: string; capabilities?: { mms: boolean; sms: boolean; voice: boolean; }; country_code?: string; type?: string; }[]; }`\n\n - `phone_numbers: { id: string; phone_number: string; capabilities?: { mms: boolean; sms: boolean; voice: boolean; }; country_code?: string; type?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst phonenumbers = await client.phonenumbers.list();\n\nconsole.log(phonenumbers);\n```",
1084
1084
  perLanguage: {
1085
- python: {
1086
- method: 'phonenumbers.list',
1087
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphonenumbers = client.phonenumbers.list()\nprint(phonenumbers.phone_numbers)',
1088
- },
1089
1085
  go: {
1090
1086
  method: 'client.Phonenumbers.List',
1091
1087
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tphonenumbers, err := client.Phonenumbers.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", phonenumbers.PhoneNumbers)\n}\n',
1092
1088
  },
1089
+ python: {
1090
+ method: 'phonenumbers.list',
1091
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphonenumbers = client.phonenumbers.list()\nprint(phonenumbers.phone_numbers)',
1092
+ },
1093
1093
  typescript: {
1094
1094
  method: 'client.phonenumbers.list',
1095
1095
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst phonenumbers = await client.phonenumbers.list();\n\nconsole.log(phonenumbers.phone_numbers);",
@@ -1110,14 +1110,14 @@ const EMBEDDED_METHODS = [
1110
1110
  response: "{ phone_numbers: { id: string; phone_number: string; reputation: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; }; forwarding_number?: string; }[]; }",
1111
1111
  markdown: "## list\n\n`client.phoneNumbers.list(): { phone_numbers: object[]; }`\n\n**get** `/v3/phone_numbers`\n\nReturns all phone numbers assigned to the authenticated partner.\nUse this endpoint to discover which phone numbers are available for\nuse as the `from` field when creating a chat, listing chats, or sending a voice memo.\n\n\n### Returns\n\n- `{ phone_numbers: { id: string; phone_number: string; reputation: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; }; forwarding_number?: string; }[]; }`\n\n - `phone_numbers: { id: string; phone_number: string; reputation: { doc_url: string; status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; }; forwarding_number?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst phoneNumbers = await client.phoneNumbers.list();\n\nconsole.log(phoneNumbers);\n```",
1112
1112
  perLanguage: {
1113
- python: {
1114
- method: 'phone_numbers.list',
1115
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphone_numbers = client.phone_numbers.list()\nprint(phone_numbers.phone_numbers)',
1116
- },
1117
1113
  go: {
1118
1114
  method: 'client.PhoneNumbers.List',
1119
1115
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tphoneNumbers, err := client.PhoneNumbers.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", phoneNumbers.PhoneNumbers)\n}\n',
1120
1116
  },
1117
+ python: {
1118
+ method: 'phone_numbers.list',
1119
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphone_numbers = client.phone_numbers.list()\nprint(phone_numbers.phone_numbers)',
1120
+ },
1121
1121
  typescript: {
1122
1122
  method: 'client.phoneNumbers.list',
1123
1123
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumbers = await client.phoneNumbers.list();\n\nconsole.log(phoneNumbers.phone_numbers);",
@@ -1139,14 +1139,14 @@ const EMBEDDED_METHODS = [
1139
1139
  response: '{ id: string; forwarding_number: string; phone_number: string; }',
1140
1140
  markdown: "## update\n\n`client.phoneNumbers.update(phoneNumberId: string, forwarding_number: string): { id: string; forwarding_number: string; phone_number: string; }`\n\n**put** `/v3/phone_numbers/{phoneNumberId}`\n\nUpdates the forwarding number for a phone number. The forwarding number is where inbound calls will be forwarded to.\n\nPass an empty string to clear the forwarding number.\n\n\n### Parameters\n\n- `phoneNumberId: string`\n\n- `forwarding_number: string`\n The forwarding number in E.164 format. Set to null or empty string to clear.\n\n\n### Returns\n\n- `{ id: string; forwarding_number: string; phone_number: string; }`\n\n - `id: string`\n - `forwarding_number: string`\n - `phone_number: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst phoneNumber = await client.phoneNumbers.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { forwarding_number: '+12025559999' });\n\nconsole.log(phoneNumber);\n```",
1141
1141
  perLanguage: {
1142
- python: {
1143
- method: 'phone_numbers.update',
1144
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphone_number = client.phone_numbers.update(\n phone_number_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n forwarding_number="+12025559999",\n)\nprint(phone_number.id)',
1145
- },
1146
1142
  go: {
1147
1143
  method: 'client.PhoneNumbers.Update',
1148
1144
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tphoneNumber, err := client.PhoneNumbers.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlinqgo.PhoneNumberUpdateParams{\n\t\t\tForwardingNumber: linqgo.String("+12025559999"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", phoneNumber.ID)\n}\n',
1149
1145
  },
1146
+ python: {
1147
+ method: 'phone_numbers.update',
1148
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nphone_number = client.phone_numbers.update(\n phone_number_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n forwarding_number="+12025559999",\n)\nprint(phone_number.id)',
1149
+ },
1150
1150
  typescript: {
1151
1151
  method: 'client.phoneNumbers.update',
1152
1152
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumber = await client.phoneNumbers.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n forwarding_number: '+12025559999',\n});\n\nconsole.log(phoneNumber.id);",
@@ -1168,14 +1168,14 @@ const EMBEDDED_METHODS = [
1168
1168
  response: "{ audit_id: string; status: 'pending' | 'complete' | 'error'; }",
1169
1169
  markdown: "## start_reputation_audit\n\n`client.phoneNumbers.startReputationAudit(phoneNumber: string): { audit_id: string; status: 'pending' | 'complete' | 'error'; }`\n\n**post** `/v3/phone_numbers/{phoneNumber}/reputation_audit`\n\nStarts an asynchronous reputation audit for a line and returns an\n`audit_id`. Poll the GET endpoint for the result.\n\nRate limited per line: only one audit may run at a time. Starting one\nwhile another is still running returns `202` with the running audit's\n`audit_id` rather than an error, so a retried start picks that audit\nback up instead of losing it β€” poll the id you were given.\n\nOnce an audit finishes, a new one can't be started for the same line\nuntil a cooldown elapses (`429`, with `Retry-After` carrying the wait).\nKeep the `audit_id` from the original `202`: it stays readable on the\nGET endpoint for 24 hours, and the cooldown response does not repeat\nit.\n\n\n### Parameters\n\n- `phoneNumber: string`\n\n### Returns\n\n- `{ audit_id: string; status: 'pending' | 'complete' | 'error'; }`\n\n - `audit_id: string`\n - `status: 'pending' | 'complete' | 'error'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst reputationAuditStarted = await client.phoneNumbers.startReputationAudit('phoneNumber');\n\nconsole.log(reputationAuditStarted);\n```",
1170
1170
  perLanguage: {
1171
- python: {
1172
- method: 'phone_numbers.start_reputation_audit',
1173
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nreputation_audit_started = client.phone_numbers.start_reputation_audit(\n "phoneNumber",\n)\nprint(reputation_audit_started.audit_id)',
1174
- },
1175
1171
  go: {
1176
1172
  method: 'client.PhoneNumbers.StartReputationAudit',
1177
1173
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\treputationAuditStarted, err := client.PhoneNumbers.StartReputationAudit(context.TODO(), "phoneNumber")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", reputationAuditStarted.AuditID)\n}\n',
1178
1174
  },
1175
+ python: {
1176
+ method: 'phone_numbers.start_reputation_audit',
1177
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nreputation_audit_started = client.phone_numbers.start_reputation_audit(\n "phoneNumber",\n)\nprint(reputation_audit_started.audit_id)',
1178
+ },
1179
1179
  typescript: {
1180
1180
  method: 'client.phoneNumbers.startReputationAudit',
1181
1181
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst reputationAuditStarted = await client.phoneNumbers.startReputationAudit('phoneNumber');\n\nconsole.log(reputationAuditStarted.audit_id);",
@@ -1197,14 +1197,14 @@ const EMBEDDED_METHODS = [
1197
1197
  response: "{ audit_id: string; status: 'pending' | 'complete' | 'error'; error?: string; generated_at?: string; phone?: string; report?: { action_items?: reputation_action_item[]; drivers?: reputation_driver[]; evidence?: reputation_evidence; primary_driver?: string; severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; summary_markdown?: string; }; }",
1198
1198
  markdown: "## get_reputation_audit\n\n`client.phoneNumbers.getReputationAudit(phoneNumber: string, auditId: string): { audit_id: string; status: 'pending' | 'complete' | 'error'; error?: string; generated_at?: string; phone?: string; report?: reputation_report; }`\n\n**get** `/v3/phone_numbers/{phoneNumber}/reputation_audit/{auditId}`\n\nReturns the audit's status and, once complete, the report. Audits are\nscoped to the line in the URL β€” an `auditId` started on a different\nline returns `404`.\n\n\n### Parameters\n\n- `phoneNumber: string`\n\n- `auditId: string`\n\n### Returns\n\n- `{ audit_id: string; status: 'pending' | 'complete' | 'error'; error?: string; generated_at?: string; phone?: string; report?: { action_items?: reputation_action_item[]; drivers?: reputation_driver[]; evidence?: reputation_evidence; primary_driver?: string; severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; summary_markdown?: string; }; }`\n\n - `audit_id: string`\n - `status: 'pending' | 'complete' | 'error'`\n - `error?: string`\n - `generated_at?: string`\n - `phone?: string`\n - `report?: { action_items?: { detail?: string; expected_impact?: 'high' | 'medium' | 'low'; priority?: number; title?: string; }[]; drivers?: { key?: reputation_driver_key; metric?: string; summary?: string; }[]; evidence?: { opt_out_chats?: reputation_opt_out_chat[]; unhealthy_chats?: reputation_unhealthy_chat[]; }; primary_driver?: string; severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL'; summary_markdown?: string; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst reputationAudit = await client.phoneNumbers.getReputationAudit('auditId', { phoneNumber: 'phoneNumber' });\n\nconsole.log(reputationAudit);\n```",
1199
1199
  perLanguage: {
1200
- python: {
1201
- method: 'phone_numbers.get_reputation_audit',
1202
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nreputation_audit = client.phone_numbers.get_reputation_audit(\n audit_id="auditId",\n phone_number="phoneNumber",\n)\nprint(reputation_audit.audit_id)',
1203
- },
1204
1200
  go: {
1205
1201
  method: 'client.PhoneNumbers.GetReputationAudit',
1206
1202
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\treputationAudit, err := client.PhoneNumbers.GetReputationAudit(\n\t\tcontext.TODO(),\n\t\t"auditId",\n\t\tlinqgo.PhoneNumberGetReputationAuditParams{\n\t\t\tPhoneNumber: "phoneNumber",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", reputationAudit.AuditID)\n}\n',
1207
1203
  },
1204
+ python: {
1205
+ method: 'phone_numbers.get_reputation_audit',
1206
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nreputation_audit = client.phone_numbers.get_reputation_audit(\n audit_id="auditId",\n phone_number="phoneNumber",\n)\nprint(reputation_audit.audit_id)',
1207
+ },
1208
1208
  typescript: {
1209
1209
  method: 'client.phoneNumbers.getReputationAudit',
1210
1210
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst reputationAudit = await client.phoneNumbers.getReputationAudit('auditId', {\n phoneNumber: 'phoneNumber',\n});\n\nconsole.log(reputationAudit.audit_id);",
@@ -1226,14 +1226,14 @@ const EMBEDDED_METHODS = [
1226
1226
  response: '{ phone_number: string; vcf_url: string; }',
1227
1227
  markdown: "## retrieve\n\n`client.availableNumber.retrieve(exclude_from?: string[], to?: string[]): { phone_number: string; vcf_url: string; }`\n\n**get** `/v3/available_number`\n\nReturns the best available line (E.164) to send from, applying smart\nnumber assignment. Optionally pass `to` recipients to make the choice\n\"sticky\" β€” reusing the line an existing chat with those recipients is\nalready on. Without `to`, the best available line is chosen, always\npreferring lines with a healthier reputation.\n\nThis does not reserve the line. Without `to`, the least-recently-used\navailable line is returned β€” suggestions and your own sends (including\nan explicit `from` on chat creation) both count as use, so successive\ncalls cycle through your available lines and traffic spreads evenly.\nPass the returned `phone_number` as `from` when you create the chat to\nguarantee the same line.\n\nAlso returns `vcf_url`: a time-limited link to a vCard (`.vcf`) for the\nchosen line, carrying its contact card (name/photo) with the chosen\nnumber as the primary `TEL` and the partner's other available lines as\nbackups. Share it with recipients so they can save the line as a contact.\nLines you pass in `exclude_from` are left out of the vCard too.\n\n\n### Parameters\n\n- `exclude_from?: string[]`\n Lines (E.164) to leave out of this selection. Applies to the returned\n`phone_number`, to the sticky choice when `to` is given, and to the\nvCard's backup numbers. Repeat the parameter for multiple lines; use\n`%2B` for the leading `+`.\n\nNumbers that are not your lines are ignored. Every entry must be\nE.164 β€” a value like `4155551234` is rejected rather than silently\nskipped. Excluding every one of your available lines returns 400.\n\n\n- `to?: string[]`\n Recipient handles (E.164 or email) the message is destined for. When\nprovided, an existing chat with these recipients makes the choice\nsticky. Repeat the parameter for multiple recipients.\n\n\n### Returns\n\n- `{ phone_number: string; vcf_url: string; }`\n The line smart number assignment selected, plus a shareable vCard.\n\n - `phone_number: string`\n - `vcf_url: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst availableNumber = await client.availableNumber.retrieve();\n\nconsole.log(availableNumber);\n```",
1228
1228
  perLanguage: {
1229
- python: {
1230
- method: 'available_number.retrieve',
1231
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\navailable_number = client.available_number.retrieve()\nprint(available_number.phone_number)',
1232
- },
1233
1229
  go: {
1234
1230
  method: 'client.AvailableNumber.Get',
1235
1231
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tavailableNumber, err := client.AvailableNumber.Get(context.TODO(), linqgo.AvailableNumberGetParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", availableNumber.PhoneNumber)\n}\n',
1236
1232
  },
1233
+ python: {
1234
+ method: 'available_number.retrieve',
1235
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\navailable_number = client.available_number.retrieve()\nprint(available_number.phone_number)',
1236
+ },
1237
1237
  typescript: {
1238
1238
  method: 'client.availableNumber.retrieve',
1239
1239
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst availableNumber = await client.availableNumber.retrieve();\n\nconsole.log(availableNumber.phone_number);",
@@ -1269,16 +1269,16 @@ const EMBEDDED_METHODS = [
1269
1269
  'Idempotency-Key?: string;',
1270
1270
  ],
1271
1271
  response: "{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }",
1272
- markdown: "## create\n\n`client.paymentRequests.create(amount?: number, currency?: string, customer_id?: string, description?: string, discount?: { coupon?: string; label?: string; promotion_code?: string; }, from?: string, metadata?: object, mode?: 'payment' | 'subscription', payer_handle?: string, price_id?: string, quantity?: number, rail?: 'stripe' | 'natural', trial_end?: string, trial_period_days?: number, Idempotency-Key?: string): { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }`\n\n**post** `/v3/payment_requests`\n\nCreates a payment request and returns a `checkout_url` the recipient\nopens to pay with Apple Pay or card. Funds settle directly to your\nconnected Stripe account. A payment request is independent of any chat;\nto associate one with a chat for your records, store the chat id in\n`metadata`. Requires your connected account to be `charges_enabled`\n(returns `403` otherwise).\n\nSet `mode: subscription` with a recurring `price_id` from your connected\nStripe account to start an **auto-renewing subscription** instead of a\none-time charge β€” the recipient pays the first invoice at checkout and\nthe response's `stripe` object carries the customer and subscription ids\nfor the ongoing lifecycle in your own Stripe account. See the\n*Subscriptions* section of the tag overview.\n\nIn either mode, pass `customer_id` to attach the request to an\n**existing Customer** on your connected account instead of creating a\nnew one β€” see *Pre-created customers* in the tag overview.\n\n\n### Parameters\n\n- `amount?: number`\n Amount to charge, in the currency's minor units (e.g. cents). Must be\nat least the payment provider's minimum (50 for `usd`). Required in\n`payment` mode; must be omitted in `subscription` mode (the amount\ncomes from the price).\n\n\n- `currency?: string`\n Three-letter ISO 4217 currency code. Only `usd` is currently\nsupported. Required in `payment` mode; must be omitted in\n`subscription` mode (the currency comes from the price).\n\n\n- `customer_id?: string`\n Optional id of an **existing Customer** on your connected Stripe\naccount (`cus_...`) to attach this request to, instead of a new\nCustomer being created. In `payment` mode the charge lands on that\ncustomer's payment history; in `subscription` mode the subscription\nis created on them. The customer must exist (and not be deleted) on\nyour connected account.\n\n\n- `description?: string`\n Optional description shown to the recipient at checkout.\n\n- `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n Subscription mode only. The coupon or promotion code to apply to\nthis subscription payment. Currently, only accept one coupon or one\npromo code.\n\n - `coupon?: string`\n The ID of the coupon to apply to this subscription.\n - `label?: string`\n Name of the coupon/promo code displayed to customers.\n - `promotion_code?: string`\n The ID of a promotion code to apply to this subscription.\n\n- `from?: string`\n Required for `rail: natural`. The line the request is sent from, in\nE.164 format. Must be a phone number your organization owns.\n\n\n- `metadata?: object`\n Optional key/value metadata (up to 49 keys) echoed back on retrieval\nand on `payment.*` webhooks, and stamped on the Stripe objects we\ncreate on your connected account (the PaymentIntent, and in\nsubscription mode the Subscription and any Customer created for\nyou β€” a customer you pass via `customer_id` is never modified) β€”\nuse it to correlate a request with your own records (e.g. a chat\nid). Keys starting with `linq_` are reserved.\n\n\n- `mode?: 'payment' | 'subscription'`\n `payment` (default) collects a one-time charge for `amount` +\n`currency`. `subscription` starts an auto-renewing subscription from\na recurring `price_id` on your connected Stripe account: the\nrecipient pays the first invoice at checkout and Stripe renews it\nautomatically from then on.\n\n- `payer_handle?: string`\n Required for `rail: natural`. The payer to bill, in E.164 format.\n\n\n- `price_id?: string`\n Subscription mode only (required there): id of an **active recurring\nPrice** on your connected Stripe account (`price_...`). If you sell\nthrough Stripe Payment Links today, pass the same price the link was\nbuilt from to get the native iMessage checkout for it.\n\n\n- `quantity?: number`\n Subscription mode only β€” units of the price to subscribe to.\n\n- `rail?: 'stripe' | 'natural'`\n Payment rail. `stripe` (default) is the direct-charge flow that\nsettles to your connected Stripe account. `natural` collects through\nthe Natural custodial wallet; it requires `from` + `payer_handle` and\nthat your organization has completed Natural merchant onboarding.\n\n- `trial_end?: string`\n Subscription mode only β€” end the free trial at a fixed timestamp\n(must be in the future) instead of a day count. Mutually exclusive\nwith `trial_period_days`.\n\n\n- `trial_period_days?: number`\n Subscription mode only β€” start with a free trial of this many days.\nThe recipient's card is still collected at checkout (Apple Pay or\ncard), saved to the subscription, and first charged when the trial\nends. Mutually exclusive with `trial_end`.\n\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }`\n\n - `id: string`\n - `amount: number`\n - `checkout_url: string`\n - `created_at: string`\n - `currency: string`\n - `mode: 'payment' | 'subscription'`\n - `object: string`\n - `status: 'requested' | 'succeeded' | 'canceled' | 'expired'`\n - `description?: string`\n - `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n - `expires_at?: string`\n - `interval?: 'day' | 'week' | 'month' | 'year'`\n - `interval_count?: number`\n - `metadata?: object`\n - `natural?: { payment_request_id?: string; transaction_id?: string; }`\n - `paid_at?: string`\n - `price_id?: string`\n - `quantity?: number`\n - `rail?: 'stripe' | 'natural'`\n - `stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }`\n - `trial_end?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentRequest = await client.paymentRequests.create();\n\nconsole.log(paymentRequest);\n```",
1272
+ markdown: "## create\n\n`client.paymentRequests.create(amount?: number, currency?: string, customer_id?: string, description?: string, discount?: { coupon?: string; label?: string; promotion_code?: string; }, from?: string, metadata?: object, mode?: 'payment' | 'subscription', payer_handle?: string, price_id?: string, quantity?: number, rail?: 'stripe' | 'natural', trial_end?: string, trial_period_days?: number, Idempotency-Key?: string): { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }`\n\n**post** `/v3/payment_requests`\n\nCreates a payment request and returns a `checkout_url` the recipient\nopens to pay with Apple Pay or card. Funds settle directly to your\nconnected Stripe account. A payment request is independent of any chat;\nto associate one with a chat for your records, store the chat id in\n`metadata`. Requires your connected account to be `charges_enabled`\n(returns `403` otherwise).\n\nSet `mode: subscription` with a recurring `price_id` from your connected\nStripe account to start an **auto-renewing subscription** instead of a\none-time charge β€” the recipient pays the first invoice at checkout and\nthe response's `stripe` object carries the customer and subscription ids\nfor the ongoing lifecycle in your own Stripe account. See the\n*Subscriptions* section of the tag overview.\n\nIn either mode, pass `customer_id` to attach the request to an\n**existing Customer** on your connected account instead of creating a\nnew one β€” see *Pre-created customers* in the tag overview.\n\n\n### Parameters\n\n- `amount?: number`\n Amount to charge, in the currency's minor units (e.g. cents). Must be\nat least the payment provider's minimum (50 for `usd`). Required in\n`payment` mode; must be omitted in `subscription` mode (the amount\ncomes from the price).\n\n\n- `currency?: string`\n Three-letter ISO 4217 currency code. Only `usd` is currently\nsupported. Required in `payment` mode; must be omitted in\n`subscription` mode (the currency comes from the price).\n\n\n- `customer_id?: string`\n Optional id of an **existing Customer** on your connected Stripe\naccount (`cus_...`) to attach this request to, instead of a new\nCustomer being created. In `payment` mode the charge lands on that\ncustomer's payment history; in `subscription` mode the subscription\nis created on them. The customer must exist (and not be deleted) on\nyour connected account.\n\n\n- `description?: string`\n Optional description shown to the recipient at checkout.\n\n- `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n Subscription mode only. The coupon or promotion code to apply to\nthis subscription payment. Currently, only accept one coupon or one\npromo code.\n\n - `coupon?: string`\n The ID of the coupon to apply to this subscription.\n - `label?: string`\n Name of the coupon/promo code displayed to customers.\n - `promotion_code?: string`\n The ID of a promotion code to apply to this subscription.\n\n- `from?: string`\n Required for `rail: natural`. The line the request is sent from, in\nE.164 format. Must be a phone number your organization owns.\n\n\n- `metadata?: object`\n Optional key/value metadata (up to 49 keys) echoed back on retrieval\nand on `payment.*` webhooks, and stamped on the Stripe objects we\ncreate on your connected account (the PaymentIntent, and in\nsubscription mode the Subscription and any Customer created for\nyou β€” a customer you pass via `customer_id` is never modified) β€”\nuse it to correlate a request with your own records (e.g. a chat\nid). Keys starting with `linq_` are reserved.\n\n\n- `mode?: 'payment' | 'subscription'`\n `payment` (default) collects a one-time charge for `amount` +\n`currency`. `subscription` starts an auto-renewing subscription from\na recurring `price_id` on your connected Stripe account: the\nrecipient pays the first invoice at checkout and Stripe renews it\nautomatically from then on.\n\n\n- `payer_handle?: string`\n Required for `rail: natural`. The payer to bill, in E.164 format.\n\n\n- `price_id?: string`\n Subscription mode only (required there): id of an **active recurring\nPrice** on your connected Stripe account (`price_...`). If you sell\nthrough Stripe Payment Links today, pass the same price the link was\nbuilt from to get the native iMessage checkout for it.\n\n\n- `quantity?: number`\n Subscription mode only β€” units of the price to subscribe to.\n\n- `rail?: 'stripe' | 'natural'`\n Payment rail. `stripe` (default) is the direct-charge flow that\nsettles to your connected Stripe account. `natural` collects through\nthe Natural custodial wallet; it requires `from` + `payer_handle` and\nthat your organization has completed Natural merchant onboarding.\n\n\n- `trial_end?: string`\n Subscription mode only β€” end the free trial at a fixed timestamp\n(must be in the future) instead of a day count. Mutually exclusive\nwith `trial_period_days`.\n\n\n- `trial_period_days?: number`\n Subscription mode only β€” start with a free trial of this many days.\nThe recipient's card is still collected at checkout (Apple Pay or\ncard), saved to the subscription, and first charged when the trial\nends. Mutually exclusive with `trial_end`.\n\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }`\n\n - `id: string`\n - `amount: number`\n - `checkout_url: string`\n - `created_at: string`\n - `currency: string`\n - `mode: 'payment' | 'subscription'`\n - `object: string`\n - `status: 'requested' | 'succeeded' | 'canceled' | 'expired'`\n - `description?: string`\n - `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n - `expires_at?: string`\n - `interval?: 'day' | 'week' | 'month' | 'year'`\n - `interval_count?: number`\n - `metadata?: object`\n - `natural?: { payment_request_id?: string; transaction_id?: string; }`\n - `paid_at?: string`\n - `price_id?: string`\n - `quantity?: number`\n - `rail?: 'stripe' | 'natural'`\n - `stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }`\n - `trial_end?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentRequest = await client.paymentRequests.create();\n\nconsole.log(paymentRequest);\n```",
1273
1273
  perLanguage: {
1274
- python: {
1275
- method: 'payment_requests.create',
1276
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.create(\n amount=497,\n currency="usd",\n description="Coffee with Ava",\n metadata={\n "order_id": "order_8675309"\n },\n)\nprint(payment_request.id)',
1277
- },
1278
1274
  go: {
1279
1275
  method: 'client.PaymentRequests.New',
1280
1276
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentRequest, err := client.PaymentRequests.New(context.TODO(), linqgo.PaymentRequestNewParams{\n\t\tAmount: linqgo.Int(497),\n\t\tCurrency: linqgo.String("usd"),\n\t\tDescription: linqgo.String("Coffee with Ava"),\n\t\tMetadata: map[string]string{\n\t\t\t"order_id": "order_8675309",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentRequest.ID)\n}\n',
1281
1277
  },
1278
+ python: {
1279
+ method: 'payment_requests.create',
1280
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.create(\n amount=497,\n currency="usd",\n description="Coffee with Ava",\n metadata={\n "order_id": "order_8675309"\n },\n)\nprint(payment_request.id)',
1281
+ },
1282
1282
  typescript: {
1283
1283
  method: 'client.paymentRequests.create',
1284
1284
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentRequest = await client.paymentRequests.create({\n amount: 497,\n currency: 'usd',\n description: 'Coffee with Ava',\n metadata: { order_id: 'order_8675309' },\n});\n\nconsole.log(paymentRequest.id);",
@@ -1300,14 +1300,14 @@ const EMBEDDED_METHODS = [
1300
1300
  response: "{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }",
1301
1301
  markdown: "## retrieve\n\n`client.paymentRequests.retrieve(paymentRequestId: string): { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }`\n\n**get** `/v3/payment_requests/{paymentRequestId}`\n\nReturns a payment request's status and details.\n\n\n### Parameters\n\n- `paymentRequestId: string`\n\n### Returns\n\n- `{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }`\n\n - `id: string`\n - `amount: number`\n - `checkout_url: string`\n - `created_at: string`\n - `currency: string`\n - `mode: 'payment' | 'subscription'`\n - `object: string`\n - `status: 'requested' | 'succeeded' | 'canceled' | 'expired'`\n - `description?: string`\n - `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n - `expires_at?: string`\n - `interval?: 'day' | 'week' | 'month' | 'year'`\n - `interval_count?: number`\n - `metadata?: object`\n - `natural?: { payment_request_id?: string; transaction_id?: string; }`\n - `paid_at?: string`\n - `price_id?: string`\n - `quantity?: number`\n - `rail?: 'stripe' | 'natural'`\n - `stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }`\n - `trial_end?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentRequest = await client.paymentRequests.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(paymentRequest);\n```",
1302
1302
  perLanguage: {
1303
- python: {
1304
- method: 'payment_requests.retrieve',
1305
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(payment_request.id)',
1306
- },
1307
1303
  go: {
1308
1304
  method: 'client.PaymentRequests.Get',
1309
1305
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentRequest, err := client.PaymentRequests.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentRequest.ID)\n}\n',
1310
1306
  },
1307
+ python: {
1308
+ method: 'payment_requests.retrieve',
1309
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(payment_request.id)',
1310
+ },
1311
1311
  typescript: {
1312
1312
  method: 'client.paymentRequests.retrieve',
1313
1313
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentRequest = await client.paymentRequests.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(paymentRequest.id);",
@@ -1333,14 +1333,14 @@ const EMBEDDED_METHODS = [
1333
1333
  response: "{ data: { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }[]; has_more: boolean; object: 'list'; }",
1334
1334
  markdown: "## list\n\n`client.paymentRequests.list(limit?: number, offset?: number, status?: 'requested' | 'authorized' | 'succeeded' | 'canceled' | 'expired' | 'declined'): { data: payment_request[]; has_more: boolean; object: 'list'; }`\n\n**get** `/v3/payment_requests`\n\nLists your payment requests, newest first, for reconciliation. Paginate\nwith `limit` + `offset`; `has_more` indicates whether another page exists.\n\n\n### Parameters\n\n- `limit?: number`\n Max results to return (default 20, max 100).\n\n- `offset?: number`\n Number of results to skip.\n\n- `status?: 'requested' | 'authorized' | 'succeeded' | 'canceled' | 'expired' | 'declined'`\n Filter by lifecycle status.\n\n### Returns\n\n- `{ data: { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }[]; has_more: boolean; object: 'list'; }`\n\n - `data: { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }[]`\n - `has_more: boolean`\n - `object: 'list'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentRequests = await client.paymentRequests.list();\n\nconsole.log(paymentRequests);\n```",
1335
1335
  perLanguage: {
1336
- python: {
1337
- method: 'payment_requests.list',
1338
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_requests = client.payment_requests.list()\nprint(payment_requests.data)',
1339
- },
1340
1336
  go: {
1341
1337
  method: 'client.PaymentRequests.List',
1342
1338
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentRequests, err := client.PaymentRequests.List(context.TODO(), linqgo.PaymentRequestListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentRequests.Data)\n}\n',
1343
1339
  },
1340
+ python: {
1341
+ method: 'payment_requests.list',
1342
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_requests = client.payment_requests.list()\nprint(payment_requests.data)',
1343
+ },
1344
1344
  typescript: {
1345
1345
  method: 'client.paymentRequests.list',
1346
1346
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentRequests = await client.paymentRequests.list();\n\nconsole.log(paymentRequests.data);",
@@ -1362,14 +1362,14 @@ const EMBEDDED_METHODS = [
1362
1362
  response: "{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }",
1363
1363
  markdown: "## cancel\n\n`client.paymentRequests.cancel(paymentRequestId: string): { id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: object; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: object; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: object; trial_end?: string; updated_at?: string; }`\n\n**post** `/v3/payment_requests/{paymentRequestId}/cancel`\n\nCancels an unpaid payment request: the underlying payment intent is\ncanceled and the request moves to `canceled`. A request that is already\npaid, canceled, or expired returns 409.\n\n\n### Parameters\n\n- `paymentRequestId: string`\n\n### Returns\n\n- `{ id: string; amount: number; checkout_url: string; created_at: string; currency: string; mode: 'payment' | 'subscription'; object: string; status: 'requested' | 'succeeded' | 'canceled' | 'expired'; description?: string; discount?: { coupon?: string; label?: string; promotion_code?: string; }; expires_at?: string; interval?: 'day' | 'week' | 'month' | 'year'; interval_count?: number; metadata?: object; natural?: { payment_request_id?: string; transaction_id?: string; }; paid_at?: string; price_id?: string; quantity?: number; rail?: 'stripe' | 'natural'; stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }; trial_end?: string; updated_at?: string; }`\n\n - `id: string`\n - `amount: number`\n - `checkout_url: string`\n - `created_at: string`\n - `currency: string`\n - `mode: 'payment' | 'subscription'`\n - `object: string`\n - `status: 'requested' | 'succeeded' | 'canceled' | 'expired'`\n - `description?: string`\n - `discount?: { coupon?: string; label?: string; promotion_code?: string; }`\n - `expires_at?: string`\n - `interval?: 'day' | 'week' | 'month' | 'year'`\n - `interval_count?: number`\n - `metadata?: object`\n - `natural?: { payment_request_id?: string; transaction_id?: string; }`\n - `paid_at?: string`\n - `price_id?: string`\n - `quantity?: number`\n - `rail?: 'stripe' | 'natural'`\n - `stripe?: { customer_id?: string; payment_intent_id?: string; subscription_id?: string; }`\n - `trial_end?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentRequest = await client.paymentRequests.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(paymentRequest);\n```",
1364
1364
  perLanguage: {
1365
- python: {
1366
- method: 'payment_requests.cancel',
1367
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.cancel(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(payment_request.id)',
1368
- },
1369
1365
  go: {
1370
1366
  method: 'client.PaymentRequests.Cancel',
1371
1367
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentRequest, err := client.PaymentRequests.Cancel(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentRequest.ID)\n}\n',
1372
1368
  },
1369
+ python: {
1370
+ method: 'payment_requests.cancel',
1371
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_request = client.payment_requests.cancel(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(payment_request.id)',
1372
+ },
1373
1373
  typescript: {
1374
1374
  method: 'client.paymentRequests.cancel',
1375
1375
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentRequest = await client.paymentRequests.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(paymentRequest.id);",
@@ -1391,14 +1391,14 @@ const EMBEDDED_METHODS = [
1391
1391
  response: '{ hosted_url?: string; session_id?: string; status?: string; }',
1392
1392
  markdown: "## connect\n\n`client.paymentProviders.connect(provider: string, return_url: string): { hosted_url?: string; session_id?: string; status?: string; }`\n\n**post** `/v3/payments/providers/{provider}/connect`\n\nBegins connecting your organization to a payment provider (e.g.\n`agentcard`). Returns a hosted URL where an admin authorizes the\nconnection; on completion the provider redirects back and Linq stores\nyour connected credentials.\n\n\n### Parameters\n\n- `provider: string`\n\n- `return_url: string`\n Where to send the admin after they authorize the connection.\n\n### Returns\n\n- `{ hosted_url?: string; session_id?: string; status?: string; }`\n\n - `hosted_url?: string`\n - `session_id?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.paymentProviders.connect('provider', { return_url: 'https://partner.example/settings/payments' });\n\nconsole.log(response);\n```",
1393
1393
  perLanguage: {
1394
- python: {
1395
- method: 'payment_providers.connect',
1396
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payment_providers.connect(\n provider="provider",\n return_url="https://partner.example/settings/payments",\n)\nprint(response.session_id)',
1397
- },
1398
1394
  go: {
1399
1395
  method: 'client.PaymentProviders.Connect',
1400
1396
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.PaymentProviders.Connect(\n\t\tcontext.TODO(),\n\t\t"provider",\n\t\tlinqgo.PaymentProviderConnectParams{\n\t\t\tReturnURL: "https://partner.example/settings/payments",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n',
1401
1397
  },
1398
+ python: {
1399
+ method: 'payment_providers.connect',
1400
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payment_providers.connect(\n provider="provider",\n return_url="https://partner.example/settings/payments",\n)\nprint(response.session_id)',
1401
+ },
1402
1402
  typescript: {
1403
1403
  method: 'client.paymentProviders.connect',
1404
1404
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.paymentProviders.connect('provider', {\n return_url: 'https://partner.example/settings/payments',\n});\n\nconsole.log(response.session_id);",
@@ -1420,14 +1420,14 @@ const EMBEDDED_METHODS = [
1420
1420
  response: "{ provider?: string; status?: 'onboarding' | 'ready' | 'disabled'; }",
1421
1421
  markdown: "## retrieve\n\n`client.paymentProviders.retrieve(provider: string): { provider?: string; status?: 'onboarding' | 'ready' | 'disabled'; }`\n\n**get** `/v3/payments/providers/{provider}`\n\nReturns your organization's onboarding status for a payment provider.\n\n\n### Parameters\n\n- `provider: string`\n\n### Returns\n\n- `{ provider?: string; status?: 'onboarding' | 'ready' | 'disabled'; }`\n\n - `provider?: string`\n - `status?: 'onboarding' | 'ready' | 'disabled'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentProvider = await client.paymentProviders.retrieve('provider');\n\nconsole.log(paymentProvider);\n```",
1422
1422
  perLanguage: {
1423
- python: {
1424
- method: 'payment_providers.retrieve',
1425
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_provider = client.payment_providers.retrieve(\n "provider",\n)\nprint(payment_provider.provider)',
1426
- },
1427
1423
  go: {
1428
1424
  method: 'client.PaymentProviders.Get',
1429
1425
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentProvider, err := client.PaymentProviders.Get(context.TODO(), "provider")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentProvider.Provider)\n}\n',
1430
1426
  },
1427
+ python: {
1428
+ method: 'payment_providers.retrieve',
1429
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_provider = client.payment_providers.retrieve(\n "provider",\n)\nprint(payment_provider.provider)',
1430
+ },
1431
1431
  typescript: {
1432
1432
  method: 'client.paymentProviders.retrieve',
1433
1433
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentProvider = await client.paymentProviders.retrieve('provider');\n\nconsole.log(paymentProvider.provider);",
@@ -1449,14 +1449,14 @@ const EMBEDDED_METHODS = [
1449
1449
  response: "{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }",
1450
1450
  markdown: "## connect\n\n`client.paymentHandles.connect(handle: string): { connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n**post** `/v3/payments/handles/{handle}/connect`\n\nStarts connecting a customer (by phone/email) so an agent can pay on\ntheir behalf. Linq drives the OTP + consent ceremony through the\nmessaging channel; this returns `pending` and a `connection.created`\nwebhook fires once the customer completes it.\n\n\n### Parameters\n\n- `handle: string`\n\n### Returns\n\n- `{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n - `connect_id?: string`\n - `handle?: string`\n - `status?: 'not_connected' | 'pending' | 'connected' | 'revoked'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentHandleConnection = await client.paymentHandles.connect('handle');\n\nconsole.log(paymentHandleConnection);\n```",
1451
1451
  perLanguage: {
1452
- python: {
1453
- method: 'payment_handles.connect',
1454
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.connect(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1455
- },
1456
1452
  go: {
1457
1453
  method: 'client.PaymentHandles.Connect',
1458
1454
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentHandleConnection, err := client.PaymentHandles.Connect(context.TODO(), "handle")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentHandleConnection.ConnectID)\n}\n',
1459
1455
  },
1456
+ python: {
1457
+ method: 'payment_handles.connect',
1458
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.connect(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1459
+ },
1460
1460
  typescript: {
1461
1461
  method: 'client.paymentHandles.connect',
1462
1462
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentHandleConnection = await client.paymentHandles.connect('handle');\n\nconsole.log(paymentHandleConnection.connect_id);",
@@ -1478,14 +1478,14 @@ const EMBEDDED_METHODS = [
1478
1478
  response: "{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }",
1479
1479
  markdown: "## verify\n\n`client.paymentHandles.verify(handle: string, code: string, connect_id: string): { connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n**post** `/v3/payments/handles/{handle}/verify`\n\nCompletes the ceremony `connect` started: verifies the code, records the\ncustomer's consent, and stores the connection. Returns `connected` on\nsuccess, after which payments for this handle no longer need the\ncustomer present.\n\nThe code reaches you however your channel works β€” typically the customer\nreplies with it in the thread. Codes are single-use and short-lived; if\none has expired, call `connect` again for a fresh `connect_id`.\n\n\n### Parameters\n\n- `handle: string`\n\n- `code: string`\n The one-time code the customer received.\n\n- `connect_id: string`\n The id returned by `connect`.\n\n### Returns\n\n- `{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n - `connect_id?: string`\n - `handle?: string`\n - `status?: 'not_connected' | 'pending' | 'connected' | 'revoked'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentHandleConnection = await client.paymentHandles.verify('handle', { code: '482913', connect_id: 'cs_01HZY8' });\n\nconsole.log(paymentHandleConnection);\n```",
1480
1480
  perLanguage: {
1481
- python: {
1482
- method: 'payment_handles.verify',
1483
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.verify(\n handle="handle",\n code="482913",\n connect_id="cs_01HZY8",\n)\nprint(payment_handle_connection.connect_id)',
1484
- },
1485
1481
  go: {
1486
1482
  method: 'client.PaymentHandles.Verify',
1487
1483
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentHandleConnection, err := client.PaymentHandles.Verify(\n\t\tcontext.TODO(),\n\t\t"handle",\n\t\tlinqgo.PaymentHandleVerifyParams{\n\t\t\tCode: "482913",\n\t\t\tConnectID: "cs_01HZY8",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentHandleConnection.ConnectID)\n}\n',
1488
1484
  },
1485
+ python: {
1486
+ method: 'payment_handles.verify',
1487
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.verify(\n handle="handle",\n code="482913",\n connect_id="cs_01HZY8",\n)\nprint(payment_handle_connection.connect_id)',
1488
+ },
1489
1489
  typescript: {
1490
1490
  method: 'client.paymentHandles.verify',
1491
1491
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentHandleConnection = await client.paymentHandles.verify('handle', {\n code: '482913',\n connect_id: 'cs_01HZY8',\n});\n\nconsole.log(paymentHandleConnection.connect_id);",
@@ -1507,14 +1507,14 @@ const EMBEDDED_METHODS = [
1507
1507
  response: "{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }",
1508
1508
  markdown: "## connection\n\n`client.paymentHandles.connection(handle: string): { connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n**get** `/v3/payments/handles/{handle}/connection`\n\nGet a handle's connection status\n\n### Parameters\n\n- `handle: string`\n\n### Returns\n\n- `{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n - `connect_id?: string`\n - `handle?: string`\n - `status?: 'not_connected' | 'pending' | 'connected' | 'revoked'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentHandleConnection = await client.paymentHandles.connection('handle');\n\nconsole.log(paymentHandleConnection);\n```",
1509
1509
  perLanguage: {
1510
- python: {
1511
- method: 'payment_handles.connection',
1512
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.connection(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1513
- },
1514
1510
  go: {
1515
1511
  method: 'client.PaymentHandles.Connection',
1516
1512
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentHandleConnection, err := client.PaymentHandles.Connection(context.TODO(), "handle")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentHandleConnection.ConnectID)\n}\n',
1517
1513
  },
1514
+ python: {
1515
+ method: 'payment_handles.connection',
1516
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.connection(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1517
+ },
1518
1518
  typescript: {
1519
1519
  method: 'client.paymentHandles.connection',
1520
1520
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentHandleConnection = await client.paymentHandles.connection('handle');\n\nconsole.log(paymentHandleConnection.connect_id);",
@@ -1536,14 +1536,14 @@ const EMBEDDED_METHODS = [
1536
1536
  response: "{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }",
1537
1537
  markdown: "## revoke\n\n`client.paymentHandles.revoke(handle: string): { connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n**delete** `/v3/payments/handles/{handle}/connection`\n\nRevokes this partner's grant for the customer. Only your grant is\nremoved; the customer's wallet at the provider is untouched.\n\n\n### Parameters\n\n- `handle: string`\n\n### Returns\n\n- `{ connect_id?: string; handle?: string; status?: 'not_connected' | 'pending' | 'connected' | 'revoked'; }`\n\n - `connect_id?: string`\n - `handle?: string`\n - `status?: 'not_connected' | 'pending' | 'connected' | 'revoked'`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst paymentHandleConnection = await client.paymentHandles.revoke('handle');\n\nconsole.log(paymentHandleConnection);\n```",
1538
1538
  perLanguage: {
1539
- python: {
1540
- method: 'payment_handles.revoke',
1541
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.revoke(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1542
- },
1543
1539
  go: {
1544
1540
  method: 'client.PaymentHandles.Revoke',
1545
1541
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpaymentHandleConnection, err := client.PaymentHandles.Revoke(context.TODO(), "handle")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", paymentHandleConnection.ConnectID)\n}\n',
1546
1542
  },
1543
+ python: {
1544
+ method: 'payment_handles.revoke',
1545
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment_handle_connection = client.payment_handles.revoke(\n "handle",\n)\nprint(payment_handle_connection.connect_id)',
1546
+ },
1547
1547
  typescript: {
1548
1548
  method: 'client.paymentHandles.revoke',
1549
1549
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst paymentHandleConnection = await client.paymentHandles.revoke('handle');\n\nconsole.log(paymentHandleConnection.connect_id);",
@@ -1572,14 +1572,14 @@ const EMBEDDED_METHODS = [
1572
1572
  response: '{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }',
1573
1573
  markdown: "## create\n\n`client.payments.create(amount_cents: number, currency: string, handle: string, description?: string, merchant?: { name?: string; url?: string; }, metadata?: object): { id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: object; metadata?: object; status?: string; }`\n\n**post** `/v3/payments`\n\nAdvances the pay flow for a connected customer handle and returns a\n`status` describing where it is (`needs_connection`, `awaiting_user_action`,\n`ready`, ...). A payment `id` appears once a card is minted. Idempotent on\nthe `Idempotency-Key` header.\n\n\n### Parameters\n\n- `amount_cents: number`\n\n- `currency: string`\n\n- `handle: string`\n Customer phone (E.164) or email.\n\n- `description?: string`\n\n- `merchant?: { name?: string; url?: string; }`\n - `name?: string`\n - `url?: string`\n\n- `metadata?: object`\n\n### Returns\n\n- `{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }`\n\n - `id?: string`\n - `amount_cents?: number`\n - `approval_url?: string`\n - `attach_url?: string`\n - `currency?: string`\n - `description?: string`\n - `handle?: string`\n - `merchant?: { name?: string; url?: string; }`\n - `metadata?: object`\n - `status?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst payment = await client.payments.create({\n amount_cents: 2500,\n currency: 'usd',\n handle: '+14155550123',\n});\n\nconsole.log(payment);\n```",
1574
1574
  perLanguage: {
1575
- python: {
1576
- method: 'payments.create',
1577
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.create(\n amount_cents=2500,\n currency="usd",\n handle="+14155550123",\n)\nprint(payment.id)',
1578
- },
1579
1575
  go: {
1580
1576
  method: 'client.Payments.New',
1581
1577
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpayment, err := client.Payments.New(context.TODO(), linqgo.PaymentNewParams{\n\t\tAmountCents: 2500,\n\t\tCurrency: "usd",\n\t\tHandle: "+14155550123",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.ID)\n}\n',
1582
1578
  },
1579
+ python: {
1580
+ method: 'payments.create',
1581
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.create(\n amount_cents=2500,\n currency="usd",\n handle="+14155550123",\n)\nprint(payment.id)',
1582
+ },
1583
1583
  typescript: {
1584
1584
  method: 'client.payments.create',
1585
1585
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.create({\n amount_cents: 2500,\n currency: 'usd',\n handle: '+14155550123',\n});\n\nconsole.log(payment.id);",
@@ -1601,14 +1601,14 @@ const EMBEDDED_METHODS = [
1601
1601
  response: '{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }',
1602
1602
  markdown: "## retrieve\n\n`client.payments.retrieve(paymentId: string): { id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: object; metadata?: object; status?: string; }`\n\n**get** `/v3/payments/{paymentId}`\n\nGet a payment\n\n### Parameters\n\n- `paymentId: string`\n\n### Returns\n\n- `{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }`\n\n - `id?: string`\n - `amount_cents?: number`\n - `approval_url?: string`\n - `attach_url?: string`\n - `currency?: string`\n - `description?: string`\n - `handle?: string`\n - `merchant?: { name?: string; url?: string; }`\n - `metadata?: object`\n - `status?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst payment = await client.payments.retrieve('paymentId');\n\nconsole.log(payment);\n```",
1603
1603
  perLanguage: {
1604
- python: {
1605
- method: 'payments.retrieve',
1606
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.retrieve(\n "paymentId",\n)\nprint(payment.id)',
1607
- },
1608
1604
  go: {
1609
1605
  method: 'client.Payments.Get',
1610
1606
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpayment, err := client.Payments.Get(context.TODO(), "paymentId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.ID)\n}\n',
1611
1607
  },
1608
+ python: {
1609
+ method: 'payments.retrieve',
1610
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.retrieve(\n "paymentId",\n)\nprint(payment.id)',
1611
+ },
1612
1612
  typescript: {
1613
1613
  method: 'client.payments.retrieve',
1614
1614
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.retrieve('paymentId');\n\nconsole.log(payment.id);",
@@ -1630,14 +1630,14 @@ const EMBEDDED_METHODS = [
1630
1630
  response: '{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }',
1631
1631
  markdown: "## cancel\n\n`client.payments.cancel(paymentId: string): { id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: object; metadata?: object; status?: string; }`\n\n**post** `/v3/payments/{paymentId}/cancel`\n\nCloses the virtual card and cancels the payment.\n\n### Parameters\n\n- `paymentId: string`\n\n### Returns\n\n- `{ id?: string; amount_cents?: number; approval_url?: string; attach_url?: string; currency?: string; description?: string; handle?: string; merchant?: { name?: string; url?: string; }; metadata?: object; status?: string; }`\n\n - `id?: string`\n - `amount_cents?: number`\n - `approval_url?: string`\n - `attach_url?: string`\n - `currency?: string`\n - `description?: string`\n - `handle?: string`\n - `merchant?: { name?: string; url?: string; }`\n - `metadata?: object`\n - `status?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst payment = await client.payments.cancel('paymentId');\n\nconsole.log(payment);\n```",
1632
1632
  perLanguage: {
1633
- python: {
1634
- method: 'payments.cancel',
1635
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.cancel(\n "paymentId",\n)\nprint(payment.id)',
1636
- },
1637
1633
  go: {
1638
1634
  method: 'client.Payments.Cancel',
1639
1635
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpayment, err := client.Payments.Cancel(context.TODO(), "paymentId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.ID)\n}\n',
1640
1636
  },
1637
+ python: {
1638
+ method: 'payments.cancel',
1639
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.cancel(\n "paymentId",\n)\nprint(payment.id)',
1640
+ },
1641
1641
  typescript: {
1642
1642
  method: 'client.payments.cancel',
1643
1643
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.cancel('paymentId');\n\nconsole.log(payment.id);",
@@ -1659,14 +1659,14 @@ const EMBEDDED_METHODS = [
1659
1659
  response: '{ handoff?: { card_ref?: string; fetch_url?: string; provider?: string; user_token?: string; }; }',
1660
1660
  markdown: "## credentials\n\n`client.payments.credentials(paymentId: string): { handoff?: object; }`\n\n**get** `/v3/payments/{paymentId}/credentials`\n\nReturns a short-lived handoff for a `ready` payment. Fetch the card\ncredentials **directly from the provider** with the returned `user_token`\nat `fetch_url` β€” the card number never passes through Linq. Do not persist\nPAN/CVC.\n\n\n### Parameters\n\n- `paymentId: string`\n\n### Returns\n\n- `{ handoff?: { card_ref?: string; fetch_url?: string; provider?: string; user_token?: string; }; }`\n\n - `handoff?: { card_ref?: string; fetch_url?: string; provider?: string; user_token?: string; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.payments.credentials('paymentId');\n\nconsole.log(response);\n```",
1661
1661
  perLanguage: {
1662
- python: {
1663
- method: 'payments.credentials',
1664
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.credentials(\n "paymentId",\n)\nprint(response.handoff)',
1665
- },
1666
1662
  go: {
1667
1663
  method: 'client.Payments.Credentials',
1668
1664
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Payments.Credentials(context.TODO(), "paymentId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Handoff)\n}\n',
1669
1665
  },
1666
+ python: {
1667
+ method: 'payments.credentials',
1668
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.credentials(\n "paymentId",\n)\nprint(response.handoff)',
1669
+ },
1670
1670
  typescript: {
1671
1671
  method: 'client.payments.credentials',
1672
1672
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.credentials('paymentId');\n\nconsole.log(response.handoff);",
@@ -1687,14 +1687,14 @@ const EMBEDDED_METHODS = [
1687
1687
  response: '{ blocked_handles: { blocked_at: string; handle: string; reason?: string; }[]; }',
1688
1688
  markdown: "## list\n\n`client.blockedHandles.list(): { blocked_handles: blocked_handle_entry[]; }`\n\n**get** `/v3/blocked_handles`\n\nReturns all handles you have blocked. Inbound messages from a blocked\nhandle are dropped and produce no webhooks, and direct sends to a\nblocked handle are rejected with `403` (error code `2026`). Group\nsends that include unblocked members are not restricted.\n\n\n### Returns\n\n- `{ blocked_handles: { blocked_at: string; handle: string; reason?: string; }[]; }`\n\n - `blocked_handles: { blocked_at: string; handle: string; reason?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst blockedHandles = await client.blockedHandles.list();\n\nconsole.log(blockedHandles);\n```",
1689
1689
  perLanguage: {
1690
- python: {
1691
- method: 'blocked_handles.list',
1692
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nblocked_handles = client.blocked_handles.list()\nprint(blocked_handles.blocked_handles)',
1693
- },
1694
1690
  go: {
1695
1691
  method: 'client.BlockedHandles.List',
1696
1692
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tblockedHandles, err := client.BlockedHandles.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", blockedHandles.BlockedHandles)\n}\n',
1697
1693
  },
1694
+ python: {
1695
+ method: 'blocked_handles.list',
1696
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nblocked_handles = client.blocked_handles.list()\nprint(blocked_handles.blocked_handles)',
1697
+ },
1698
1698
  typescript: {
1699
1699
  method: 'client.blockedHandles.list',
1700
1700
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst blockedHandles = await client.blockedHandles.list();\n\nconsole.log(blockedHandles.blocked_handles);",
@@ -1716,14 +1716,14 @@ const EMBEDDED_METHODS = [
1716
1716
  response: '{ blocked_handle: { blocked_at: string; handle: string; reason?: string; }; }',
1717
1717
  markdown: "## block\n\n`client.blockedHandles.block(handle: string, reason?: string): { blocked_handle: blocked_handle_entry; }`\n\n**post** `/v3/blocked_handles`\n\nBlocks a handle β€” an E.164 phone number, an email address (iMessage\nsender), an SMS short code (e.g. `262966`), or an alphanumeric sender\nID. Inbound messages from it are dropped and produce no webhooks, and\ndirect sends to it are rejected with `403` (error code `2026`); group\nsends that include unblocked members are not restricted. Blocking is\nidempotent β€” re-blocking an already blocked handle returns the\nexisting entry.\n\n\n### Parameters\n\n- `handle: string`\n The handle to block: an E.164 phone number, an email address, an\nSMS short code (3-8 digits), or an alphanumeric sender ID.\n\n\n- `reason?: string`\n Optional free-text note on why the handle was blocked\n\n### Returns\n\n- `{ blocked_handle: { blocked_at: string; handle: string; reason?: string; }; }`\n\n - `blocked_handle: { blocked_at: string; handle: string; reason?: string; }`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst response = await client.blockedHandles.block({ handle: '+12025551234' });\n\nconsole.log(response);\n```",
1718
1718
  perLanguage: {
1719
- python: {
1720
- method: 'blocked_handles.block',
1721
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.blocked_handles.block(\n handle="+12025551234",\n reason="spam",\n)\nprint(response.blocked_handle)',
1722
- },
1723
1719
  go: {
1724
1720
  method: 'client.BlockedHandles.Block',
1725
1721
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.BlockedHandles.Block(context.TODO(), linqgo.BlockedHandleBlockParams{\n\t\tHandle: "+12025551234",\n\t\tReason: linqgo.String("spam"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.BlockedHandle)\n}\n',
1726
1722
  },
1723
+ python: {
1724
+ method: 'blocked_handles.block',
1725
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.blocked_handles.block(\n handle="+12025551234",\n reason="spam",\n)\nprint(response.blocked_handle)',
1726
+ },
1727
1727
  typescript: {
1728
1728
  method: 'client.blockedHandles.block',
1729
1729
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.blockedHandles.block({ handle: '+12025551234', reason: 'spam' });\n\nconsole.log(response.blocked_handle);",
@@ -1744,14 +1744,14 @@ const EMBEDDED_METHODS = [
1744
1744
  params: ['handle: string;'],
1745
1745
  markdown: "## unblock\n\n`client.blockedHandles.unblock(handle: string): void`\n\n**delete** `/v3/blocked_handles`\n\nRemoves a handle from your blocklist. Inbound messages from it will be\ndelivered again and sends to it are allowed again. The handle goes in\nthe request body, mirroring block β€” no URL encoding needed.\n\n\n### Parameters\n\n- `handle: string`\n The handle to unblock\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.blockedHandles.unblock({ handle: '+12025551234' })\n```",
1746
1746
  perLanguage: {
1747
- python: {
1748
- method: 'blocked_handles.unblock',
1749
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.blocked_handles.unblock(\n handle="+12025551234",\n)',
1750
- },
1751
1747
  go: {
1752
1748
  method: 'client.BlockedHandles.Unblock',
1753
1749
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.BlockedHandles.Unblock(context.TODO(), linqgo.BlockedHandleUnblockParams{\n\t\tHandle: "+12025551234",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
1754
1750
  },
1751
+ python: {
1752
+ method: 'blocked_handles.unblock',
1753
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.blocked_handles.unblock(\n handle="+12025551234",\n)',
1754
+ },
1755
1755
  typescript: {
1756
1756
  method: 'client.blockedHandles.unblock',
1757
1757
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.blockedHandles.unblock({ handle: '+12025551234' });",
@@ -1772,14 +1772,14 @@ const EMBEDDED_METHODS = [
1772
1772
  response: '{ experiences?: { actions?: { fields?: object; name?: string; summary?: string; }[]; display_name?: string; experience?: string; }[]; }',
1773
1773
  markdown: "## list\n\n`client.experiences.list(): { experiences?: object[]; }`\n\n**get** `/v3/experiences`\n\nThe experiences enabled for your account, with the actions you may\ninvoke on each and the fields each action accepts. Treat it as the\nlist to build against: anything not described here is unsupported and\nmay change or stop working without notice.\n\n\n### Returns\n\n- `{ experiences?: { actions?: { fields?: object; name?: string; summary?: string; }[]; display_name?: string; experience?: string; }[]; }`\n\n - `experiences?: { actions?: { fields?: object; name?: string; summary?: string; }[]; display_name?: string; experience?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst experiences = await client.experiences.list();\n\nconsole.log(experiences);\n```",
1774
1774
  perLanguage: {
1775
- python: {
1776
- method: 'experiences.list',
1777
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nexperiences = client.experiences.list()\nprint(experiences.experiences)',
1778
- },
1779
1775
  go: {
1780
1776
  method: 'client.Experiences.List',
1781
1777
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\texperiences, err := client.Experiences.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", experiences.Experiences)\n}\n',
1782
1778
  },
1779
+ python: {
1780
+ method: 'experiences.list',
1781
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nexperiences = client.experiences.list()\nprint(experiences.experiences)',
1782
+ },
1783
1783
  typescript: {
1784
1784
  method: 'client.experiences.list',
1785
1785
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst experiences = await client.experiences.list();\n\nconsole.log(experiences.experiences);",
@@ -1801,14 +1801,14 @@ const EMBEDDED_METHODS = [
1801
1801
  response: '{ actions?: { fields?: object; name?: string; summary?: string; }[]; display_name?: string; experience?: string; }',
1802
1802
  markdown: "## retrieve\n\n`client.experiences.retrieve(experience: string): { actions?: object[]; display_name?: string; experience?: string; }`\n\n**get** `/v3/experiences/{experience}`\n\nGet one experience\n\n### Parameters\n\n- `experience: string`\n\n### Returns\n\n- `{ actions?: { fields?: object; name?: string; summary?: string; }[]; display_name?: string; experience?: string; }`\n What an experience offers you. Deliberately a projection: where its\ntemplates live and how they are built is not yours to depend on, so it\nis not here.\n\n\n - `actions?: { fields?: object; name?: string; summary?: string; }[]`\n - `display_name?: string`\n - `experience?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst experience = await client.experiences.retrieve('agentpay');\n\nconsole.log(experience);\n```",
1803
1803
  perLanguage: {
1804
- python: {
1805
- method: 'experiences.retrieve',
1806
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nexperience = client.experiences.retrieve(\n "agentpay",\n)\nprint(experience.actions)',
1807
- },
1808
1804
  go: {
1809
1805
  method: 'client.Experiences.Get',
1810
1806
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\texperience, err := client.Experiences.Get(context.TODO(), "agentpay")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", experience.Actions)\n}\n',
1811
1807
  },
1808
+ python: {
1809
+ method: 'experiences.retrieve',
1810
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nexperience = client.experiences.retrieve(\n "agentpay",\n)\nprint(experience.actions)',
1811
+ },
1812
1812
  typescript: {
1813
1813
  method: 'client.experiences.retrieve',
1814
1814
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst experience = await client.experiences.retrieve('agentpay');\n\nconsole.log(experience.actions);",
@@ -1829,14 +1829,14 @@ const EMBEDDED_METHODS = [
1829
1829
  response: "{ doc_url: 'https://docs.linqapp.com/channel/imessage/guides/webhooks/events'; events: string[]; }",
1830
1830
  markdown: "## list\n\n`client.webhookEvents.list(): { doc_url: 'https://docs.linqapp.com/channel/imessage/guides/webhooks/events'; events: webhook_event_type[]; }`\n\n**get** `/v3/webhook-events`\n\nReturns all available webhook event types that can be subscribed to.\nUse this endpoint to discover valid values for the `subscribed_events`\nfield when creating or updating webhook subscriptions.\n\n\n### Returns\n\n- `{ doc_url: 'https://docs.linqapp.com/channel/imessage/guides/webhooks/events'; events: string[]; }`\n\n - `doc_url: 'https://docs.linqapp.com/channel/imessage/guides/webhooks/events'`\n - `events: string[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst webhookEvents = await client.webhookEvents.list();\n\nconsole.log(webhookEvents);\n```",
1831
1831
  perLanguage: {
1832
- python: {
1833
- method: 'webhook_events.list',
1834
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_events = client.webhook_events.list()\nprint(webhook_events.doc_url)',
1835
- },
1836
1832
  go: {
1837
1833
  method: 'client.WebhookEvents.List',
1838
1834
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\twebhookEvents, err := client.WebhookEvents.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", webhookEvents.DocURL)\n}\n',
1839
1835
  },
1836
+ python: {
1837
+ method: 'webhook_events.list',
1838
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_events = client.webhook_events.list()\nprint(webhook_events.doc_url)',
1839
+ },
1840
1840
  typescript: {
1841
1841
  method: 'client.webhookEvents.list',
1842
1842
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookEvents = await client.webhookEvents.list();\n\nconsole.log(webhookEvents.doc_url);",
@@ -1864,14 +1864,14 @@ const EMBEDDED_METHODS = [
1864
1864
  response: '{ id: string; created_at: string; is_active: boolean; signing_secret: string; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }',
1865
1865
  markdown: "## create\n\n`client.webhookSubscriptions.create(subscribed_events: string[], target_url: string, phone_numbers?: string[], routing_id_header?: string, routing_key_header?: string): { id: string; created_at: string; is_active: boolean; signing_secret: string; subscribed_events: webhook_event_type[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n\n**post** `/v3/webhook-subscriptions`\n\nCreate a new webhook subscription to receive events at a target URL.\nUpon creation, a signing secret is generated for verifying webhook\nauthenticity. **Store this secret securely β€” it cannot be retrieved later.**\n\n**Phone Number Filtering:**\n- Optionally specify `phone_numbers` to only receive events for specific lines\n- If omitted, events from all phone numbers are delivered (default behavior)\n- Use multiple subscriptions with different `phone_numbers` to route different lines to different endpoints\n- Each `target_url` can only be used once per account. To route different\n lines to different destinations, use a unique URL per subscription\n (e.g., append a query parameter: `https://example.com/webhook?line=1`)\n\n**Webhook Delivery:**\n- Events are sent via HTTP POST to the target URL\n- Each request includes [Standard Webhooks](https://github.com/standard-webhooks/standard-webhooks) headers (`webhook-id`, `webhook-timestamp`, `webhook-signature`) for signature verification\n- Legacy `X-Webhook-*` headers are also sent for backwards compatibility (deprecated)\n- See [Verifying Webhook Signatures](https://docs.linqapp.com/channel/imessage/guides/webhooks#verifying-webhook-signatures) for verification details\n- Failed deliveries (5xx, 429, network errors) are retried up to 10 times over ~25 minutes with exponential backoff\n- Client errors (4xx except 429) are not retried\n\n\n### Parameters\n\n- `subscribed_events: string[]`\n List of event types to subscribe to\n\n- `target_url: string`\n URL where webhook events will be sent. Must be HTTPS.\n\n- `phone_numbers?: string[]`\n Optional list of phone numbers to filter events for. Only events originating from these phone numbers will be delivered to this subscription. If omitted or empty, events from all phone numbers are delivered. Phone numbers must be in E.164 format.\n\n- `routing_id_header?: string`\n Name of the header carrying the chat id, used to hash-route before a token is learned. Defaults to `Linq-Chat-Id`. Ignored without `routing_key_header`.\n\n- `routing_key_header?: string`\n Enables delivery affinity. Name of the header carrying an opaque routing token: we send it on each webhook for a chat and read it back from your 2xx response, so your edge can route to the cluster holding that chat. Omit to disable.\n\n### Returns\n\n- `{ id: string; created_at: string; is_active: boolean; signing_secret: string; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n Response returned when creating a webhook subscription. Includes the signing secret which is only shown once.\n\n - `id: string`\n - `created_at: string`\n - `is_active: boolean`\n - `signing_secret: string`\n - `subscribed_events: string[]`\n - `target_url: string`\n - `updated_at: string`\n - `phone_numbers?: string[]`\n - `routing_id_header?: string`\n - `routing_key_header?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst webhookSubscription = await client.webhookSubscriptions.create({ subscribed_events: ['message.sent', 'message.delivered', 'message.read'], target_url: 'https://webhooks.example.com/linq/events' });\n\nconsole.log(webhookSubscription);\n```",
1866
1866
  perLanguage: {
1867
- python: {
1868
- method: 'webhook_subscriptions.create',
1869
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.create(\n subscribed_events=["message.sent", "message.delivered", "message.read"],\n target_url="https://webhooks.example.com/linq/events",\n)\nprint(webhook_subscription.id)',
1870
- },
1871
1867
  go: {
1872
1868
  method: 'client.WebhookSubscriptions.New',
1873
1869
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\twebhookSubscription, err := client.WebhookSubscriptions.New(context.TODO(), linqgo.WebhookSubscriptionNewParams{\n\t\tSubscribedEvents: []linqgo.WebhookEventType{linqgo.WebhookEventTypeMessageSent, linqgo.WebhookEventTypeMessageDelivered, linqgo.WebhookEventTypeMessageRead},\n\t\tTargetURL: "https://webhooks.example.com/linq/events",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", webhookSubscription.ID)\n}\n',
1874
1870
  },
1871
+ python: {
1872
+ method: 'webhook_subscriptions.create',
1873
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.create(\n subscribed_events=["message.sent", "message.delivered", "message.read"],\n target_url="https://webhooks.example.com/linq/events",\n)\nprint(webhook_subscription.id)',
1874
+ },
1875
1875
  typescript: {
1876
1876
  method: 'client.webhookSubscriptions.create',
1877
1877
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookSubscription = await client.webhookSubscriptions.create({\n subscribed_events: ['message.sent', 'message.delivered', 'message.read'],\n target_url: 'https://webhooks.example.com/linq/events',\n});\n\nconsole.log(webhookSubscription.id);",
@@ -1892,14 +1892,14 @@ const EMBEDDED_METHODS = [
1892
1892
  response: '{ subscriptions: { id: string; created_at: string; is_active: boolean; subscribed_events: webhook_event_type[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }[]; }',
1893
1893
  markdown: "## list\n\n`client.webhookSubscriptions.list(): { subscriptions: webhook_subscription[]; }`\n\n**get** `/v3/webhook-subscriptions`\n\nRetrieve all webhook subscriptions for the authenticated partner.\nReturns a list of active and inactive subscriptions with their\nconfiguration and status.\n\n\n### Returns\n\n- `{ subscriptions: { id: string; created_at: string; is_active: boolean; subscribed_events: webhook_event_type[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }[]; }`\n\n - `subscriptions: { id: string; created_at: string; is_active: boolean; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst webhookSubscriptions = await client.webhookSubscriptions.list();\n\nconsole.log(webhookSubscriptions);\n```",
1894
1894
  perLanguage: {
1895
- python: {
1896
- method: 'webhook_subscriptions.list',
1897
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscriptions = client.webhook_subscriptions.list()\nprint(webhook_subscriptions.subscriptions)',
1898
- },
1899
1895
  go: {
1900
1896
  method: 'client.WebhookSubscriptions.List',
1901
1897
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\twebhookSubscriptions, err := client.WebhookSubscriptions.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", webhookSubscriptions.Subscriptions)\n}\n',
1902
1898
  },
1899
+ python: {
1900
+ method: 'webhook_subscriptions.list',
1901
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscriptions = client.webhook_subscriptions.list()\nprint(webhook_subscriptions.subscriptions)',
1902
+ },
1903
1903
  typescript: {
1904
1904
  method: 'client.webhookSubscriptions.list',
1905
1905
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookSubscriptions = await client.webhookSubscriptions.list();\n\nconsole.log(webhookSubscriptions.subscriptions);",
@@ -1921,14 +1921,14 @@ const EMBEDDED_METHODS = [
1921
1921
  response: '{ id: string; created_at: string; is_active: boolean; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }',
1922
1922
  markdown: "## retrieve\n\n`client.webhookSubscriptions.retrieve(subscriptionId: string): { id: string; created_at: string; is_active: boolean; subscribed_events: webhook_event_type[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n\n**get** `/v3/webhook-subscriptions/{subscriptionId}`\n\nRetrieve details for a specific webhook subscription including its\ntarget URL, subscribed events, and current status.\n\n\n### Parameters\n\n- `subscriptionId: string`\n\n### Returns\n\n- `{ id: string; created_at: string; is_active: boolean; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n\n - `id: string`\n - `created_at: string`\n - `is_active: boolean`\n - `subscribed_events: string[]`\n - `target_url: string`\n - `updated_at: string`\n - `phone_numbers?: string[]`\n - `routing_id_header?: string`\n - `routing_key_header?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst webhookSubscription = await client.webhookSubscriptions.retrieve('b2c3d4e5-f6a7-8901-bcde-f23456789012');\n\nconsole.log(webhookSubscription);\n```",
1923
1923
  perLanguage: {
1924
- python: {
1925
- method: 'webhook_subscriptions.retrieve',
1926
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.retrieve(\n "b2c3d4e5-f6a7-8901-bcde-f23456789012",\n)\nprint(webhook_subscription.id)',
1927
- },
1928
1924
  go: {
1929
1925
  method: 'client.WebhookSubscriptions.Get',
1930
1926
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\twebhookSubscription, err := client.WebhookSubscriptions.Get(context.TODO(), "b2c3d4e5-f6a7-8901-bcde-f23456789012")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", webhookSubscription.ID)\n}\n',
1931
1927
  },
1928
+ python: {
1929
+ method: 'webhook_subscriptions.retrieve',
1930
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.retrieve(\n "b2c3d4e5-f6a7-8901-bcde-f23456789012",\n)\nprint(webhook_subscription.id)',
1931
+ },
1932
1932
  typescript: {
1933
1933
  method: 'client.webhookSubscriptions.retrieve',
1934
1934
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookSubscription = await client.webhookSubscriptions.retrieve(\n 'b2c3d4e5-f6a7-8901-bcde-f23456789012',\n);\n\nconsole.log(webhookSubscription.id);",
@@ -1958,14 +1958,14 @@ const EMBEDDED_METHODS = [
1958
1958
  response: '{ id: string; created_at: string; is_active: boolean; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }',
1959
1959
  markdown: "## update\n\n`client.webhookSubscriptions.update(subscriptionId: string, is_active?: boolean, phone_numbers?: string[], routing_id_header?: string, routing_key_header?: string, subscribed_events?: string[], target_url?: string): { id: string; created_at: string; is_active: boolean; subscribed_events: webhook_event_type[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n\n**put** `/v3/webhook-subscriptions/{subscriptionId}`\n\nUpdate an existing webhook subscription. You can modify the target URL,\nsubscribed events, or activate/deactivate the subscription.\n\n**Note:** The signing secret cannot be changed via this endpoint.\n\n\n### Parameters\n\n- `subscriptionId: string`\n\n- `is_active?: boolean`\n Activate or deactivate the subscription\n\n- `phone_numbers?: string[]`\n Updated list of phone numbers to filter events for. Set to a non-empty array to filter events to specific phone numbers. Set to an empty array or null to remove the filter and receive events from all phone numbers. Phone numbers must be in E.164 format.\n\n- `routing_id_header?: string`\n Updated header name for the chat id. Set to null or an empty string to fall back to `Linq-Chat-Id`.\n\n- `routing_key_header?: string`\n Updated header name for the routing token. Set to null or an empty string to disable delivery affinity and drop the stored tokens.\n\n- `subscribed_events?: string[]`\n Updated list of event types to subscribe to\n\n- `target_url?: string`\n New target URL for webhook events\n\n### Returns\n\n- `{ id: string; created_at: string; is_active: boolean; subscribed_events: string[]; target_url: string; updated_at: string; phone_numbers?: string[]; routing_id_header?: string; routing_key_header?: string; }`\n\n - `id: string`\n - `created_at: string`\n - `is_active: boolean`\n - `subscribed_events: string[]`\n - `target_url: string`\n - `updated_at: string`\n - `phone_numbers?: string[]`\n - `routing_id_header?: string`\n - `routing_key_header?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst webhookSubscription = await client.webhookSubscriptions.update('b2c3d4e5-f6a7-8901-bcde-f23456789012');\n\nconsole.log(webhookSubscription);\n```",
1960
1960
  perLanguage: {
1961
- python: {
1962
- method: 'webhook_subscriptions.update',
1963
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.update(\n subscription_id="b2c3d4e5-f6a7-8901-bcde-f23456789012",\n target_url="https://webhooks.example.com/linq/events",\n)\nprint(webhook_subscription.id)',
1964
- },
1965
1961
  go: {
1966
1962
  method: 'client.WebhookSubscriptions.Update',
1967
1963
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\twebhookSubscription, err := client.WebhookSubscriptions.Update(\n\t\tcontext.TODO(),\n\t\t"b2c3d4e5-f6a7-8901-bcde-f23456789012",\n\t\tlinqgo.WebhookSubscriptionUpdateParams{\n\t\t\tTargetURL: linqgo.String("https://webhooks.example.com/linq/events"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", webhookSubscription.ID)\n}\n',
1968
1964
  },
1965
+ python: {
1966
+ method: 'webhook_subscriptions.update',
1967
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nwebhook_subscription = client.webhook_subscriptions.update(\n subscription_id="b2c3d4e5-f6a7-8901-bcde-f23456789012",\n target_url="https://webhooks.example.com/linq/events",\n)\nprint(webhook_subscription.id)',
1968
+ },
1969
1969
  typescript: {
1970
1970
  method: 'client.webhookSubscriptions.update',
1971
1971
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookSubscription = await client.webhookSubscriptions.update(\n 'b2c3d4e5-f6a7-8901-bcde-f23456789012',\n { target_url: 'https://webhooks.example.com/linq/events' },\n);\n\nconsole.log(webhookSubscription.id);",
@@ -1986,14 +1986,14 @@ const EMBEDDED_METHODS = [
1986
1986
  params: ['subscriptionId: string;'],
1987
1987
  markdown: "## delete\n\n`client.webhookSubscriptions.delete(subscriptionId: string): void`\n\n**delete** `/v3/webhook-subscriptions/{subscriptionId}`\n\nDelete a webhook subscription.\n\n### Parameters\n\n- `subscriptionId: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nawait client.webhookSubscriptions.delete('b2c3d4e5-f6a7-8901-bcde-f23456789012')\n```",
1988
1988
  perLanguage: {
1989
- python: {
1990
- method: 'webhook_subscriptions.delete',
1991
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.webhook_subscriptions.delete(\n "b2c3d4e5-f6a7-8901-bcde-f23456789012",\n)',
1992
- },
1993
1989
  go: {
1994
1990
  method: 'client.WebhookSubscriptions.Delete',
1995
1991
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.WebhookSubscriptions.Delete(context.TODO(), "b2c3d4e5-f6a7-8901-bcde-f23456789012")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
1996
1992
  },
1993
+ python: {
1994
+ method: 'webhook_subscriptions.delete',
1995
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.webhook_subscriptions.delete(\n "b2c3d4e5-f6a7-8901-bcde-f23456789012",\n)',
1996
+ },
1997
1997
  typescript: {
1998
1998
  method: 'client.webhookSubscriptions.delete',
1999
1999
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.webhookSubscriptions.delete('b2c3d4e5-f6a7-8901-bcde-f23456789012');",
@@ -2012,14 +2012,14 @@ const EMBEDDED_METHODS = [
2012
2012
  stainlessPath: '(resource) webhooks > (method) unwrap',
2013
2013
  qualified: 'client.webhooks.unwrap',
2014
2014
  perLanguage: {
2015
- python: {
2016
- method: 'webhooks.unwrap',
2017
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.webhooks.unwrap()',
2018
- },
2019
2015
  go: {
2020
2016
  method: 'client.Webhooks.Unwrap',
2021
2017
  example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Webhooks.Unwrap(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
2022
2018
  },
2019
+ python: {
2020
+ method: 'webhooks.unwrap',
2021
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nclient.webhooks.unwrap()',
2022
+ },
2023
2023
  typescript: {
2024
2024
  method: 'client.webhooks.unwrap',
2025
2025
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.webhooks.unwrap();",
@@ -2038,14 +2038,14 @@ const EMBEDDED_METHODS = [
2038
2038
  response: "{ address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }",
2039
2039
  markdown: "## check_imessage\n\n`client.capability.checkIMessage(address: string, from?: string): { address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }`\n\n**post** `/v3/capability/check_imessage`\n\nCheck whether a recipient address (phone number or email) is reachable via iMessage.\n\n\n### Parameters\n\n- `address: string`\n The recipient address to check. `check_imessage` accepts an E.164 phone number or an\nemail address; `check_rcs` accepts an E.164 phone number only and rejects an email\nwith a `400`, since RCS has no email addressing.\n\n\n- `from?: string`\n Optional sender phone number. If omitted, an available phone from your pool is used automatically.\n\n### Returns\n\n- `{ address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }`\n\n - `address: string`\n - `available: boolean`\n - `reason?: 'not_supported'`\n - `selected_service?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst handleCheckResponse = await client.capability.checkIMessage({ address: '+15551234567' });\n\nconsole.log(handleCheckResponse);\n```",
2040
2040
  perLanguage: {
2041
- python: {
2042
- method: 'capability.check_i_message',
2043
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nhandle_check_response = client.capability.check_i_message(\n address="+15551234567",\n)\nprint(handle_check_response.address)',
2044
- },
2045
2041
  go: {
2046
2042
  method: 'client.Capability.CheckIMessage',
2047
2043
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\thandleCheckResponse, err := client.Capability.CheckIMessage(context.TODO(), linqgo.CapabilityCheckIMessageParams{\n\t\tHandleCheck: linqgo.HandleCheckParam{\n\t\t\tAddress: "+15551234567",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", handleCheckResponse.Address)\n}\n',
2048
2044
  },
2045
+ python: {
2046
+ method: 'capability.check_i_message',
2047
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nhandle_check_response = client.capability.check_i_message(\n address="+15551234567",\n)\nprint(handle_check_response.address)',
2048
+ },
2049
2049
  typescript: {
2050
2050
  method: 'client.capability.checkIMessage',
2051
2051
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst handleCheckResponse = await client.capability.checkIMessage({ address: '+15551234567' });\n\nconsole.log(handleCheckResponse.address);",
@@ -2067,14 +2067,14 @@ const EMBEDDED_METHODS = [
2067
2067
  response: "{ address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }",
2068
2068
  markdown: "## check_rcs\n\n`client.capability.checkRCS(address: string, from?: string): { address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }`\n\n**post** `/v3/capability/check_rcs`\n\nCheck whether a recipient address (phone number) supports RCS messaging.\n\n`address` must be an E.164 phone number. RCS has no email addressing, so an email is\nrejected with a `400` rather than attempted.\n\nA `200` means the check ran and the answer is about the **recipient**. A `503` means the\ncheck could not produce an answer because of a fault on the **sender** line β€” `4004`\n(RCS not turned on for the line), `4009` (line has no RCS account), or `4010` (the check\ncould not run). Treat all three as \"unknown\", never as \"the recipient does not support\nRCS\", and do not cache them as a negative result.\n\n\n### Parameters\n\n- `address: string`\n The recipient address to check. `check_imessage` accepts an E.164 phone number or an\nemail address; `check_rcs` accepts an E.164 phone number only and rejects an email\nwith a `400`, since RCS has no email addressing.\n\n\n- `from?: string`\n Optional sender phone number. If omitted, an available phone from your pool is used automatically.\n\n### Returns\n\n- `{ address: string; available: boolean; reason?: 'not_supported'; selected_service?: string; }`\n\n - `address: string`\n - `available: boolean`\n - `reason?: 'not_supported'`\n - `selected_service?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst handleCheckResponse = await client.capability.checkRCS({ address: '+15551234567' });\n\nconsole.log(handleCheckResponse);\n```",
2069
2069
  perLanguage: {
2070
- python: {
2071
- method: 'capability.check_RCS',
2072
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nhandle_check_response = client.capability.check_RCS(\n address="+15551234567",\n)\nprint(handle_check_response.address)',
2073
- },
2074
2070
  go: {
2075
2071
  method: 'client.Capability.CheckRCS',
2076
2072
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\thandleCheckResponse, err := client.Capability.CheckRCS(context.TODO(), linqgo.CapabilityCheckRCSParams{\n\t\tHandleCheck: linqgo.HandleCheckParam{\n\t\t\tAddress: "+15551234567",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", handleCheckResponse.Address)\n}\n',
2077
2073
  },
2074
+ python: {
2075
+ method: 'capability.check_RCS',
2076
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nhandle_check_response = client.capability.check_RCS(\n address="+15551234567",\n)\nprint(handle_check_response.address)',
2077
+ },
2078
2078
  typescript: {
2079
2079
  method: 'client.capability.checkRCS',
2080
2080
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst handleCheckResponse = await client.capability.checkRCS({ address: '+15551234567' });\n\nconsole.log(handleCheckResponse.address);",
@@ -2096,14 +2096,14 @@ const EMBEDDED_METHODS = [
2096
2096
  response: '{ contact_cards: { first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }[]; }',
2097
2097
  markdown: "## retrieve\n\n`client.contactCard.retrieve(phone_number?: string): { contact_cards: object[]; }`\n\n**get** `/v3/contact_card`\n\nReturns the contact card for a specific phone number, or all contact cards for the\nauthenticated partner if no `phone_number` is provided.\n\n\n### Parameters\n\n- `phone_number?: string`\n E.164 phone number to filter by. If omitted, all my cards for the partner are returned.\n\n### Returns\n\n- `{ contact_cards: { first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }[]; }`\n\n - `contact_cards: { first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }[]`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst contactCard = await client.contactCard.retrieve();\n\nconsole.log(contactCard);\n```",
2098
2098
  perLanguage: {
2099
- python: {
2100
- method: 'contact_card.retrieve',
2101
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\ncontact_card = client.contact_card.retrieve()\nprint(contact_card.contact_cards)',
2102
- },
2103
2099
  go: {
2104
2100
  method: 'client.ContactCard.Get',
2105
2101
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcontactCard, err := client.ContactCard.Get(context.TODO(), linqgo.ContactCardGetParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", contactCard.ContactCards)\n}\n',
2106
2102
  },
2103
+ python: {
2104
+ method: 'contact_card.retrieve',
2105
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\ncontact_card = client.contact_card.retrieve()\nprint(contact_card.contact_cards)',
2106
+ },
2107
2107
  typescript: {
2108
2108
  method: 'client.contactCard.retrieve',
2109
2109
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst contactCard = await client.contactCard.retrieve();\n\nconsole.log(contactCard.contact_cards);",
@@ -2125,14 +2125,14 @@ const EMBEDDED_METHODS = [
2125
2125
  response: '{ first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }',
2126
2126
  markdown: "## create\n\n`client.contactCard.create(first_name: string, phone_number: string, image_url?: string, last_name?: string): { first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }`\n\n**post** `/v3/contact_card`\n\nCreates a contact card for a phone number. This endpoint is intended for initial, one-time setup only.\n\nIf setup does not complete, the response is `500` (`2022`) β€” call this endpoint again.\n\nIf the upstream write is rate-limited, the response is `503` (`4004`) instead. Setup\ndid not complete and the card is not active β€” wait before retrying, because repeated\nattempts extend the rate limit.\n\n**Note:** once a card is active, this endpoint returns `409` (`2014`) so an existing\ncard is never overwritten by accident. Use `PATCH /v3/contact_card` to change it.\n\n\n### Parameters\n\n- `first_name: string`\n First name for the contact card. Required.\n\n- `phone_number: string`\n E.164 phone number to associate the contact card with\n\n- `image_url?: string`\n Profile image URL for the contact card.\n\n- `last_name?: string`\n Last name for the contact card. Optional.\n\n### Returns\n\n- `{ first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }`\n\n - `first_name: string`\n - `is_active: boolean`\n - `phone_number: string`\n - `image_url?: string`\n - `last_name?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst setContactCard = await client.contactCard.create({ first_name: 'Acme', phone_number: '+15551234567' });\n\nconsole.log(setContactCard);\n```",
2127
2127
  perLanguage: {
2128
- python: {
2129
- method: 'contact_card.create',
2130
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nset_contact_card = client.contact_card.create(\n first_name="Acme",\n phone_number="+15551234567",\n image_url="https://cdn.linqapp.com/contact-card/example.jpg",\n last_name="Support",\n)\nprint(set_contact_card.first_name)',
2131
- },
2132
2128
  go: {
2133
2129
  method: 'client.ContactCard.New',
2134
2130
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tsetContactCard, err := client.ContactCard.New(context.TODO(), linqgo.ContactCardNewParams{\n\t\tFirstName: "Acme",\n\t\tPhoneNumber: "+15551234567",\n\t\tImageURL: linqgo.String("https://cdn.linqapp.com/contact-card/example.jpg"),\n\t\tLastName: linqgo.String("Support"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", setContactCard.FirstName)\n}\n',
2135
2131
  },
2132
+ python: {
2133
+ method: 'contact_card.create',
2134
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nset_contact_card = client.contact_card.create(\n first_name="Acme",\n phone_number="+15551234567",\n image_url="https://cdn.linqapp.com/contact-card/example.jpg",\n last_name="Support",\n)\nprint(set_contact_card.first_name)',
2135
+ },
2136
2136
  typescript: {
2137
2137
  method: 'client.contactCard.create',
2138
2138
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst setContactCard = await client.contactCard.create({\n first_name: 'Acme',\n phone_number: '+15551234567',\n image_url: 'https://cdn.linqapp.com/contact-card/example.jpg',\n last_name: 'Support',\n});\n\nconsole.log(setContactCard.first_name);",
@@ -2154,14 +2154,14 @@ const EMBEDDED_METHODS = [
2154
2154
  response: '{ first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }',
2155
2155
  markdown: "## update\n\n`client.contactCard.update(phone_number: string, first_name?: string, image_url?: string, last_name?: string): { first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }`\n\n**patch** `/v3/contact_card`\n\nPartially updates the contact card for a phone number.\n\nFetches the current contact card and merges the provided fields.\nOnly fields present in the request body are updated; omitted fields retain their existing values.\n\nIf the update does not complete, the response is `500` (`2022`) β€” call this endpoint again.\n\nIf the upstream write is rate-limited, the response is `503` (`4004`) instead. The\nupdate did not reach the line, so the card is left not active β€” wait before retrying,\nbecause repeated attempts extend the rate limit.\n\n\n### Parameters\n\n- `phone_number: string`\n E.164 phone number of the contact card to update\n\n- `first_name?: string`\n Updated first name. If omitted, the existing value is kept.\n\n- `image_url?: string`\n Updated profile image URL. If omitted, the existing image is kept.\n\n- `last_name?: string`\n Updated last name. If omitted, the existing value is kept.\n\n### Returns\n\n- `{ first_name: string; is_active: boolean; phone_number: string; image_url?: string; last_name?: string; }`\n\n - `first_name: string`\n - `is_active: boolean`\n - `phone_number: string`\n - `image_url?: string`\n - `last_name?: string`\n\n### Example\n\n```typescript\nimport LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3();\n\nconst setContactCard = await client.contactCard.update({ phone_number: '+15551234567' });\n\nconsole.log(setContactCard);\n```",
2156
2156
  perLanguage: {
2157
- python: {
2158
- method: 'contact_card.update',
2159
- example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nset_contact_card = client.contact_card.update(\n phone_number="+15551234567",\n first_name="John",\n image_url="https://cdn.linqapp.com/contact-card/example.jpg",\n last_name="Doe",\n)\nprint(set_contact_card.first_name)',
2160
- },
2161
2157
  go: {
2162
2158
  method: 'client.ContactCard.Update',
2163
2159
  example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tsetContactCard, err := client.ContactCard.Update(context.TODO(), linqgo.ContactCardUpdateParams{\n\t\tPhoneNumber: "+15551234567",\n\t\tFirstName: linqgo.String("John"),\n\t\tImageURL: linqgo.String("https://cdn.linqapp.com/contact-card/example.jpg"),\n\t\tLastName: linqgo.String("Doe"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", setContactCard.FirstName)\n}\n',
2164
2160
  },
2161
+ python: {
2162
+ method: 'contact_card.update',
2163
+ example: 'import os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\nset_contact_card = client.contact_card.update(\n phone_number="+15551234567",\n first_name="John",\n image_url="https://cdn.linqapp.com/contact-card/example.jpg",\n last_name="Doe",\n)\nprint(set_contact_card.first_name)',
2164
+ },
2165
2165
  typescript: {
2166
2166
  method: 'client.contactCard.update',
2167
2167
  example: "import LinqAPIV3 from '@linqapp/sdk';\n\nconst client = new LinqAPIV3({\n apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted\n});\n\nconst setContactCard = await client.contactCard.update({\n phone_number: '+15551234567',\n first_name: 'John',\n image_url: 'https://cdn.linqapp.com/contact-card/example.jpg',\n last_name: 'Doe',\n});\n\nconsole.log(setContactCard.first_name);",
@@ -2174,12 +2174,12 @@ const EMBEDDED_METHODS = [
2174
2174
  ];
2175
2175
  const EMBEDDED_READMES = [
2176
2176
  {
2177
- language: 'python',
2178
- content: '# Linq API V3 Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/linq-python.svg?label=pypi%20(stable))](https://pypi.org/project/linq-python/)\n\nThe Linq API V3 Python library provides convenient access to the Linq API V3 REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Linq API V3 MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40linqapp%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBsaW5xYXBwL3Nkay1tY3AiXSwiZW52Ijp7IkxJTlFfQVBJX1YzX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiTElOUV9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40linqapp%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40linqapp%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22LINQ_API_V3_API_KEY%22%3A%22My%20API%20Key%22%2C%22LINQ_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.linqapp.com](https://docs.linqapp.com). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install linq-python\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\n\nchat = client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\nprint(chat.chat)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `LINQ_API_V3_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncLinqAPIV3` instead of `LinqAPIV3` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom linq import AsyncLinqAPIV3\n\nclient = AsyncLinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n chat = await client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\n print(chat.chat)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install linq-python[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom linq import DefaultAioHttpClient\nfrom linq import AsyncLinqAPIV3\n\nasync def main() -> None:\n async with AsyncLinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n chat = await client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\n print(chat.chat)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Linq API V3 API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\nall_chats = []\n# Automatically fetches more pages as needed.\nfor chat in client.chats.list_chats():\n # Do something with chat here\n all_chats.append(chat)\nprint(all_chats)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom linq import AsyncLinqAPIV3\n\nclient = AsyncLinqAPIV3()\n\nasync def main() -> None:\n all_chats = []\n # Iterate through items across all pages, issuing requests as needed.\n async for chat in client.chats.list_chats():\n all_chats.append(chat)\n print(all_chats)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.chats.list_chats()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.chats)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.chats.list_chats()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor chat in first_page.chats:\n print(chat.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\nchat = client.chats.create(\n from_="+12052535597",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello! How can I help you today?",\n }]\n },\n to=["+12052532136"],\n)\nprint(chat.message)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `linq.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `linq.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `linq.APIError`.\n\n```python\nimport linq\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\ntry:\n client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\nexcept linq.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept linq.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept linq.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom linq import LinqAPIV3\n\n# Configure the default for all requests:\nclient = LinqAPIV3(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom linq import LinqAPIV3\n\n# Configure the default for all requests:\nclient = LinqAPIV3(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = LinqAPIV3(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `LINQ_API_V3_LOG` to `info`.\n\n```shell\n$ export LINQ_API_V3_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\nresponse = client.chats.with_raw_response.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nchat = response.parse() # get the object that `chats.create()` would have returned\nprint(chat.chat)\n```\n\nThese methods return an [`APIResponse`](https://github.com/linq-team/linq-python/tree/main/src/linq/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/linq-team/linq-python/tree/main/src/linq/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.chats.with_streaming_response.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom linq import LinqAPIV3, DefaultHttpxClient\n\nclient = LinqAPIV3(\n # Or use the `LINQ_API_V3_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom linq import LinqAPIV3\n\nwith LinqAPIV3() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/linq-team/linq-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport linq\nprint(linq.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
2177
+ language: 'go',
2178
+ content: '# Linq API V3 Go API Library\n\n<a href="https://pkg.go.dev/github.com/linq-team/linq-go"><img src="https://pkg.go.dev/badge/github.com/linq-team/linq-go.svg" alt="Go Reference"></a>\n\nThe Linq API V3 Go library provides convenient access to the [Linq API V3 REST API](https://docs.linqapp.com)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Linq API V3 MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40linqapp%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBsaW5xYXBwL3Nkay1tY3AiXSwiZW52Ijp7IkxJTlFfQVBJX1YzX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiTElOUV9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40linqapp%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40linqapp%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22LINQ_API_V3_API_KEY%22%3A%22My%20API%20Key%22%2C%22LINQ_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/linq-team/linq-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/linq-team/linq-go@v0.62.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("LINQ_API_V3_API_KEY")\n\t)\n\tchat, err := client.Chats.New(context.TODO(), linqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.Chat)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Chats.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/linq-team/linq-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Chats.ListChatsAutoPaging(context.TODO(), linqgo.ChatListChatsParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tchat := iter.Current()\n\tfmt.Printf("%+v\\n", chat)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Chats.ListChats(context.TODO(), linqgo.ChatListChatsParams{})\nfor page != nil {\n\tfor _, chat := range page.Chats {\n\t\tfmt.Printf("%+v\\n", chat)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Chats.New(context.TODO(), linqgo.ChatNewParams{\n\tFrom: "+12052535597",\n\tMessage: linqgo.MessageContentParam{},\n\tTo: []string{"+12052532136"},\n})\nif err != nil {\n\tvar apierr *linqgo.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v3/chats": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Chats.New(\n\tctx,\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := linqgo.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Chats.New(\n\tcontext.TODO(),\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nchat, err := client.Chats.New(\n\tcontext.TODO(),\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", chat)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/linq-team/linq-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
2179
2179
  },
2180
2180
  {
2181
- language: 'go',
2182
- content: '# Linq API V3 Go API Library\n\n<a href="https://pkg.go.dev/github.com/linq-team/linq-go"><img src="https://pkg.go.dev/badge/github.com/linq-team/linq-go.svg" alt="Go Reference"></a>\n\nThe Linq API V3 Go library provides convenient access to the [Linq API V3 REST API](https://docs.linqapp.com)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Linq API V3 MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40linqapp%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBsaW5xYXBwL3Nkay1tY3AiXSwiZW52Ijp7IkxJTlFfQVBJX1YzX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiTElOUV9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40linqapp%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40linqapp%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22LINQ_API_V3_API_KEY%22%3A%22My%20API%20Key%22%2C%22LINQ_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/linq-team/linq-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/linq-team/linq-go@v0.62.0\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/linq-team/linq-go"\n\t"github.com/linq-team/linq-go/option"\n)\n\nfunc main() {\n\tclient := linqgo.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("LINQ_API_V3_API_KEY")\n\t)\n\tchat, err := client.Chats.New(context.TODO(), linqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.Chat)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Chats.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/linq-team/linq-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Chats.ListChatsAutoPaging(context.TODO(), linqgo.ChatListChatsParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tchat := iter.Current()\n\tfmt.Printf("%+v\\n", chat)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Chats.ListChats(context.TODO(), linqgo.ChatListChatsParams{})\nfor page != nil {\n\tfor _, chat := range page.Chats {\n\t\tfmt.Printf("%+v\\n", chat)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Chats.New(context.TODO(), linqgo.ChatNewParams{\n\tFrom: "+12052535597",\n\tMessage: linqgo.MessageContentParam{},\n\tTo: []string{"+12052532136"},\n})\nif err != nil {\n\tvar apierr *linqgo.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v3/chats": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Chats.New(\n\tctx,\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := linqgo.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Chats.New(\n\tcontext.TODO(),\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nchat, err := client.Chats.New(\n\tcontext.TODO(),\n\tlinqgo.ChatNewParams{\n\t\tFrom: "+12052535597",\n\t\tMessage: linqgo.MessageContentParam{},\n\t\tTo: []string{"+12052532136"},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", chat)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/linq-team/linq-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
2181
+ language: 'python',
2182
+ content: '# Linq API V3 Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/linq-python.svg?label=pypi%20(stable))](https://pypi.org/project/linq-python/)\n\nThe Linq API V3 Python library provides convenient access to the Linq API V3 REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Linq API V3 MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40linqapp%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBsaW5xYXBwL3Nkay1tY3AiXSwiZW52Ijp7IkxJTlFfQVBJX1YzX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiTElOUV9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40linqapp%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40linqapp%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22LINQ_API_V3_API_KEY%22%3A%22My%20API%20Key%22%2C%22LINQ_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.linqapp.com](https://docs.linqapp.com). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install linq-python\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\n\nchat = client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\nprint(chat.chat)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `LINQ_API_V3_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncLinqAPIV3` instead of `LinqAPIV3` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom linq import AsyncLinqAPIV3\n\nclient = AsyncLinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n chat = await client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\n print(chat.chat)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install linq-python[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom linq import DefaultAioHttpClient\nfrom linq import AsyncLinqAPIV3\n\nasync def main() -> None:\n async with AsyncLinqAPIV3(\n api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n chat = await client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\n print(chat.chat)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Linq API V3 API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\nall_chats = []\n# Automatically fetches more pages as needed.\nfor chat in client.chats.list_chats():\n # Do something with chat here\n all_chats.append(chat)\nprint(all_chats)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom linq import AsyncLinqAPIV3\n\nclient = AsyncLinqAPIV3()\n\nasync def main() -> None:\n all_chats = []\n # Iterate through items across all pages, issuing requests as needed.\n async for chat in client.chats.list_chats():\n all_chats.append(chat)\n print(all_chats)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.chats.list_chats()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.chats)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.chats.list_chats()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor chat in first_page.chats:\n print(chat.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\nchat = client.chats.create(\n from_="+12052535597",\n message={\n "parts": [{\n "type": "text",\n "value": "Hello! How can I help you today?",\n }]\n },\n to=["+12052532136"],\n)\nprint(chat.message)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `linq.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `linq.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `linq.APIError`.\n\n```python\nimport linq\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\n\ntry:\n client.chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n )\nexcept linq.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept linq.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept linq.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom linq import LinqAPIV3\n\n# Configure the default for all requests:\nclient = LinqAPIV3(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom linq import LinqAPIV3\n\n# Configure the default for all requests:\nclient = LinqAPIV3(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = LinqAPIV3(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).chats.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `LINQ_API_V3_LOG` to `info`.\n\n```shell\n$ export LINQ_API_V3_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom linq import LinqAPIV3\n\nclient = LinqAPIV3()\nresponse = client.chats.with_raw_response.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nchat = response.parse() # get the object that `chats.create()` would have returned\nprint(chat.chat)\n```\n\nThese methods return an [`APIResponse`](https://github.com/linq-team/linq-python/tree/main/src/linq/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/linq-team/linq-python/tree/main/src/linq/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.chats.with_streaming_response.create(\n from_="+12052535597",\n message={},\n to=["+12052532136"],\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom linq import LinqAPIV3, DefaultHttpxClient\n\nclient = LinqAPIV3(\n # Or use the `LINQ_API_V3_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom linq import LinqAPIV3\n\nwith LinqAPIV3() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/linq-team/linq-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport linq\nprint(linq.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
2183
2183
  },
2184
2184
  {
2185
2185
  language: 'typescript',