---
title: "ReleaseDemoCredential"
description: "Release a demo credential"
canonical: "https://pgbeam.com/docs/go-sdk/demo/releaseDemoCredential"
last-updated: "2026-10-08T10:00:49.000Z"
---

# ReleaseDemoCredential

> Release a demo credential

URL: https://pgbeam.com/docs/go-sdk/demo/releaseDemoCredential

Revokes a demo credential before its TTL runs out and returns its slot to the global ceiling. Callers that finish early should do this so the next evaluating agent is not turned away by a session nobody is using. The MCP token issued with the credential proves the caller holds it. Releasing an already-expired or already-released session succeeds with released=false.

## Usage

## Parameters

Parameter

Type

Required

Description

ctx

`context.Context`

Yes

Request context

sessionID

`string`

Yes

The demo session to release, as returned when it was issued.

req

`pgbeam.ReleaseDemoCredentialRequest`

Yes

Request body

req.McpToken

`string`

Yes

The mcp_token returned when the credential was issued.

## Response

`(*pgbeam.DemoReleaseResult, error)`: the session was released, or was already gone.

## Example

## Errors

Status

Description

400

The request was rejected. `code` is `INVALID_INPUT`, and `errors` names the offending fields when the failure was a validation one.

401

Missing or invalid authentication. `code` is `UNAUTHORIZED`.

404

The resource does not exist, or the caller is not entitled to know that it does. `code` is `NOT_FOUND`.

429

Rate limited. `code` is `RATE_LIMITED`.

503

The service is temporarily unable to answer. `code` is `SERVICE_UNAVAILABLE`. Safe to retry after the delay in `Retry-After`.