Skip to Content

Update trace sharing

PATCHhttps://api.respan.ai/api/traces/{trace_unique_id}/

Set public-sharing metadata for a trace ID. This operation upserts the sharing record and returns 200 when is_public is supplied; it does not first verify that trace spans exist.

Servers

https://api.respan.ai: Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Or:

DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: bearer; format: Dashboard JWT.

HTTP
Authorization: Bearer $RESPAN_DASHBOARD_JWT

Path parameters

Parameter Type Required Description and constraints
trace_unique_id string Required
Unique trace identifier.

Request body

A request body is required.

application/json

Field Type Requirement Description and constraints
$ object Required body
-
is_public boolean Required in parent
Set true to make the trace public, or false to revoke public access.
Example: true

OpenAPI request schema

{
  "type": "object",
  "properties": {
    "is_public": {
      "type": "boolean",
      "description": "Set `true` to make the trace public, or `false` to revoke public access.",
      "example": true
    }
  },
  "required": [
    "is_public"
  ]
}

Responses

200

Trace sharing state updated.

application/json

Field Type Requirement Description and constraints
$ object Body
-
trace_unique_id string Required in parent
-
is_public boolean Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "trace_unique_id": {
      "type": "string"
    },
    "is_public": {
      "type": "boolean"
    }
  },
  "required": [
    "trace_unique_id",
    "is_public"
  ]
}
Example
JSON
{ "trace_unique_id": "trace_abc123", "is_public": true }

400

Bad Request

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Optional
Example: "is_public field required"

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "example": "is_public field required"
    }
  }
}

403

The API key is missing, invalid or expired.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Update trace sharing",
  "operationId": "shareTrace",
  "tags": [
    "Traces"
  ],
  "description": "Set public-sharing metadata for a trace ID. This operation upserts the sharing record and returns `200` when `is_public` is supplied; it does not first verify that trace spans exist.",
  "parameters": [
    {
      "name": "trace_unique_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Unique trace identifier."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "is_public": {
              "type": "boolean",
              "description": "Set `true` to make the trace public, or `false` to revoke public access.",
              "example": true
            }
          },
          "required": [
            "is_public"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Trace sharing state updated.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "trace_unique_id": {
                "type": "string"
              },
              "is_public": {
                "type": "boolean"
              }
            },
            "required": [
              "trace_unique_id",
              "is_public"
            ]
          },
          "example": {
            "trace_unique_id": "trace_abc123",
            "is_public": true
          }
        }
      }
    },
    "400": {
      "description": "Bad Request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "detail": {
                "type": "string",
                "example": "is_public field required"
              }
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}