Skip to main content
Credentials

Create a Credential

Forward API reference.

Description

Creates a Credential in the specified Vault. Sensitive authentication fields are never echoed in the response.

Path

POST /api/v1/forward/vaults/{id}/credentials

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Idempotency-KeyNoOptional idempotency key for create requests. The same key can only be used for the same request.
Content-TypeYesapplication/json

Path parameters

ParameterTypeRequiredDescription
idstringYesVault ID.

Request body

FieldTypeRequiredDescription
authobjectYesCredential authentication information. Supports static_bearer, mcp_oauth, and environment_variable; responses include only redacted, non-secret fields.
display_namestringNoCompatibility field. It is not currently persisted, and Forward responses always return an empty string.
metadataobjectNoMetadata object. created_by is reserved and must not be supplied (supplying it returns 400).

auth fields

static_bearer:
FieldTypeRequiredDescription
typestringYesMust be static_bearer.
mcp_server_urlstringYesMCP Server URL.
tokenstringYesBearer token. Write-only and never returned in responses.
mcp_oauth:
FieldTypeRequiredDescription
typestringYesMust be mcp_oauth.
mcp_server_urlstringYesMCP Server URL.
access_tokenstringYesOAuth access token. Write-only and never returned in responses.
expires_atstringNoAccess token expiration time in RFC 3339 format.
refreshobjectNoOAuth refresh configuration. Secret fields are never returned in responses.
environment_variable:
FieldTypeRequiredDescription
typestringYesMust be environment_variable.
secret_namestringYesEnvironment variable name. Must match [A-Za-z_][A-Za-z0-9_]*.
secret_valuestringYesEnvironment variable value. Write-only and never returned in responses.
auth.protocol is not a Forward Credential request field and has no effect if provided.

Example request

{
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "https://mcp.example.com",
    "token": "secret_token"
  },
  "display_name": "example-mcp",
  "metadata": {
    "source": "console"
  }
}

Example response

HTTP 201 Created
{
  "id": "vcred_xxx",
  "type": "vault_credential",
  "vault_id": "vault_xxx",
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "https://mcp.example.com"
  },
  "display_name": "",
  "metadata": {
    "source": "console"
  },
  "created_at": "2026-07-23T10:00:00Z",
  "updated_at": "2026-07-23T10:00:00Z"
}

Response fields

FieldTypeDescription
idstringCredential ID.
typestringAlways vault_credential.
vault_idstringParent Vault ID.
authobjectRedacted authentication data.
display_namestringCurrently always an empty string.
metadataobjectCredential Metadata.
created_atstringCreation time in RFC 3339 format.
updated_atstringLast update time in RFC 3339 format.

Errors

HTTPTypeTrigger
400invalid_request_errorThe request body, path parameters, or query parameters are invalid.
400invalid_request_errorIf the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field.
401authentication_errorThe authentication token is missing or invalid.
403permission_errorThe caller cannot access this resource.
404not_found_errorThe Vault does not exist or is not visible.
409conflict_errorThe resource state, references, or idempotency key conflict.
500/502/503api_errorForward or a dependent service failed.
Create a Credential - Qoder