Links
Create tracked links.
Create links
POST
links:writeIdempotency-Key required/v1/links/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
destination_urlrequired | string (uri) | max length 2048 |
namerequired | string | max length 255 |
og_description | string | max length 5000 |
og_image_url | string (uri) | max length 2048 |
og_title | string | max length 255 |
slug | string | max length 255 |
Response fields (201)
| Field | Type | Notes |
|---|---|---|
created_at | string (date-time) | read-only |
destination_url | string | read-only |
domain | string | read-only |
id | string | read-only |
name | string | read-only |
og_description | string | read-only |
og_image_url | string | read-only |
og_title | string | read-only |
short_url | string | read-only |
slug | string | read-only |
Responses
201Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.409The write conflicts with current state or an identical request is still running.422The write contains fields outside its closed input schema.429The request-rate budget is exhausted.
Example request
curl
curl -X POST "https://api.themochi.app/v1/links/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"destination_url":"string","name":"string"}'