NylorunDocsBeta
Management APIVaultsCredentials

Add a credential

POST
/v1/tenant/vaults/{vaultId}/credentials

A bearer token or OAuth tokens, bound to the URLs a tool may send them to.

Authorization

managementKey
headerAuthorizationBearer <token>

A management key of the Tenant (role management): it reaches the Management API (/v1/tenant/*) and /v1/me, as itself, never for a subject. Issued only on the Tenant's machine (nylorun-operate keys put <id> --role management) or from NYLORUN_MANAGEMENT_KEY_FILE. Never accepted from a browser (Origin).

Path Parameters

vaultId*string

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Request Body

application/json
  1. body
requestId*string
Length1 <= length
idempotencyKey*string
Length1 <= length <= 256
name*string
Length1 <= length
auth*|

Response Body

The credential, without its secret

application/json
  1. response
id*string
vaultId*string
name*string
type*string
Value in"bearer""oauth"
binding*
expiresAt?string
createdAt*string
rotatedAt?string
import { createAdmin } from "@nylorun/admin";const admin = createAdmin();await admin.vaults.credentials.create("vlt_123", {  name: "linear",  idempotencyKey: "linear",  auth: {    type: "bearer",    url: "https://mcp.linear.app/mcp",    token: process.env.LINEAR_TOKEN!,  },});
{  "id": "string",  "vaultId": "string",  "name": "string",  "type": "bearer",  "binding": {    "url": "string"  },  "expiresAt": "string",  "createdAt": "string",  "rotatedAt": "string"}