> ## Documentation Index
> Fetch the complete documentation index at: https://okl-ink.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Link

> Append a new link tile to an okl.ink page bento grid.

# Add Link

Adds a new link tile to the specified project. The tile is automatically assigned the next available position at the bottom of the grid. Requires `pages:write` scope.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with `pages:write` scope.
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  The project ID.
</ParamField>

### Request Body

<ParamField body="url" type="string" required>
  The destination `http(s)` URL.
</ParamField>

<ParamField body="type" type="string" default="other">
  One of: `live-demo`, `github`, `documentation`, `youtube`, `x`, `linkedin`, `product-hunt`, `devpost`, `blog`, `other`.
</ParamField>

<ParamField body="title" type="string">
  Custom display title for the tile.
</ParamField>

<ParamField body="size" type="string" default="2x1">
  Tile size: `1x1`, `2x1`, `2x2`, `4x1`. (Social links like `x`, `twitter`, `linkedin` automatically default to `2x2`).
</ParamField>

<ParamField body="thumbnail" type="string">
  Optional custom thumbnail image URL.
</ParamField>

### Response

<ResponseField name="id" type="string">Created Link ID</ResponseField>
<ResponseField name="type" type="string">Link type</ResponseField>
<ResponseField name="url" type="string">Destination URL</ResponseField>
<ResponseField name="position" type="number">Zero-indexed grid index</ResponseField>
<ResponseField name="title" type="string | null">Tile Title</ResponseField>
<ResponseField name="size" type="string">Tile grid span</ResponseField>
<ResponseField name="thumbnail" type="string | null">Thumbnail URL</ResponseField>
<ResponseField name="active" type="boolean">Active state</ResponseField>
<ResponseField name="highlighted" type="boolean">Highlight state</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://okl.ink/api/v1/pages/cly1019283749/links \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://github.com/hebuildapps/demo-links",
      "type": "github",
      "title": "okl.ink Source Code",
      "size": "2x1"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "cmsh_link_99",
    "type": "github",
    "url": "https://github.com/hebuildapps/demo-links",
    "position": 0,
    "title": "okl.ink Source Code",
    "size": "2x1",
    "thumbnail": null,
    "active": true,
    "highlighted": false
  }
  ```
</ResponseExample>
