Documentation Index
Fetch the complete documentation index at: https://docs.linkutm.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
UTM parameters define a workspace’s controlled vocabulary for UTM fields. The model is two-level: parent parameters (such assource, medium, campaign) and their child values (such as google, cpc, spring_sale). A child links to its parent through parentCode. Every endpoint lives under /api/v1/parameters, requires a JWT, and is workspace-scoped.
Parameter fields
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | Server-generated. |
name | string | Display label, e.g., Source. |
code | string | Machine code. Lowercased on create. Unique per workspace. |
tooltip | string | null | Short hint shown in the UI. |
description | string | null | Longer description. |
weight | integer | Sort order within its level. Defaults to 0. |
parentCode | string | null | code of the parent parameter. null for a top-level parameter. |
isSystem | boolean | true for seeded standard parameters. System parameters have edit restrictions. |
canEdit | boolean | Whether the parameter can be edited. Defaults to true for custom parameters. |
canDelete | boolean | Whether the parameter can be deleted. Defaults to true for custom parameters. |
workspaceId | string (UUID) | Set on creation; immutable. |
createdById | string (UUID) | User who created the parameter. |
updatedById | string (UUID) | null | User who last updated the parameter. |
createdBy | object | Included on list and get responses: { id, name, email }. |
createdAt | timestamp | UTC. |
updatedAt | timestamp | UTC. |
Create a parameter
parentCode to create a child value under an existing parameter.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
x-workspace-id: <uuid_or_slug> | Yes | Target workspace |
Content-Type: application/json | Yes |
Body
Display label.
Machine code. Lowercased before save. Must be unique within the workspace.
Short hint.
Longer description.
Sort order within the parameter’s level.
code of an existing parameter in the same workspace. When set, the new parameter is created as a child value. The parent must already exist.Custom parameters are always created with
isSystem=false, canEdit=true, and canDelete=true. The isSystem, canEdit, and canDelete flags are only set internally by the seed routine.Example request
Example response
Errors
| Code | When |
|---|---|
400 | parentCode is set but no parameter with that code exists in the workspace |
401 | Missing or invalid JWT |
409 | A parameter with the same code already exists in the workspace |
List parameters
weight ascending, then createdAt ascending. Each item includes the createdBy user object.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
x-workspace-id: <uuid_or_slug> | Yes | Target workspace |
Query parameters
Page number.
Items per page.
Case-insensitive substring match against
name, code, and description.Filter by parent code. Pass a parent
code to return only that parameter’s child values. Pass an empty string to return only top-level parameters (those with parentCode null). Omit to return all parameters.Example request
Example response
Errors
| Code | When |
|---|---|
401 | Missing or invalid JWT |
List parameters hierarchically
children array. Both levels are sorted by weight ascending, then createdAt ascending. This endpoint is not paginated.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
x-workspace-id: <uuid_or_slug> | Yes | Target workspace |
Example request
Example response
Errors
| Code | When |
|---|---|
401 | Missing or invalid JWT |
Seed default parameters
source, medium, campaign, term, content) plus a starter set of child values for each. The five parents are created as system parameters (isSystem=true, canEdit=false, canDelete=false). The seeded child values are regular parameters (isSystem=false, canEdit=true, canDelete=true).
The seed is idempotent: if the workspace already has any system parameter, nothing is created and seeded is false.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
x-workspace-id: <uuid_or_slug> | Yes | Target workspace |
Content-Type: application/json | Yes |
Example request
Example response
When the seed runs:Errors
| Code | When |
|---|---|
401 | Missing or invalid JWT |
Reorder parameters
weight of each listed parameter to its index in the array. The first ID gets weight 0, the second 1, and so on. Send the parameter IDs in the order you want them sorted.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
x-workspace-id: <uuid_or_slug> | Yes | Target workspace |
Content-Type: application/json | Yes |
Body
Ordered array of parameter UUIDs. Each parameter’s
weight is set to its position in the array.Reorder updates every ID in the array regardless of
isSystem, canEdit, or level. Include only the IDs you intend to re-weight - typically all parameters of one level.Example request
Example response
Errors
| Code | When |
|---|---|
401 | Missing or invalid JWT |
404 | One of the supplied IDs does not exist |
Get a parameter
createdBy user object.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes |
Example request
Example response
Errors
| Code | When |
|---|---|
401 | Missing or invalid JWT |
404 | Parameter not found |
Update a parameter
code and parentCode cannot be changed.
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes | |
Content-Type: application/json | Yes |
Body
Display label.
Short hint.
Longer description.
Sort order within the parameter’s level.
Behavior
- A parameter with
canEdit=falsethat is not a system parameter cannot be edited - the request fails with400. - For system parameters (
isSystem=true), onlynameandtooltipare applied. Anydescriptionorweightyou send is ignored. - For non-system parameters,
name,tooltip,description, andweightare all applied. - The user making the request is recorded as
updatedById.
Example request
Example response
Errors
| Code | When |
|---|---|
400 | Parameter has canEdit=false and is not a system parameter |
401 | Missing or invalid JWT |
404 | Parameter not found |
Delete a parameter
Headers
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <jwt> | Yes |
Behavior
- A parameter with
canDelete=falsecannot be deleted - the request fails with400. The five seeded system parameters havecanDelete=false. - A parameter that still has child values cannot be deleted - the request fails with
400. The message reports the child count. Delete the child values first.
Example request
Example response
Returns the deleted parameter record.Errors
| Code | When |
|---|---|
400 | Parameter has canDelete=false, or it still has one or more child values |
401 | Missing or invalid JWT |
404 | Parameter not found |