Create a new credential to store API keys and authentication tokens for integrations used in your flows.
Request Body
User-defined name for the credential
Type of credential (e.g., openAIApi, pineconeApi, azureOpenAIApi)
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
Unique identifier for the created credential
User-defined name for the credential
Encrypted credential data
When the credential was created
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
- Never commit credentials to version control
- Use environment variables for sensitive values
- Rotate credentials regularly
- Use workspace-level credentials for shared resources
- Audit credential usage regularly
Error Responses
Bad Request - Missing required fields or invalid credential format
Unauthorized - Invalid or missing API key
Forbidden - Insufficient permissions to create credentials
Precondition Failed - Request body not provided
Internal Server Error - Error creating credential