---
title: "Generate Share Link"
method: POST
path: "/api/v1/project/{project_id}/share"
tags: ["project"]
---

# Generate Share Link

`POST /api/v1/project/{project_id}/share`

Generate a share link for a project (idempotent).

If an active share link already exists, returns it. Otherwise creates
a new one with a unique token. Requires write access to the project.

Args:
    project_id: UUID of the project (validated for write access)
    share_service: ProjectShareService for share link operations

Returns:
    Share link details including full URL, token, and status

## Request body

- ShareLinkCreateRequest
  - `duration_days` integer
  - `consumer_domain_override` boolean

## Response `200`

Successful Response

- ShareLinkResponse — Response containing share link details for a project owner.
  - `share_url` string, required
  - `share_token` string, required
  - `is_active` boolean, required
  - `view_count` integer, required
  - `created_at` string, date-time, nullable
  - `access_mode` 'geometry_only' | 'gated', required
  - `duration_days` integer, nullable
  - `expires_at` string, date-time, nullable
  - `consumer_domain_override` boolean

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-21** `b455048a022d` — 6 info
  - added optional request body
  - added the non-success response with the status `422`
  - added the optional property `consumer_domain_override` to the response with the `200` status
  - added the optional property `duration_days` to the response with the `200` status
  - …2 more

[Change history](https://skmtc.dev/maia-analytics/apis/maia-api/changes/api/v1/project/:project_id/share/post.md)

---

[API](https://skmtc.dev/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.dev/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/revisions/0c94a4b5a00e/schema)
