---
title: "Get a signed URL for a user to access the embedded iFrame or WebView app"
method: POST
path: "/v1/user/{userId}/signedAppUrl/"
tags: ["/v1/user"]
---

# Get a signed URL for a user to access the embedded iFrame or WebView app

`POST /v1/user/{userId}/signedAppUrl/`

## Request

- Base URL: `https://api.counselhealth.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.counselhealth.com/v1/user/{userId}/signedAppUrl/`
- Auth: HTTP bearer

The signed URL is valid for one-time use until the expiry time (default 7 days, but can be configured). If this API is called multiple times for the same user, the same URL is returned if it has not already been used.
  Idempotency-Key response replays are available for one day after the request completes. Replays are best-effort: keys may be lost before the one-day window elapses, in which case a retry is executed as a new request.

## Path parameters

- `userId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `action` union
    - object
      - `action` 'create_thread', required
      - `module` string
      - `initial_messages` object[]
        - `body` string, required
        - `role` 'patient' | 'model'
      - `metadata` object: Custom key-value metadata for threads. Max 25 keys, each value ≤ 1800 characters. Keys must be alphanumeric with underscores/hyphens only.
    - object
      - `action` 'open_thread', required
      - `thread_id` string, uuid, required
    - object
      - `action` 'open_page', required
      - `page` 'consents' | 'enroll', required
    - object: Starting a thread in a module results in one of two end states. Without initial_messages the session opens as a draft: the user lands on the module's home screen with smart pills, and the thread is created once they pick one or send a message. With initial_messages the thread is immediately created, seeded with those messages. Metadata is persisted on the thread when it is created.
      - `action` 'start_thread', required
      - `module` string
      - `initial_messages` object[]
        - `body` string, required
        - `role` 'patient' | 'model'
      - `metadata` object: Custom key-value metadata for threads. Max 25 keys, each value ≤ 1800 characters. Keys must be alphanumeric with underscores/hyphens only.
  - `view` object
    - `theme` 'light' | 'dark' | 'system'
    - `navigation` 'standalone' | 'integrated'
  - `metadata` object
    - `app_name` string
  - `agent_context` object

## Response `200`

Default Response

- object
  - `url` string, uri, required
  - `expiry` string, date-time, required: datetime in ISO 8601 format

## Other responses

- `400`: 400 error with a machine-readable `code` for client branching.
- `401`: Standard error body returned for non-2xx responses.
- `403`: Standard error body returned for non-2xx responses.
- `404`: Standard error body returned for non-2xx responses.
- `409`: Standard error body returned for non-2xx responses.
- `413`: Standard error body returned for non-2xx responses.
- `429`: Standard error body returned for non-2xx responses.
- `500`: Standard error body returned for non-2xx responses.
- `502`: Default Response
- `503`: Default Response
- `504`: Default Response

---

[API](https://skmtc.dev/counselhealth/apis/counsel-api.md) - [All operations](https://skmtc.dev/counselhealth/apis/counsel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/counselhealth/apis/counsel-api/revisions/4110a89127e8?raw)
