All error codes

invalid_ssh_key

HTTP 422 SSH public key is not valid

What happened

The public key material you sent is not a valid OpenSSH public key. You get this when adding a key to your key pool, which is shared by all your projects.

What to do

Send the single-line contents of the .pub file in public_key - key type, base64 body, and an optional comment. Never send a private key or a path to a file.

Retrying

Fix the request and send it again.

How it arrives

{
    "type": "https://docs.fiberax.com/errors/invalid_ssh_key",
    "title": "SSH public key is not valid",
    "status": 422,
    "code": "invalid_ssh_key",
    "request_id": "a277dcd1ca652c65"
}

Branch your code on code, never on the wording of title.