---
raw: true
search:
  tags:
    - Tags
    - POST
seo:
  description: >-
    Creates a temporary preview token… Reference for the POST
    /v1/spaces/{spaceId}/tags/revisions/{revisionId}/preview-sessions endpoint
    in the Spacefast API.
sidebar:
  label: Create a tag preview session
  badge: POST
title: Create a tag preview session
type: openapi-operation
---
Creates a temporary preview token that loads an unreleased space tag revision for a chosen URL or environment.

`POST /v1/spaces/{spaceId}/tags/revisions/{revisionId}/preview-sessions`

**Request body** (`application/json`, required)

- `url` (string<uri>)
- `ttlSeconds` (integer)
- `environment` (string)

Request body example:

```json
{
  "url": "http://example.com",
  "ttlSeconds": 3600,
  "environment": "production"
}
```

**Responses**

- `201` — Response for status 201
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 201:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "revisionId": "string",
    "environment": "production",
    "previewUrl": "string",
    "sdkRevision": "string",
    "cacheMode": "public, max-age=0, s-maxage=60, must-revalidate",
    "websocket": {
      "enabled": true
    },
    "createdAt": "string",
    "expiresAt": "string",
    "revokedAt": "string"
  }
}
```
