> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surnex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a share link

> Generate a public share link for a report. The link is identified by a randomly generated opaque token and can be optionally protected with a password (stored as a bcrypt hash) and/or set to expire at a specific UTC datetime. The plain-text password is returned only in this response — it cannot be retrieved later.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/reports/{report_id}/share
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/reports/{report_id}/share:
    post:
      tags:
        - Reports
      summary: Create a share link
      description: >-
        Generate a public share link for a report. The link is identified by a
        randomly generated opaque token and can be optionally protected with a
        password (stored as a bcrypt hash) and/or set to expire at a specific
        UTC datetime. The plain-text password is returned only in this response
        — it cannot be retrieved later.
      operationId: create_share_v1_projects__project_id__reports__report_id__share_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: report_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Report Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportShareCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_ReportShareResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ReportShareCreate:
      properties:
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: >-
            Optional UTC datetime at which the share link becomes inactive. Null
            means the link never expires.
        password:
          anyOf:
            - type: string
              minLength: 4
            - type: 'null'
          title: Password
          description: >-
            Optional password to gate access to the shared report. Must be at
            least 4 characters when provided.
      type: object
      title: ReportShareCreate
      description: Request body for generating a public share link for a report.
    APIResponse_ReportShareResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/ReportShareResponse'
            - type: 'null'
      type: object
      title: APIResponse[ReportShareResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ReportShareResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        token:
          type: string
          title: Token
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        is_active:
          type: boolean
          title: Is Active
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - token
        - is_active
        - created_at
      title: ReportShareResponse
      description: A public share link record for a report.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````