---
title: "Create link"
method: POST
path: "/links/create"
tags: ["Links"]
---

# Create link

`POST /links/create`

## Request

- Base URL: `https://api.databuddy.cc`
- URL: `https://api.databuddy.cc/links/create`
- Auth: API key in header `x-api-key`

Creates a new short link. To file it, pass folderId for an existing folder, or folder ({ name, slug? }) to use the folder with that slug and create it if missing; the slug defaults to one derived from name. Requires write:links scope.

## Request body

- object
  - `organizationId` string
  - `name` string, required
  - `targetUrl` string, uri, required
  - `slug` string
  - `folderId` string, nullable
  - `expiresAt` string, date-time, nullable
  - `expiredRedirectUrl` string, uri, nullable
  - `ogTitle` string, nullable
  - `ogDescription` string, nullable
  - `ogImageUrl` string, uri, nullable
  - `ogVideoUrl` string, uri, nullable
  - `iosUrl` string, uri, nullable
  - `androidUrl` string, uri, nullable
  - `externalId` string, nullable
  - `sourceType` string, nullable
  - `sourceId` string, nullable
  - `sourceOwnerId` string, nullable
  - `targetDomain` string, nullable
  - `deepLinkApp` 'instagram' | 'tiktok' | 'youtube' | 'x' | 'spotify' | 'linkedin' | 'facebook' | 'whatsapp' | 'telegram', nullable
  - `folder` object
    - `name` string, required
    - `slug` string

## Response `200`

OK

- object
  - `id` string, required
  - `organizationId` string, required
  - `createdBy` string, nullable, required
  - `folderId` string, nullable, required
  - `slug` string, required
  - `name` string, required
  - `targetUrl` string, required
  - `targetDomain` string, nullable, required
  - `sourceType` string, nullable, required
  - `sourceId` string, nullable, required
  - `sourceOwnerId` string, nullable, required
  - `expiresAt` string, date-time, nullable, required
  - `expiredRedirectUrl` string, nullable, required
  - `ogTitle` string, nullable, required
  - `ogDescription` string, nullable, required
  - `ogImageUrl` string, nullable, required
  - `ogVideoUrl` string, nullable, required
  - `iosUrl` string, nullable, required
  - `androidUrl` string, nullable, required
  - `externalId` string, nullable, required
  - `deepLinkApp` string, nullable, required
  - `deletedAt` string, date-time, nullable, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

[API](https://skmtc.dev/databuddy/apis/databuddy-api.md) - [All operations](https://skmtc.dev/databuddy/apis/databuddy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/databuddy/apis/databuddy-api/revisions/ddfbba648d52?raw)
