---
title: "Connect a PieFed account using instance credentials"
method: POST
path: "/accounts/piefed/login"
tags: ["Accounts"]
---

# Connect a PieFed account using instance credentials

`POST /accounts/piefed/login`

## Request

- Base URL: `https://app.openpo.st/api/v1`
- URL: `https://app.openpo.st/api/v1/accounts/piefed/login`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `openpost_session`

## Request body

- FediverseLoginInputBody
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `channel` string: PeerTube channel to connect (required when the account owns several)
  - `instance_url` string, required: Fediverse instance URL
  - `intent` 'production' | 'certification_test': Typed execution intent; certification_test requires an unscoped instance administrator
  - `password` string, required: Instance password (exchanged once, never stored)
  - `username` string, required: Instance username
  - `workspace_id` string, required: Workspace ID

## Response `200`

OK

- FediverseLoginResponse
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `account_id` string, required: OpenPost destination account ID
  - `account_ids` string[], nullable, required: All connected OpenPost account IDs
  - `connection_id` string: Pending selection ID for the channel picker
  - `open_fresh_composer` boolean, required: Whether this is the Workspace's first connected destination
  - `options` AccountSelectionOption[], nullable: Selectable channels when selection is required
    - `avatar_url` string
    - `description` string
    - `display_name` string
    - `extra` object
    - `id` string, required
    - `kind` string
    - `username` string
  - `selection_required` boolean: True when the caller must complete channel selection
  - `workspace_id` string, required: Workspace receiving the connected destination

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/openpo/apis/openpost-api.md) · [All operations](https://skmtc.dev/openpo/apis/openpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openpo/apis/openpost-api/revisions/67d3964458a7?raw)
