Skip to main content
POST
/
api
/
v1
/
credentials
Create Credential
curl --request POST \
  --url https://api.example.com/api/v1/credentials \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "credentialName": "<string>",
  "plainDataObj": {}
}
'
{
  "400": {},
  "401": {},
  "403": {},
  "412": {},
  "500": {},
  "id": "<string>",
  "name": "<string>",
  "credentialName": "<string>",
  "encryptedData": "<string>",
  "createdDate": {},
  "workspaceId": "<string>"
}
Create a new credential to store API keys and authentication tokens for integrations used in your flows.

Request Body

name
string
required
User-defined name for the credential
credentialName
string
required
Type of credential (e.g., openAIApi, pineconeApi, azureOpenAIApi)
plainDataObj
object
required
Object containing the credential fields and values. Structure varies by credential type.

Credential Types

Common credential types include:
  • openAIApi - OpenAI API key
  • azureOpenAIApi - Azure OpenAI credentials
  • anthropicApi - Anthropic API key
  • pineconeApi - Pinecone API key
  • cohereApi - Cohere API key
  • huggingFaceApi - HuggingFace API key

Response

id
string
Unique identifier for the created credential
name
string
User-defined name for the credential
credentialName
string
Type of credential
encryptedData
string
Encrypted credential data
createdDate
timestamp
When the credential was created
workspaceId
string
ID of the workspace containing this credential

Example Request - OpenAI

curl -X POST \
  'https://your-flowise-instance.com/api/v1/credentials' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My OpenAI Key",
    "credentialName": "openAIApi",
    "plainDataObj": {
      "openAIApiKey": "sk-..."
    }
  }'

Example Request - Pinecone

curl -X POST \
  'https://your-flowise-instance.com/api/v1/credentials' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Pinecone Production",
    "credentialName": "pineconeApi",
    "plainDataObj": {
      "pineconeApiKey": "pcsk_..."
    }
  }'

Example Response

{
  "id": "cred-789",
  "name": "My OpenAI Key",
  "credentialName": "openAIApi",
  "encryptedData": "encrypted_string_here",
  "createdDate": "2024-01-20T16:00:00Z",
  "updatedDate": "2024-01-20T16:00:00Z",
  "workspaceId": "workspace-123"
}

Security Best Practices

  1. Never commit credentials to version control
  2. Use environment variables for sensitive values
  3. Rotate credentials regularly
  4. Use workspace-level credentials for shared resources
  5. Audit credential usage regularly

Error Responses

400
error
Bad Request - Missing required fields or invalid credential format
401
error
Unauthorized - Invalid or missing API key
403
error
Forbidden - Insufficient permissions to create credentials
412
error
Precondition Failed - Request body not provided
500
error
Internal Server Error - Error creating credential

Build docs developers (and LLMs) love