Skip to Content
SeyloDocs
API referenceGit credentials

Add a git credential

POST
/api/v1/git.createCredential

Stores an HTTPS access token (kind token) or an SSH private key (kind ssh_key) for a git host, sealed. To have the panel make the key pair instead, use git.generateSshKey.

Needs git.manage, which owners and admins hold. Not available to MCP clients or the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 60
kind*string|string
host*string

Host the credential is for, for example "gitlab.com" or "git.example.com:2222".

Match^[A-Za-z0-9.-]+(:[0-9]{1,5})?$
Length1 <= length <= 253
username?string
Lengthlength <= 100
token?string
Length1 <= length <= 1000
privateKey?string
Match^-----BEGIN [A-Z ]*PRIVATE KEY-----
Length1 <= length <= 20000
knownHosts?string

known_hosts lines; empty uses the built-in keys of well-known hosts.

Lengthlength <= 20000

Response Body

Success.

application/json
  1. response
id*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string
Length1 <= length <= 60
kind*string|string
host*string

Host the credential is for, for example "gitlab.com" or "git.example.com:2222".

Match^[A-Za-z0-9.-]+(:[0-9]{1,5})?$
Length1 <= length <= 253
username*string|null
publicKey*string|null
fingerprint*string|null
knownHosts*string
origin*string|string|string
usedBy*integer
Range0 <= value
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/git.createCredential' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "kind": "token",  "host": "string"}'
Example Response
{  "id": "string",  "name": "string",  "kind": "token",  "host": "string",  "username": "string",  "publicKey": "string",  "fingerprint": "string",  "knownHosts": "string",  "origin": "manual",  "usedBy": 0,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}