---
title: "create ssh_portal_connection"
method: POST
path: "/operations/{operation_id}/ssh_portal_connections"
tags: ["SshPortalConnections"]
---

# create ssh_portal_connection

`POST /operations/{operation_id}/ssh_portal_connections`

## Request

- Base URL: `https://api.aptible.com`
- URL: `https://api.aptible.com/operations/{operation_id}/ssh_portal_connections`
- Auth: API key in header `Authorization`

Creates a new SSH portal connection for the specified operation.

## Path parameters

- `operation_id` integer, required

## Query parameters

- `no_embed` boolean

## Headers

- `Prefer` 'no_sensitive_extras=true'

## Request body

- CreateSshPortalConnectionRequest
  - `ssh_public_key` string, required
  - `command` string

## Response `201`

successful

- SshPortalConnection
  - `id` string, uuid, required
  - `_type` string, required
  - `ssh_user` string, required
  - `ssh_certificate_body` string, required
  - `ssh_port_forward_socket` string, required
  - `ssh_pty` boolean, required
  - `created_at` string, dateTime, required
  - `updated_at` string, dateTime, required
  - `_links` SshPortalConnectionLinks
    - `operation` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri
    - `self` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri

## Other responses

- `default`: Error response. Often a 4xx or 5xx status code

## Changes

- **2026-07-24** `1dc1e5b8c6eb`: 1 breaking, 2 info
  - the `ssh_port_forward_socket` response's property type changed from `integer` to `string` for status `201`
  - added the new optional `header` request parameter `Prefer`
  - added the new optional `query` request parameter `no_embed`

[Operation history](https://skmtc.dev/aptible/apis/aptible-api-v1/changes/operations/:operation_id/ssh_portal_connections/post.md)

---

[API](https://skmtc.dev/aptible/apis/aptible-api-v1.md) - [All operations](https://skmtc.dev/aptible/apis/aptible-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/aptible/apis/aptible-api-v1/revisions/a21f6b1bc6fe?raw)
