BIO.RE
Creator

Delete Bio Link

Hard-delete a single bio link by id. Ownership-checked. The owning creator's public bio cache is invalidated; cache lookup failures don't block the delete.

DELETE /api/v1/creators/links/:linkId — 🔑 Bearer · Rate limit: 30 req / hour

Hard-deletes a BioLink row. Ownership is checked via the link's bio page → creator → user chain. The owning creatorId is fetched before the delete so the public bio cache can be invalidated even after the row is gone — failures of that pre-lookup are swallowed and the delete proceeds.

Hard delete, not soft. Use PATCH /creators/links/:linkId with active: false if you want a temporarily-hidden link the creator can re-enable. There's no recycle bin or undo flow on this endpoint.

Request

Path parameters

ParamTypeValidationNotes
linkIdstring (UUID)ParseUUIDPipeMust belong to a bio page owned by the bearer's user

No body.

HeaderRequiredNotes
Authorization: Bearer <accessToken>JWT from POST /auth/login

Response

200 OKSuccessOnlyResponseDto

{
  "success": true
}
FieldTypeNotes
successbooleanAlways true on 200. The link no longer exists; sortOrder of remaining links is not automatically compacted (call POST /creators/:creatorId/links/reorder if your UI requires gap-free ordering).

Errors

HTTPcode / i18nKeyReason
400(validation)linkId not a valid UUID
401(guard)Missing / invalid bearer token
403creator.links.not_ownerLink's bio page belongs to a different user
404creator.links.not_foundBioLink row missing
429(throttle)Rate limit exceeded (30 req/hour)

Side effects

  1. Ownership checkverifyLinkOwnership(linkId, userId) → 403 on mismatch.
  2. Pre-fetch creatorId — read the link's bioPage.creatorId while the row still exists (failures are caught and ignored — the delete still proceeds).
  3. prisma.bioLink.delete({ where: { id: linkId } }).
  4. If the pre-fetch succeeded: invalidateBioCache(creatorId). Otherwise the cache will expire naturally.

Code samples

curl -X DELETE https://api.bio.re/api/v1/creators/links/l1a2b3c4-d5e6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer $ACCESS_TOKEN"
async function deleteBioLink(accessToken: string, linkId: string): Promise<void> {
  const res = await fetch(`https://api.bio.re/api/v1/creators/links/${linkId}`, {
    method: 'DELETE',
    headers: { Authorization: `Bearer ${accessToken}` },
  });
  const json = await res.json();
  if (!res.ok || !json.success) {
    throw Object.assign(new Error(json?.error?.message ?? 'Delete link failed'), {
      code: json?.error?.code,
    });
  }
}
import { useMutation, useQueryClient } from '@tanstack/react-query';

export function useDeleteBioLink(creatorId: string) {
  const qc = useQueryClient();
  return useMutation({
    mutationFn: async (linkId: string) => {
      const res = await fetch(`/api/v1/creators/links/${linkId}`, { method: 'DELETE' });
      const json = await res.json();
      if (!res.ok || !json.success) {
        throw Object.assign(new Error(json?.error?.message ?? 'Delete link failed'), {
          code: json?.error?.code,
          i18nKey: json?.error?.i18nKey,
        });
      }
    },
    onSuccess: () => {
      qc.invalidateQueries({ queryKey: ['creators', creatorId, 'bio'] });
    },
  });
}

Try it

DELETE
/api/v1/creators/links/{linkId}
AuthorizationBearer <token>

In: header

Path Parameters

linkId*string

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/api/v1/creators/links/string"
{
  "success": true
}
{
  "success": false,
  "error": {
    "code": "AUTH_UNAUTHORIZED",
    "message": "Invalid credentials",
    "i18nKey": "auth.login.invalid_credentials",
    "i18nVars": {
      "field": "email"
    },
    "details": [
      {
        "message": "email must be an email"
      }
    ],
    "correlationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH_UNAUTHORIZED",
    "message": "Invalid credentials",
    "i18nKey": "auth.login.invalid_credentials",
    "i18nVars": {
      "field": "email"
    },
    "details": [
      {
        "message": "email must be an email"
      }
    ],
    "correlationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH_UNAUTHORIZED",
    "message": "Invalid credentials",
    "i18nKey": "auth.login.invalid_credentials",
    "i18nVars": {
      "field": "email"
    },
    "details": [
      {
        "message": "email must be an email"
      }
    ],
    "correlationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

Source

SourcePathLines
Controllerapps/api-core/src/modules/creator/creator.controller.ts176–187 (deleteLink), 107–114 (verifyLinkOwnership)
DTO (response)apps/api-core/src/common/dto/common-response.dto.tsSuccessOnlyResponseDto
Serviceapps/api-core/src/modules/creator/creator.service.ts444–462 (deleteLink)
Prisma modelspackages/prisma/prisma/schema.prismaBioLink, BioPage (relation chain for ownership)

On this page