---
title: "Publish a briq on its HTTPS URL"
method: POST
path: "/v1/briqs/{id}/expose"
tags: ["briqs"]
---

# Publish a briq on its HTTPS URL

`POST /v1/briqs/{id}/expose`

## Request

- Base URL: `https://api.briq.cloud`
- URL: `https://api.briq.cloud/v1/briqs/{id}/expose`
- Auth: HTTP bearer

A briq has one URL, on one port. Its front door (`spec.expose`, or its only port) is published at once; another port moves the URL there and restarts the machine, which `warning` says. `mode` left out keeps the URL's mode (a first URL is public). `rotate: true` gives a private URL a new token. An undeclared port is refused once the spec declares 32.

## Path parameters

- `id` string, required

## Request body

- object
  - `port` integer, required
  - `protocol` 'http' | 'postgres' | 'mysql' | 'redis' | 'mongodb' | 'amqp' | 'bolt' | 'grpc': http (default): an HTTPS URL. postgres, mysql, redis, mongodb, amqp, bolt or grpc: a TCP endpoint, reachable from outside over TLS
  - `mode` 'public' | 'private': Left out, the URL keeps the mode it has; a first URL is public
  - `rotate` boolean: A new token for a private URL: old links and cookies stop working. Refused for a public URL

## Response `201`

ok

- object
  - `id` string, required
  - `port` number, required
  - `protocol` 'http' | 'postgres' | 'mysql' | 'redis' | 'mongodb' | 'amqp' | 'bolt' | 'grpc': A database protocol: a TCP endpoint, reachable from outside over TLS; absent: a URL
  - `mode` 'public' | 'private', required
  - `url` string, required: The URL to share; a private URL carries its token. A TCP endpoint: its connection string without the password
  - `hostname` string, required
  - `connectionString` string: A TCP endpoint: the connection string, TLS required; a recipe's carries its password
  - `credentials` string: What the connection string cannot carry: a user, an API key
  - `warning` string: The machine restarted to deliver this port, or the URL moved here from another

## Other responses

- `400`: validation
- `401`: unauthorized
- `402`: policy_violation or quota_exceeded (the key's policy), or payment_required (no credits: retrying cannot help)
- `403`: forbidden, or plan_limit (the team's plan does not allow it)
- `404`: not found
- `409`: invalid_state: not possible in the briq's current state; the message says why
- `413`: validation: the body, the command or its output is too large
- `429`: rate limited: retry after the `retry-after` header
- `502`: provider_error: the infrastructure refused the change
- `503`: provider_error: the infrastructure did not answer; retry in a moment

---

[API](https://skmtc.dev/briq/apis/briq-api.md) · [All operations](https://skmtc.dev/briq/apis/briq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/briq/apis/briq-api/revisions/609b424459cb?raw)
