xhostd Ssh Keys API
The Ssh Keys API from xhostd — 4 operation(s) for ssh keys.
The Ssh Keys API from xhostd — 4 operation(s) for ssh keys.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/xhostd-com:xhostd-com-ssh-keys-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Xhostd Com Ssh Keys API
version: 0.1.0
description: 'Operations tagged Ssh Keys across 2 of this provider''s published API definitions: api.xhostd.com-openapi.json, console.xhostd.com-openapi.json. Each path carries the servers of the definition it was published in.'
tags:
- name: Ssh Keys
paths:
/ssh-keys:
post:
summary: Create Ssh Key
description: 'Register one OpenSSH public key for the caller.
The route answers 400 for a line the parser refuses, and 409 for a
fingerprint the table already holds. The unique constraint is
global, so the same key cannot name two accounts.
The route writes one ``ssh_key.added`` notification and queues one
``security.ssh_key_added`` mail in the same transaction as the row.
A coding agent can register a key for the user, so the user must
learn about the new key. Both carry the same text: a bell row alone
reaches nobody on an account no person watches, and the mail leaves
the console (design/EMAIL.md). An account that holds no verified
address gets the notification alone, because the sink writes no row
for an empty recipient.
``api_login`` stores the caller''s value. True means the key can also
mint a bearer token through ``POST /auth/ssh-key``, and the shared
text says so. The console sends a checkbox that starts cleared, so a
pasted key stays a git identity unless the person asks for more.
Registering a key is a mint, so the mint rule gates it. A key
satisfies ``repo:*`` by construction (design/AUTH.md), so the route
requires ``repo:*``; ``api_login`` additionally requires the whole
default set, because the key goes on to mint that set plus
``email:bind`` through ``POST /auth/ssh-key``. Either refusal answers
403 ``scope_denied``.
``api_login`` also needs an ``ssh-ed25519`` key, the one type
``POST /auth/ssh-key`` accepts. The route answers 400 for any other
type, so the stored flag never promises a sign-in the login route
refuses. Every other accepted type still registers as a git identity.
``api_login`` then needs one more thing, because that mint carries
``email:bind`` and a bound address takes the account''s console: the
account holds a verified address, or the caller''s own token carries
``email:bind``. The second arm is the rule that a key-proved
credential can register another key — only the two proof-based mints
in :mod:`xhostd.routes.registration` grant that scope, so a token
from ``POST /credentials`` or ``POST /tokens`` never holds it, and an
agent with no address still rotates its own keys. A refusal answers
409 ``conflict``, the ``POST /me/email-verifications`` shape: nothing
about the caller''s authorization is wrong, and the account is not
ready.
The two scope checks run first, before any read of the account, so a
caller that fails authorization learns nothing about account state.
This route carries NO protected-action gate. A gate would close the
one path that lets an agent work without a secret in its context. The
scope gate is not that gate: a general credential passes it, and only
a narrowed one, which could not reach the repositories itself, is
refused.'
operationId: create_ssh_key_ssh_keys_post
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSshKeyRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SshKeyInfo'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Ssh Keys
get:
summary: List Ssh Keys
description: List the caller's own SSH keys, newest first.
operationId: list_ssh_keys_ssh_keys_get
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SshKeyListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Ssh Keys
/ssh-keys/{key_id}:
delete:
summary: Delete Ssh Key
description: 'Delete one SSH key the caller owns.
A key of another account answers 404 and not 403, the
``DELETE /tokens/{id}`` rule: the answer tells a stranger nothing
about the existence of a row.'
operationId: delete_ssh_key_ssh_keys__key_id__delete
parameters:
- name: key_id
in: path
required: true
schema:
type: string
format: uuid
title: Key Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Ssh Keys
/ssh-keys/new:
post:
summary: Create Ssh Key
description: 'Register the pasted public-key line for the signed-in user.
The route sends the line unchanged, so xhostd''s parser decides what a
valid line is. A 400 and a 409 each carry the platform''s own message
to the reader.
The form''s checkbox rides along as ``api_login``. A ticked box
registers a key that also mints API tokens through
``POST /auth/ssh-key``; a cleared one registers a git identity alone
(design/AUTH.md). A console account holds a verified address, so the
platform''s ``api_login`` gate passes here.'
operationId: create_ssh_key_ssh_keys_new_post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Ssh Keys
/ssh-keys/{key_id}/delete:
post:
summary: Delete Ssh Key
description: 'Delete one SSH key of the signed-in user.
The delete IS the revoke: the row carries no ``revoked_at`` column.
xhostd answers 404 for a key of another account, so this route needs
no owner test of its own.'
operationId: delete_ssh_key_ssh_keys__key_id__delete_post
parameters:
- name: key_id
in: path
required: true
schema:
type: string
format: uuid
title: Key Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Ssh Keys
components:
schemas:
SshKeyInfo:
properties:
id:
type: string
format: uuid
title: Id
label:
anyOf:
- type: string
- type: 'null'
title: Label
algo:
type: string
title: Algo
fingerprint:
type: string
title: Fingerprint
created_at:
type: string
format: date-time
title: Created At
last_used_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Used At
api_login:
type: boolean
title: Api Login
type: object
required:
- id
- label
- algo
- fingerprint
- created_at
- last_used_at
- api_login
title: SshKeyInfo
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
SshKeyListResponse:
properties:
ssh_keys:
items:
$ref: '#/components/schemas/SshKeyInfo'
type: array
title: Ssh Keys
type: object
required:
- ssh_keys
title: SshKeyListResponse
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
CreateSshKeyRequest:
properties:
public_key:
type: string
title: Public Key
label:
anyOf:
- type: string
- type: 'null'
title: Label
api_login:
type: boolean
title: Api Login
default: false
additionalProperties: false
type: object
required:
- public_key
title: CreateSshKeyRequest
x-refined-from:
- api.xhostd.com-openapi.json
- console.xhostd.com-openapi.json